QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#96191 | #5255. Greedy Drawers | 8BQube# | AC ✓ | 2ms | 3472kb | C++17 | 802b | 2023-04-13 16:36:27 | 2023-04-13 16:36:31 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define X first
#define Y second
#define SZ(a) ((int)a.size())
#define ALL(v) v.begin(), v.end()
#define pb push_back
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n;
cin >> n;
vector<pii> A, B;
int x = 3;
for (int i = 1; i <= 5 || n % 4 != 0; i++, --n)
A.pb({1, 1}), B.pb({1, 1});
for (; n > 0; n -= 4, x += 3) {
A.pb({x - 1, x + 1}); B.pb({x - 1, x + 1});
A.pb({x, x}); B.pb({x, x + 1});
A.pb({x, x}); B.pb({x, x});
A.pb({x, x}); B.pb({x, x});
}
for (auto [x, y] : A)
cout << x << " " << y << "\n";
cout << "\n";
for (auto [x, y] : B)
cout << x << " " << y << "\n";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3444kb
input:
150
output:
1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 39 39...
result:
ok you killed Janko's strategy
Test #2:
score: 0
Accepted
time: 2ms
memory: 3396kb
input:
151
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 3...
result:
ok you killed Janko's strategy
Test #3:
score: 0
Accepted
time: 2ms
memory: 3404kb
input:
152
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 ...
result:
ok you killed Janko's strategy
Test #4:
score: 0
Accepted
time: 2ms
memory: 3416kb
input:
153
output:
1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 39 39 39 ...
result:
ok you killed Janko's strategy
Test #5:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
154
output:
1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 39 39...
result:
ok you killed Janko's strategy
Test #6:
score: 0
Accepted
time: 0ms
memory: 3392kb
input:
155
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 3...
result:
ok you killed Janko's strategy
Test #7:
score: 0
Accepted
time: 0ms
memory: 3344kb
input:
156
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 ...
result:
ok you killed Janko's strategy
Test #8:
score: 0
Accepted
time: 1ms
memory: 3364kb
input:
157
output:
1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 39 39 39 ...
result:
ok you killed Janko's strategy
Test #9:
score: 0
Accepted
time: 2ms
memory: 3388kb
input:
158
output:
1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 39 39...
result:
ok you killed Janko's strategy
Test #10:
score: 0
Accepted
time: 1ms
memory: 3356kb
input:
159
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 3...
result:
ok you killed Janko's strategy
Test #11:
score: 0
Accepted
time: 2ms
memory: 3448kb
input:
160
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 ...
result:
ok you killed Janko's strategy
Test #12:
score: 0
Accepted
time: 1ms
memory: 3356kb
input:
161
output:
1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 39 39 39 ...
result:
ok you killed Janko's strategy
Test #13:
score: 0
Accepted
time: 2ms
memory: 3368kb
input:
162
output:
1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 39 39...
result:
ok you killed Janko's strategy
Test #14:
score: 0
Accepted
time: 2ms
memory: 3356kb
input:
163
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 3...
result:
ok you killed Janko's strategy
Test #15:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
164
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 ...
result:
ok you killed Janko's strategy
Test #16:
score: 0
Accepted
time: 2ms
memory: 3472kb
input:
165
output:
1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 39 39 39 ...
result:
ok you killed Janko's strategy
Test #17:
score: 0
Accepted
time: 2ms
memory: 3364kb
input:
166
output:
1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 39 39...
result:
ok you killed Janko's strategy
Test #18:
score: 0
Accepted
time: 2ms
memory: 3328kb
input:
167
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 3...
result:
ok you killed Janko's strategy
Test #19:
score: 0
Accepted
time: 0ms
memory: 3456kb
input:
168
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 ...
result:
ok you killed Janko's strategy
Test #20:
score: 0
Accepted
time: 2ms
memory: 3396kb
input:
250
output:
1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 3 3 3 3 3 5 7 6 6 6 6 6 6 8 10 9 9 9 9 9 9 11 13 12 12 12 12 12 12 14 16 15 15 15 15 15 15 17 19 18 18 18 18 18 18 20 22 21 21 21 21 21 21 23 25 24 24 24 24 24 24 26 28 27 27 27 27 27 27 29 31 30 30 30 30 30 30 32 34 33 33 33 33 33 33 35 37 36 36 36 36 36 36 38 40 39 39...
result:
ok you killed Janko's strategy