Task: | LumberUolevi |
Sender: | aalto2024a_012 |
Submission time: | 2024-09-04 17:45:03 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | WRONG ANSWER | 0.00 s | details |
#3 | WRONG ANSWER | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.00 s | details |
#6 | WRONG ANSWER | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | WRONG ANSWER | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | WRONG ANSWER | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | WRONG ANSWER | 0.00 s | details |
#13 | WRONG ANSWER | 0.00 s | details |
#14 | ACCEPTED | 0.00 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | WRONG ANSWER | 0.00 s | details |
#17 | ACCEPTED | 0.00 s | details |
#18 | WRONG ANSWER | 0.00 s | details |
#19 | WRONG ANSWER | 0.00 s | details |
#20 | WRONG ANSWER | 0.00 s | details |
#21 | WRONG ANSWER | 0.00 s | details |
#22 | WRONG ANSWER | 0.00 s | details |
#23 | ACCEPTED | 0.00 s | details |
#24 | WRONG ANSWER | 0.00 s | details |
#25 | ACCEPTED | 0.00 s | details |
#26 | WRONG ANSWER | 0.00 s | details |
#27 | WRONG ANSWER | 0.00 s | details |
#28 | ACCEPTED | 0.00 s | details |
#29 | ACCEPTED | 0.00 s | details |
#30 | WRONG ANSWER | 0.00 s | details |
#31 | ACCEPTED | 0.00 s | details |
#32 | ACCEPTED | 0.00 s | details |
#33 | ACCEPTED | 0.00 s | details |
#34 | ACCEPTED | 0.00 s | details |
#35 | ACCEPTED | 0.00 s | details |
#36 | ACCEPTED | 0.00 s | details |
#37 | ACCEPTED | 0.00 s | details |
#38 | ACCEPTED | 0.00 s | details |
#39 | WRONG ANSWER | 0.00 s | details |
#40 | WRONG ANSWER | 0.00 s | details |
#41 | WRONG ANSWER | 0.00 s | details |
#42 | ACCEPTED | 0.00 s | details |
#43 | ACCEPTED | 0.00 s | details |
#44 | WRONG ANSWER | 0.00 s | details |
#45 | WRONG ANSWER | 0.00 s | details |
#46 | ACCEPTED | 0.01 s | details |
#47 | WRONG ANSWER | 0.01 s | details |
#48 | WRONG ANSWER | 0.00 s | details |
#49 | WRONG ANSWER | 0.01 s | details |
#50 | ACCEPTED | 0.01 s | details |
#51 | ACCEPTED | 0.02 s | details |
#52 | WRONG ANSWER | 0.01 s | details |
#53 | ACCEPTED | 0.01 s | details |
#54 | WRONG ANSWER | 0.01 s | details |
#55 | ACCEPTED | 0.01 s | details |
#56 | ACCEPTED | 0.01 s | details |
#57 | WRONG ANSWER | 0.02 s | details |
#58 | WRONG ANSWER | 0.02 s | details |
#59 | ACCEPTED | 0.04 s | details |
#60 | ACCEPTED | 0.03 s | details |
#61 | WRONG ANSWER | 0.04 s | details |
#62 | WRONG ANSWER | 0.04 s | details |
#63 | WRONG ANSWER | 0.04 s | details |
Code
#include <bits/stdc++.h> using namespace std; #define int long long string to_string(string s) { return '"' + s + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(bool b) { return (b ? "true" : "false"); } template <typename A, typename B> string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } template <typename A> string to_string(A v) { bool first = true; string res = "{"; for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); } res += "}"; return res; } void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); } #ifdef LOCAL #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) 42 #endif const int N = 2e5 + 5; int n, k; signed main() { cin.tie(0)->sync_with_stdio(0); cin >> n >> k; set<int> st; for (int i = 1; i <= n; i++) st.insert(i); int take = min((n - 1) / 2, k / 2); for (int i = 1; i <= take; i++) { cout << i << ' ' << n - i << ' '; st.erase(i); st.erase(n - i); k -= 2; } while (k--) { cout << *st.begin() << ' '; st.erase(st.begin()); } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1 1 |
correct output |
---|
1 |
user output |
---|
1 |
Test 2
Verdict: WRONG ANSWER
input |
---|
2 1 |
correct output |
---|
2 |
user output |
---|
1 |
Test 3
Verdict: WRONG ANSWER
input |
---|
2 1 |
correct output |
---|
2 |
user output |
---|
1 |
Test 4
Verdict: ACCEPTED
input |
---|
3 2 |
correct output |
---|
1 2 |
user output |
---|
1 2 |
Test 5
Verdict: ACCEPTED
input |
---|
3 3 |
correct output |
---|
1 2 3 |
user output |
---|
1 2 3 |
Test 6
Verdict: WRONG ANSWER
input |
---|
4 1 |
correct output |
---|
4 |
user output |
---|
1 |
Test 7
Verdict: ACCEPTED
input |
---|
4 4 |
correct output |
---|
1 2 3 4 |
user output |
---|
1 3 2 4 |
Test 8
Verdict: WRONG ANSWER
input |
---|
5 1 |
correct output |
---|
5 |
user output |
---|
1 |
Test 9
Verdict: ACCEPTED
input |
---|
5 5 |
correct output |
---|
1 2 3 4 5 |
user output |
---|
1 4 2 3 5 |
Test 10
Verdict: WRONG ANSWER
input |
---|
6 1 |
correct output |
---|
6 |
user output |
---|
1 |
Test 11
Verdict: ACCEPTED
input |
---|
10 6 |
correct output |
---|
1 2 3 5 9 10 |
user output |
---|
1 9 2 8 3 7 |
Test 12
Verdict: WRONG ANSWER
input |
---|
10 5 |
correct output |
---|
1 2 3 4 10 |
user output |
---|
1 9 2 8 3 |
Test 13
Verdict: WRONG ANSWER
input |
---|
10 5 |
correct output |
---|
1 2 3 4 10 |
user output |
---|
1 9 2 8 3 |
Test 14
Verdict: ACCEPTED
input |
---|
10 6 |
correct output |
---|
1 2 3 5 9 10 |
user output |
---|
1 9 2 8 3 7 |
Test 15
Verdict: ACCEPTED
input |
---|
10 10 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 |
user output |
---|
1 9 2 8 3 7 4 6 5 10 |
Test 16
Verdict: WRONG ANSWER
input |
---|
11 3 |
correct output |
---|
1 2 8 |
user output |
---|
1 10 2 |
Test 17
Verdict: ACCEPTED
input |
---|
11 10 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 |
user output |
---|
1 10 2 9 3 8 4 7 5 6 |
Test 18
Verdict: WRONG ANSWER
input |
---|
11 1 |
correct output |
---|
11 |
user output |
---|
1 |
Test 19
Verdict: WRONG ANSWER
input |
---|
12 11 |
correct output |
---|
1 2 3 4 5 7 8 9 10 11 12 |
user output |
---|
1 11 2 10 3 9 4 8 5 7 6 |
Test 20
Verdict: WRONG ANSWER
input |
---|
12 1 |
correct output |
---|
12 |
user output |
---|
1 |
Test 21
Verdict: WRONG ANSWER
input |
---|
20 11 |
correct output |
---|
1 2 3 4 5 6 7 8 9 15 20 |
user output |
---|
1 19 2 18 3 17 4 16 5 15 6 |
Test 22
Verdict: WRONG ANSWER
input |
---|
20 9 |
correct output |
---|
1 2 3 4 5 6 7 12 20 |
user output |
---|
1 19 2 18 3 17 4 16 5 |
Test 23
Verdict: ACCEPTED
input |
---|
21 10 |
correct output |
---|
1 2 3 4 5 6 7 8 9 18 |
user output |
---|
1 20 2 19 3 18 4 17 5 16 |
Test 24
Verdict: WRONG ANSWER
input |
---|
22 13 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 12 21 22 |
user output |
---|
1 21 2 20 3 19 4 18 5 17 6 16 ... |
Test 25
Verdict: ACCEPTED
input |
---|
20 20 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 19 2 18 3 17 4 16 5 15 6 14 ... |
Test 26
Verdict: WRONG ANSWER
input |
---|
20 5 |
correct output |
---|
1 2 3 4 10 |
user output |
---|
1 19 2 18 3 |
Test 27
Verdict: WRONG ANSWER
input |
---|
23 21 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 13 14 15 ... |
user output |
---|
1 22 2 21 3 20 4 19 5 18 6 17 ... |
Test 28
Verdict: ACCEPTED
input |
---|
24 2 |
correct output |
---|
1 23 |
user output |
---|
1 23 |
Test 29
Verdict: ACCEPTED
input |
---|
20 18 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 19 2 18 3 17 4 16 5 15 6 14 ... |
Test 30
Verdict: WRONG ANSWER
input |
---|
25 1 |
correct output |
---|
25 |
user output |
---|
1 |
Test 31
Verdict: ACCEPTED
input |
---|
123 68 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 122 2 121 3 120 4 119 5 118 ... Truncated |
Test 32
Verdict: ACCEPTED
input |
---|
201 84 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 200 2 199 3 198 4 197 5 196 ... Truncated |
Test 33
Verdict: ACCEPTED
input |
---|
200 88 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 199 2 198 3 197 4 196 5 195 ... Truncated |
Test 34
Verdict: ACCEPTED
input |
---|
202 112 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 201 2 200 3 199 4 198 5 197 ... Truncated |
Test 35
Verdict: ACCEPTED
input |
---|
200 194 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 199 2 198 3 197 4 196 5 195 ... Truncated |
Test 36
Verdict: ACCEPTED
input |
---|
204 46 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 203 2 202 3 201 4 200 5 199 ... Truncated |
Test 37
Verdict: ACCEPTED
input |
---|
205 184 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 204 2 203 3 202 4 201 5 200 ... Truncated |
Test 38
Verdict: ACCEPTED
input |
---|
200 16 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 199 2 198 3 197 4 196 5 195 ... |
Test 39
Verdict: WRONG ANSWER
input |
---|
207 181 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 206 2 205 3 204 4 203 5 202 ... Truncated |
Test 40
Verdict: WRONG ANSWER
input |
---|
201 3 |
correct output |
---|
1 2 198 |
user output |
---|
1 200 2 |
Test 41
Verdict: WRONG ANSWER
input |
---|
1123 617 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 1122 2 1121 3 1120 4 1119 5 ... Truncated |
Test 42
Verdict: ACCEPTED
input |
---|
2201 918 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2200 2 2199 3 2198 4 2197 5 ... Truncated |
Test 43
Verdict: ACCEPTED
input |
---|
3200 1396 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 3199 2 3198 3 3197 4 3196 5 ... Truncated |
Test 44
Verdict: WRONG ANSWER
input |
---|
2202 1213 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2201 2 2200 3 2199 4 2198 5 ... Truncated |
Test 45
Verdict: WRONG ANSWER
input |
---|
1200 1161 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 1199 2 1198 3 1197 4 1196 5 ... Truncated |
Test 46
Verdict: ACCEPTED
input |
---|
5204 1156 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 5203 2 5202 3 5201 4 5200 5 ... Truncated |
Test 47
Verdict: WRONG ANSWER
input |
---|
6205 5541 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 6204 2 6203 3 6202 4 6201 5 ... Truncated |
Test 48
Verdict: WRONG ANSWER
input |
---|
3200 245 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 3199 2 3198 3 3197 4 3196 5 ... Truncated |
Test 49
Verdict: WRONG ANSWER
input |
---|
7207 6295 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 7206 2 7205 3 7204 4 7203 5 ... Truncated |
Test 50
Verdict: ACCEPTED
input |
---|
9201 96 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 9200 2 9199 3 9198 4 9197 5 ... Truncated |
Test 51
Verdict: ACCEPTED
input |
---|
51123 28058 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 51122 2 51121 3 51120 4 5111... Truncated |
Test 52
Verdict: WRONG ANSWER
input |
---|
32201 13429 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 32200 2 32199 3 32198 4 3219... Truncated |
Test 53
Verdict: ACCEPTED
input |
---|
23200 10116 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 23199 2 23198 3 23197 4 2319... Truncated |
Test 54
Verdict: WRONG ANSWER
input |
---|
12202 6721 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 12201 2 12200 3 12199 4 1219... Truncated |
Test 55
Verdict: ACCEPTED
input |
---|
21200 20502 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 21199 2 21198 3 21197 4 2119... Truncated |
Test 56
Verdict: ACCEPTED
input |
---|
35204 7816 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 35203 2 35202 3 35201 4 3520... Truncated |
Test 57
Verdict: WRONG ANSWER
input |
---|
46205 41255 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 46204 2 46203 3 46202 4 4620... Truncated |
Test 58
Verdict: WRONG ANSWER
input |
---|
63200 4823 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 63199 2 63198 3 63197 4 6319... Truncated |
Test 59
Verdict: ACCEPTED
input |
---|
87207 76170 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 87206 2 87205 3 87204 4 8720... Truncated |
Test 60
Verdict: ACCEPTED
input |
---|
99201 1030 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 99200 2 99199 3 99198 4 9919... Truncated |
Test 61
Verdict: WRONG ANSWER
input |
---|
100000 54883 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 99999 2 99998 3 99997 4 9999... Truncated |
Test 62
Verdict: WRONG ANSWER
input |
---|
100000 41703 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 99999 2 99998 3 99997 4 9999... Truncated |
Test 63
Verdict: WRONG ANSWER
input |
---|
100000 43601 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 99999 2 99998 3 99997 4 9999... Truncated |