QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#540314 | #8934. Challenge NPC | ucup-team3877# | AC ✓ | 80ms | 6104kb | C++20 | 1.1kb | 2024-08-31 16:50:55 | 2024-08-31 16:50:55 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(),(v).end()
#define pb(a) push_back(a)
#define rep(i, n) for(int i=0;i<n;i++)
#define foa(e, v) for(auto& e : v)
using ll = long long;
const ll MOD7 = 1000000007, MOD998 = 998244353, INF = (1LL << 60);
#define dout(a) cout<<fixed<<setprecision(10)<<a<<endl;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int k;
cin >> k;
k += 2;
int n = k * 2;
vector<pair<int, int>> edges;
for(int i = 1; i <= n; i ++) {
if(i & 1) {
for(int j = 2; j < i; j += 2) {
edges.push_back({j, i});
}
} else {
for(int j = 1; j + 2 < i; j += 2) {
edges.push_back({j, i});
}
}
}
// for(int i = 1; i < n; i += 2) edges.push_back({i, n});
cout << n << " " << edges.size() << " " << 2 << endl;
for(int i = 1; i <= n ; i++) {
cout << (i % 2 ? 1 : 2) << " ";
}
cout << endl;
for(auto [x, y] : edges) {
cout << x << " " << y << endl;
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3540kb
input:
1
output:
6 6 2 1 2 1 2 1 2 2 3 1 4 2 5 4 5 1 6 3 6
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
2
output:
8 12 2 1 2 1 2 1 2 1 2 2 3 1 4 2 5 4 5 1 6 3 6 2 7 4 7 6 7 1 8 3 8 5 8
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
3
output:
10 20 2 1 2 1 2 1 2 1 2 1 2 2 3 1 4 2 5 4 5 1 6 3 6 2 7 4 7 6 7 1 8 3 8 5 8 2 9 4 9 6 9 8 9 1 10 3 10 5 10 7 10
result:
ok ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
4
output:
12 30 2 1 2 1 2 1 2 1 2 1 2 1 2 2 3 1 4 2 5 4 5 1 6 3 6 2 7 4 7 6 7 1 8 3 8 5 8 2 9 4 9 6 9 8 9 1 10 3 10 5 10 7 10 2 11 4 11 6 11 8 11 10 11 1 12 3 12 5 12 7 12 9 12
result:
ok ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
5
output:
14 42 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 3 1 4 2 5 4 5 1 6 3 6 2 7 4 7 6 7 1 8 3 8 5 8 2 9 4 9 6 9 8 9 1 10 3 10 5 10 7 10 2 11 4 11 6 11 8 11 10 11 1 12 3 12 5 12 7 12 9 12 2 13 4 13 6 13 8 13 10 13 12 13 1 14 3 14 5 14 7 14 9 14 11 14
result:
ok ok
Test #6:
score: 0
Accepted
time: 55ms
memory: 5128kb
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: 64ms
memory: 5128kb
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: 47ms
memory: 5232kb
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: 36ms
memory: 5244kb
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: 80ms
memory: 6104kb
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