QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#820330#8934. Challenge NPCLinver#AC ✓24ms9420kbC++23920b2024-12-18 21:00:542024-12-18 21:00:56

Judging History

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

  • [2024-12-18 21:00:56]
  • 评测
  • 测评结果:AC
  • 用时:24ms
  • 内存:9420kb
  • [2024-12-18 21:00:54]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> PII;
const int N=4e5+10,M=1e5+10;
const int INF=1e18;
const int mod=998244353;
// const int mod=1e9+7;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); 
int get(int i,int j){
    return i*2-!j;
}
void solve(){
    int k;
    cin>>k;
    k+=2;
    vector<int> a(2*k+1);
    vector<PII> e;
    a[1]=0,a[2]=1;
    for(int i=2;i<=k;i++){
        a[get(i,0)]=0,a[get(i,1)]=1;
        for(int j=1;j<i;j++){
            e.emplace_back(get(j,0),get(i,1));
            e.emplace_back(get(j,1),get(i,0));
        }
    }
    cout<<2*k<<" "<<e.size()<<" "<<"2\n";
    for(int i=1;i<=2*k;i++)cout<<a[i]+1<<" \n"[i==2*k];
    for(auto [u,v]:e)cout<<u<<" "<<v<<"\n";
}
signed main(){
    cin.tie(0)->sync_with_stdio(0);
    int T=1;
    // cin>>T;
    while(T--)solve();
    return 0;
}

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

详细

Test #1:

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

input:

1

output:

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

result:

ok ok

Test #2:

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

input:

2

output:

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

result:

ok ok

Test #3:

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

input:

3

output:

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

result:

ok ok

Test #4:

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

input:

4

output:

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

result:

ok ok

Test #5:

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

input:

5

output:

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

result:

ok ok

Test #6:

score: 0
Accepted
time: 14ms
memory: 8492kb

input:

433

output:

870 188790 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 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 #7:

score: 0
Accepted
time: 24ms
memory: 7808kb

input:

500

output:

1004 251502 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 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 #8:

score: 0
Accepted
time: 24ms
memory: 7696kb

input:

499

output:

1002 250500 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 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 #9:

score: 0
Accepted
time: 13ms
memory: 9420kb

input:

457

output:

918 210222 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 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 #10:

score: 0
Accepted
time: 21ms
memory: 8836kb

input:

497

output:

998 248502 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 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

Extra Test:

score: 0
Extra Test Passed