QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#589038 | #8934. Challenge NPC | ucup-team093# | AC ✓ | 25ms | 5348kb | C++20 | 954b | 2024-09-25 15:50:05 | 2024-09-25 15:50:06 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int N = 2048;
int n, c[N];
vector<int> v[2];
vector<pii> ans;
int main() {
int k;
cin >> k;
k += 2;
v[0].push_back(1);
v[1].push_back(2);
ans.emplace_back(1, 2);
c[1] = 1;
c[2] = 2;
for(int i = 3, lst = 1; i <= k; i ++) {
for(int j : v[lst ^ 1])
if(c[j] < i - 2) ans.emplace_back(j, i * 2 - 3);
c[i * 2 - 3] = i - 2;
v[lst].push_back(i * 2 - 3);
for(int j : v[lst])
ans.emplace_back(j, i * 2 - 2);
c[i * 2 - 2] = i;
v[lst ^= 1].push_back(i * 2 - 2);
}
cout << k * 2 - 2 << " " << ans.size() << " 2\n";
for(int i = 1; i <= k * 2 - 2; i ++)
if(binary_search(v[0].begin(), v[0].end(), i)) cout << "1 ";
else cout << "2 ";
cout << "\n";
for(auto [a, b] : ans) cout << a << " " << b << "\n";
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3644kb
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: 3592kb
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: 3644kb
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: 3652kb
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: 3724kb
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: 19ms
memory: 5248kb
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: 18ms
memory: 5348kb
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: 25ms
memory: 5244kb
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: 22ms
memory: 5228kb
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: 21ms
memory: 5344kb
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