QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#661139#8934. Challenge NPCDBsoleil#AC ✓19ms5420kbC++23690b2024-10-20 14:53:082024-10-20 14:53:08

Judging History

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

  • [2024-10-20 14:53:08]
  • 评测
  • 测评结果:AC
  • 用时:19ms
  • 内存:5420kb
  • [2024-10-20 14:53:08]
  • 提交

answer

#include<bits/stdc++.h>
#define pb push_back
#define fi first 
#define se second 
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

const int N=1e3+5;
int k,n;
vector<pii>ve;

void input()
{
    scanf("%d",&k);
    n=k+2;
}

int num(int x,int y) {return x*2-2+y;}

void ade(int x,int y) {ve.pb({y,x});}

void solve()
{
    input();
    for(int i=2;i<=n;i++)
    {
        for(int j=1;j<i;j++) ade(num(i,1),num(j,2)),ade(num(i,2),num(j,1));
    }
    printf("%d %d %d\n",n*2,ve.size(),2);
    for(int i=1;i<=n*2;i++) printf("%d ",i%2+1);
    printf("\n");
    for(auto [x,y]:ve) printf("%d %d\n",x,y);
}

int main()
{
    solve();
}

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

詳細信息

Test #1:

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

input:

1

output:

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

result:

ok ok

Test #2:

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

input:

2

output:

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

result:

ok ok

Test #3:

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

input:

3

output:

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

result:

ok ok

Test #4:

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

input:

4

output:

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

result:

ok ok

Test #5:

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

input:

5

output:

14 42 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 
2 3
1 4
2 5
1 6
4 5
3 6
2 7
1 8
4 7
3 8
6 7
5 8
2 9
1 10
4 9
3 10
6 9
5 10
8 9
7 10
2 11
1 12
4 11
3 12
6 11
5 12
8 11
7 12
10 11
9 12
2 13
1 14
4 13
3 14
6 13
5 14
8 13
7 14
10 13
9 14
12 13
11 14

result:

ok ok

Test #6:

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

input:

433

output:

870 188790 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1...

result:

ok ok

Test #7:

score: 0
Accepted
time: 19ms
memory: 5416kb

input:

500

output:

1004 251502 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ...

result:

ok ok

Test #8:

score: 0
Accepted
time: 7ms
memory: 5192kb

input:

499

output:

1002 250500 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ...

result:

ok ok

Test #9:

score: 0
Accepted
time: 16ms
memory: 5212kb

input:

457

output:

918 210222 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1...

result:

ok ok

Test #10:

score: 0
Accepted
time: 19ms
memory: 5348kb

input:

497

output:

998 248502 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1...

result:

ok ok

Extra Test:

score: 0
Extra Test Passed