QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#606589 | #8934. Challenge NPC | Komorebie# | RE | 1ms | 3736kb | C++17 | 936b | 2024-10-03 10:51:36 | 2024-10-03 10:51:36 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define maxn 2005
bool flag[maxn];//判断
int tot,d[maxn][2];//dij存储的是cg为i,c为j的最小点
struct edge{
int x,y;
}b[maxn];
int col[maxn],n,m,cnt=0;
void solve(int x,int c){
for(int i=1;i<x;i++){
if(!d[i][c^1]){
solve(i,c^1);
}
}
d[x][c]=++tot;
if(c&1)col[tot]=1;
else col[tot]=2;
for(int i=1;i<x;i++){
++m;
b[m].x=tot;
b[m].y=d[i][c^1];
}
return ;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int k;
cin>>k;
d[1][1]=1;
col[++tot]=1;
for(int i=2;i<=k+2;i++){
solve(i,i&1);
}
cout<<tot<<" "<<m<<" "<<2<<endl;
for(int i=1;i<=tot;i++){
cout<<col[i]<<" ";
}
cout<<endl;
for(int i=1;i<=m;i++){
cout<<b[i].x<<" "<<b[i].y<<endl;
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3736kb
input:
1
output:
4 3 2 1 2 2 1 2 1 4 3 4 2
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
2
output:
6 7 2 1 2 2 1 1 2 2 1 4 3 4 2 5 3 6 1 6 5 6 4
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
3
output:
8 13 2 1 2 2 1 1 2 2 1 2 1 4 3 4 2 5 3 6 1 6 5 6 4 7 1 7 5 8 3 8 2 8 7 8 6
result:
ok ok
Test #4:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
4
output:
10 21 2 1 2 2 1 1 2 2 1 1 2 2 1 4 3 4 2 5 3 6 1 6 5 6 4 7 1 7 5 8 3 8 2 8 7 8 6 9 3 9 2 9 7 10 1 10 5 10 4 10 9 10 8
result:
ok ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
5
output:
12 31 2 1 2 2 1 1 2 2 1 1 2 2 1 2 1 4 3 4 2 5 3 6 1 6 5 6 4 7 1 7 5 8 3 8 2 8 7 8 6 9 3 9 2 9 7 10 1 10 5 10 4 10 9 10 8 11 1 11 5 11 4 11 9 12 3 12 2 12 7 12 6 12 11 12 10
result:
ok ok
Test #6:
score: -100
Runtime Error
input:
433