QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#665720#8934. Challenge NPCLaynAC ✓18ms3960kbC++14665b2024-10-22 14:56:402024-10-22 14:56:49

Judging History

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

  • [2024-10-22 14:56:49]
  • 评测
  • 测评结果:AC
  • 用时:18ms
  • 内存:3960kb
  • [2024-10-22 14:56:40]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=2000;
int n,m,k,c,a[N];
vector<int>t[2];
int main() {
    scanf("%d",&k);
    n=2*(k+1),m=k*k+k+1,c=2;
    printf("%d %d %d\n",n,m,c);
    for(int i=1;i<=k+1;i++) {
        if(i&1)printf("1 2 ");
        else printf("2 1 ");
    }puts("");
    t[0].push_back(0),t[1].push_back(1),printf("1 2\n"),a[0]=1,a[1]=2;
    for(int i=1;i<=k;i++) {
        int d=i&1,cur=2*i;
        for(auto j:t[d^1])if(a[j]<i)printf("%d %d\n",j+1,cur+1);
        t[d].push_back(cur),a[cur]=i;
        for(auto j:t[d])if(a[j]<i+2)printf("%d %d\n",j+1,cur+2);
        t[d^1].push_back(cur+1),a[cur+1]=i+2;
    }
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1

output:

4 3 2
1 2 2 1 
1 2
2 4
3 4

result:

ok ok

Test #2:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

2

output:

6 7 2
1 2 2 1 1 2 
1 2
2 4
3 4
3 5
1 6
4 6
5 6

result:

ok ok

Test #3:

score: 0
Accepted
time: 0ms
memory: 3880kb

input:

3

output:

8 13 2
1 2 2 1 1 2 2 1 
1 2
2 4
3 4
3 5
1 6
4 6
5 6
1 7
5 7
2 8
3 8
6 8
7 8

result:

ok ok

Test #4:

score: 0
Accepted
time: 0ms
memory: 3884kb

input:

4

output:

10 21 2
1 2 2 1 1 2 2 1 1 2 
1 2
2 4
3 4
3 5
1 6
4 6
5 6
1 7
5 7
2 8
3 8
6 8
7 8
2 9
3 9
7 9
1 10
4 10
5 10
8 10
9 10

result:

ok ok

Test #5:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

5

output:

12 31 2
1 2 2 1 1 2 2 1 1 2 2 1 
1 2
2 4
3 4
3 5
1 6
4 6
5 6
1 7
5 7
2 8
3 8
6 8
7 8
2 9
3 9
7 9
1 10
4 10
5 10
8 10
9 10
1 11
4 11
5 11
9 11
2 12
3 12
6 12
7 12
10 12
11 12

result:

ok ok

Test #6:

score: 0
Accepted
time: 11ms
memory: 3820kb

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: 14ms
memory: 3960kb

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: 18ms
memory: 3952kb

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: 15ms
memory: 3808kb

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: 14ms
memory: 3876kb

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