QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#606589#8934. Challenge NPCKomorebie#RE 1ms3736kbC++17936b2024-10-03 10:51:362024-10-03 10:51:36

Judging History

你现在查看的是最新测评结果

  • [2024-10-03 10:51:36]
  • 评测
  • 测评结果:RE
  • 用时:1ms
  • 内存:3736kb
  • [2024-10-03 10:51:36]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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

output:


result: