QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#612903 | #8934. Challenge NPC | ticking_away# | AC ✓ | 16ms | 5248kb | C++20 | 1.5kb | 2024-10-05 13:17:06 | 2024-10-05 13:17:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ui = unsigned int;
using ull = unsigned long long;
using ll = long long;
#define endl '\n'
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int maxn = 2e5 + 10;
const int mod = 1000000007;
#define inl inline
#define fr(i, a, b) for (int i = a; i <= b; i++)
#define ford(i, a, b) for (int i = a; i >= b; i--)
#define forall(i, a) for (auto &i : a)
/**
____ ___ _____
/ ___| _ _ / _ \___ /
\___ \| | | | | | ||_ \
___) | |_| | |_| |__) |
|____/ \__, |\___/____/
|___/
*/
istream &operator>>(istream &in, vector<int> &v)
{
for (auto &i : v)
in >> i;
return in;
}
ostream &operator<<(ostream &out, vector<int> &v)
{
for (auto &i : v)
out << i << " ";
return out;
}
bool _output = 0;
void solve()
{
int k;
cin >> k;
vector<pii> edge;
fr(i, 2, k + 2)
{
fr(j, 1, i - 1)
{
edge.push_back({i * 2 - 1, j * 2});
edge.push_back({i * 2, j * 2 - 1});
}
}
cout << (k + 2) * 2 << " " << edge.size() << " " << 2 << endl;
fr(i, 1, k + 2)
{
cout << 1 << " " << 2 << endl;
}
for (auto [x, y] : edge)
{
cout << x << " " << y << endl;
}
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int _ = 1;
if (_output)
cin >> _;
while (_--)
solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3604kb
input:
1
output:
6 6 2 1 2 1 2 1 2 3 2 4 1 5 2 6 1 5 4 6 3
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
2
output:
8 12 2 1 2 1 2 1 2 1 2 3 2 4 1 5 2 6 1 5 4 6 3 7 2 8 1 7 4 8 3 7 6 8 5
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
3
output:
10 20 2 1 2 1 2 1 2 1 2 1 2 3 2 4 1 5 2 6 1 5 4 6 3 7 2 8 1 7 4 8 3 7 6 8 5 9 2 10 1 9 4 10 3 9 6 10 5 9 8 10 7
result:
ok ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
4
output:
12 30 2 1 2 1 2 1 2 1 2 1 2 1 2 3 2 4 1 5 2 6 1 5 4 6 3 7 2 8 1 7 4 8 3 7 6 8 5 9 2 10 1 9 4 10 3 9 6 10 5 9 8 10 7 11 2 12 1 11 4 12 3 11 6 12 5 11 8 12 7 11 10 12 9
result:
ok ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
5
output:
14 42 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 3 2 4 1 5 2 6 1 5 4 6 3 7 2 8 1 7 4 8 3 7 6 8 5 9 2 10 1 9 4 10 3 9 6 10 5 9 8 10 7 11 2 12 1 11 4 12 3 11 6 12 5 11 8 12 7 11 10 12 9 13 2 14 1 13 4 14 3 13 6 14 5 13 8 14 7 13 10 14 9 13 12 14 11
result:
ok ok
Test #6:
score: 0
Accepted
time: 12ms
memory: 5132kb
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: 12ms
memory: 5164kb
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: 16ms
memory: 5168kb
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: 5160kb
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: 16ms
memory: 5248kb
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