QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#606591#8934. Challenge NPCKomorebie#AC ✓72ms6940kbC++17941b2024-10-03 10:52:262024-10-03 10:52:27

Judging History

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

  • [2024-10-03 10:52:27]
  • 评测
  • 测评结果:AC
  • 用时:72ms
  • 内存:6940kb
  • [2024-10-03 10:52:26]
  • 提交

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

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3616kb

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: 1ms
memory: 3688kb

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: 1ms
memory: 3616kb

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: 3740kb

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: 1ms
memory: 3616kb

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: 0
Accepted
time: 35ms
memory: 5952kb

input:

433

output:

868 187923 2
1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1...

result:

ok ok

Test #7:

score: 0
Accepted
time: 72ms
memory: 6008kb

input:

500

output:

1002 250501 2
1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 ...

result:

ok ok

Test #8:

score: 0
Accepted
time: 68ms
memory: 6772kb

input:

499

output:

1000 249501 2
1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 ...

result:

ok ok

Test #9:

score: 0
Accepted
time: 47ms
memory: 5260kb

input:

457

output:

916 209307 2
1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1...

result:

ok ok

Test #10:

score: 0
Accepted
time: 60ms
memory: 6940kb

input:

497

output:

996 247507 2
1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1...

result:

ok ok

Extra Test:

score: 0
Extra Test Passed