QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#650417 | #8934. Challenge NPC | Yoshinow2001# | AC ✓ | 19ms | 5284kb | C++20 | 1013b | 2024-10-18 15:04:25 | 2024-10-18 15:04:26 |
Judging History
answer
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define endl '\n'
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int col[200010];
void solve() {
int k;
cin >> k;
int n = 4 + 2 * k;
int m = 0;
int c = 2;
vector<pair<int,int>> ans;
for(int i = 1 ;i <= n;i++){
col[i] = (i & 1) + 1;
for(int j = 1 ; j < i ;j++){
if((i ^ j) & 1) ans.push_back({i , j});
}
i++;
col[i] = (i & 1) + 1;
for(int j = 1 ; j + 1 < i ;j++){
if((i ^ j) & 1) ans.push_back({i , j});
}
}
m = ans.size();
cout << n <<' '<<m <<' '<<c<<endl;
for(int i = 1; i <= n;i++){
cout << col[i] <<' ';
}
cout << endl;
for(auto [x , y] : ans) {
cout << x << ' '<< y <<endl;
}
cout << endl;
}
int main(){
fastio;
solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3524kb
input:
1
output:
6 6 2 2 1 2 1 2 1 3 2 4 1 5 2 5 4 6 1 6 3
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
2
output:
8 12 2 2 1 2 1 2 1 2 1 3 2 4 1 5 2 5 4 6 1 6 3 7 2 7 4 7 6 8 1 8 3 8 5
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
3
output:
10 20 2 2 1 2 1 2 1 2 1 2 1 3 2 4 1 5 2 5 4 6 1 6 3 7 2 7 4 7 6 8 1 8 3 8 5 9 2 9 4 9 6 9 8 10 1 10 3 10 5 10 7
result:
ok ok
Test #4:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
4
output:
12 30 2 2 1 2 1 2 1 2 1 2 1 2 1 3 2 4 1 5 2 5 4 6 1 6 3 7 2 7 4 7 6 8 1 8 3 8 5 9 2 9 4 9 6 9 8 10 1 10 3 10 5 10 7 11 2 11 4 11 6 11 8 11 10 12 1 12 3 12 5 12 7 12 9
result:
ok ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
5
output:
14 42 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 3 2 4 1 5 2 5 4 6 1 6 3 7 2 7 4 7 6 8 1 8 3 8 5 9 2 9 4 9 6 9 8 10 1 10 3 10 5 10 7 11 2 11 4 11 6 11 8 11 10 12 1 12 3 12 5 12 7 12 9 13 2 13 4 13 6 13 8 13 10 13 12 14 1 14 3 14 5 14 7 14 9 14 11
result:
ok ok
Test #6:
score: 0
Accepted
time: 9ms
memory: 5284kb
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: 5284kb
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: 14ms
memory: 5184kb
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: 12ms
memory: 5208kb
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: 18ms
memory: 5200kb
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