Task: | LumberUolevi |
Sender: | aalto2024a_008 |
Submission time: | 2024-09-04 17:18:36 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.00 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | ACCEPTED | 0.00 s | details |
#13 | ACCEPTED | 0.00 s | details |
#14 | ACCEPTED | 0.01 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | WRONG ANSWER | 0.00 s | details |
#18 | ACCEPTED | 0.00 s | details |
#19 | ACCEPTED | 0.00 s | details |
#20 | ACCEPTED | 0.00 s | details |
#21 | ACCEPTED | 0.00 s | details |
#22 | ACCEPTED | 0.00 s | details |
#23 | ACCEPTED | 0.00 s | details |
#24 | ACCEPTED | 0.00 s | details |
#25 | ACCEPTED | 0.00 s | details |
#26 | ACCEPTED | 0.00 s | details |
#27 | ACCEPTED | 0.00 s | details |
#28 | ACCEPTED | 0.00 s | details |
#29 | WRONG ANSWER | 0.00 s | details |
#30 | ACCEPTED | 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 | WRONG ANSWER | 0.00 s | details |
#36 | ACCEPTED | 0.00 s | details |
#37 | WRONG ANSWER | 0.00 s | details |
#38 | ACCEPTED | 0.00 s | details |
#39 | ACCEPTED | 0.00 s | details |
#40 | ACCEPTED | 0.00 s | details |
#41 | ACCEPTED | 0.00 s | details |
#42 | ACCEPTED | 0.00 s | details |
#43 | ACCEPTED | 0.00 s | details |
#44 | ACCEPTED | 0.00 s | details |
#45 | ACCEPTED | 0.00 s | details |
#46 | ACCEPTED | 0.00 s | details |
#47 | ACCEPTED | 0.00 s | details |
#48 | ACCEPTED | 0.00 s | details |
#49 | ACCEPTED | 0.01 s | details |
#50 | ACCEPTED | 0.00 s | details |
#51 | ACCEPTED | 0.01 s | details |
#52 | ACCEPTED | 0.01 s | details |
#53 | ACCEPTED | 0.01 s | details |
#54 | ACCEPTED | 0.00 s | details |
#55 | WRONG ANSWER | 0.01 s | details |
#56 | ACCEPTED | 0.01 s | details |
#57 | ACCEPTED | 0.01 s | details |
#58 | ACCEPTED | 0.00 s | details |
#59 | WRONG ANSWER | 0.02 s | details |
#60 | ACCEPTED | 0.00 s | details |
#61 | ACCEPTED | 0.01 s | details |
#62 | ACCEPTED | 0.01 s | details |
#63 | ACCEPTED | 0.01 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:74:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 74 | for (int i = 0; i < vals.size() - 1; i++) | ~~^~~~~~~~~~~~~~~~~
Code
#include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> vals = std::vector<int>(); int n, k; std::cin >> n >> k; int total = n; if (k >= n) { for (int i = 1; i < n; i++) std::cout << i << " "; std::cout << n; return 0; } if (k == 0) return 0; if (k > 3) { vals.push_back(n); n--; k--; } else if (k == 2) { std::cout << 1 << " " << n - 1; return 0; } if (k == 0) return 0; int i = 1; while (k > 3) { vals.push_back(i); vals.push_back(n); i++; n--; k -= 2; } if (k == 1) vals.push_back(n); else if (k == 2) { vals.push_back(i); vals.push_back(n); } else { // Now we need the 3 last ones if (total - (i + i + 1) <= n && total - (i + i + 1) > i + 1) { vals.push_back(i); vals.push_back(i + 1); vals.push_back(total - (i + i + 1)); } else { vals.push_back(i); vals.push_back(n); vals.push_back(n - 1); } } std::sort(vals.begin(), vals.end()); for (int i = 0; i < vals.size() - 1; i++) std::cout << vals[i] << " "; std::cout << vals[vals.size() - 1]; return 0; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1 1 |
correct output |
---|
1 |
user output |
---|
1 |
Test 2
Verdict: ACCEPTED
input |
---|
2 1 |
correct output |
---|
2 |
user output |
---|
2 |
Test 3
Verdict: ACCEPTED
input |
---|
2 1 |
correct output |
---|
2 |
user output |
---|
2 |
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: ACCEPTED
input |
---|
4 1 |
correct output |
---|
4 |
user output |
---|
4 |
Test 7
Verdict: ACCEPTED
input |
---|
4 4 |
correct output |
---|
1 2 3 4 |
user output |
---|
1 2 3 4 |
Test 8
Verdict: ACCEPTED
input |
---|
5 1 |
correct output |
---|
5 |
user output |
---|
5 |
Test 9
Verdict: ACCEPTED
input |
---|
5 5 |
correct output |
---|
1 2 3 4 5 |
user output |
---|
1 2 3 4 5 |
Test 10
Verdict: ACCEPTED
input |
---|
6 1 |
correct output |
---|
6 |
user output |
---|
6 |
Test 11
Verdict: ACCEPTED
input |
---|
10 6 |
correct output |
---|
1 2 3 5 9 10 |
user output |
---|
1 2 3 5 9 10 |
Test 12
Verdict: ACCEPTED
input |
---|
10 5 |
correct output |
---|
1 2 3 4 10 |
user output |
---|
1 2 8 9 10 |
Test 13
Verdict: ACCEPTED
input |
---|
10 5 |
correct output |
---|
1 2 3 4 10 |
user output |
---|
1 2 8 9 10 |
Test 14
Verdict: ACCEPTED
input |
---|
10 6 |
correct output |
---|
1 2 3 5 9 10 |
user output |
---|
1 2 3 5 9 10 |
Test 15
Verdict: ACCEPTED
input |
---|
10 10 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 |
user output |
---|
1 2 3 4 5 6 7 8 9 10 |
Test 16
Verdict: ACCEPTED
input |
---|
11 3 |
correct output |
---|
1 2 8 |
user output |
---|
1 2 8 |
Test 17
Verdict: WRONG ANSWER
input |
---|
11 10 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 |
user output |
---|
1 2 3 4 6 7 8 9 10 11 |
Test 18
Verdict: ACCEPTED
input |
---|
11 1 |
correct output |
---|
11 |
user output |
---|
11 |
Test 19
Verdict: ACCEPTED
input |
---|
12 11 |
correct output |
---|
1 2 3 4 5 7 8 9 10 11 12 |
user output |
---|
1 2 3 4 5 7 8 9 10 11 12 |
Test 20
Verdict: ACCEPTED
input |
---|
12 1 |
correct output |
---|
12 |
user output |
---|
12 |
Test 21
Verdict: ACCEPTED
input |
---|
20 11 |
correct output |
---|
1 2 3 4 5 6 7 8 9 15 20 |
user output |
---|
1 2 3 4 5 15 16 17 18 19 20 |
Test 22
Verdict: ACCEPTED
input |
---|
20 9 |
correct output |
---|
1 2 3 4 5 6 7 12 20 |
user output |
---|
1 2 3 4 16 17 18 19 20 |
Test 23
Verdict: ACCEPTED
input |
---|
21 10 |
correct output |
---|
1 2 3 4 5 6 7 8 9 18 |
user output |
---|
1 2 3 4 5 12 18 19 20 21 |
Test 24
Verdict: ACCEPTED
input |
---|
22 13 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 12 21 22 |
user output |
---|
1 2 3 4 5 6 16 17 18 19 20 21 ... |
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 2 3 4 5 6 7 8 9 10 11 12 13 ... |
Test 26
Verdict: ACCEPTED
input |
---|
20 5 |
correct output |
---|
1 2 3 4 10 |
user output |
---|
1 2 18 19 20 |
Test 27
Verdict: ACCEPTED
input |
---|
23 21 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 13 14 15 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 13 14 15 ... |
Test 28
Verdict: ACCEPTED
input |
---|
24 2 |
correct output |
---|
1 23 |
user output |
---|
1 23 |
Test 29
Verdict: WRONG ANSWER
input |
---|
20 18 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 11 12 13 14 15... |
Test 30
Verdict: ACCEPTED
input |
---|
25 1 |
correct output |
---|
25 |
user output |
---|
25 |
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 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 35
Verdict: WRONG ANSWER
input |
---|
200 194 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 37
Verdict: WRONG ANSWER
input |
---|
205 184 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 185 194 195 19... |
Test 39
Verdict: ACCEPTED
input |
---|
207 181 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 40
Verdict: ACCEPTED
input |
---|
201 3 |
correct output |
---|
1 2 198 |
user output |
---|
1 2 198 |
Test 41
Verdict: ACCEPTED
input |
---|
1123 617 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 44
Verdict: ACCEPTED
input |
---|
2202 1213 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 45
Verdict: ACCEPTED
input |
---|
1200 1161 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 47
Verdict: ACCEPTED
input |
---|
6205 5541 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 48
Verdict: ACCEPTED
input |
---|
3200 245 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 49
Verdict: ACCEPTED
input |
---|
7207 6295 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 52
Verdict: ACCEPTED
input |
---|
32201 13429 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 54
Verdict: ACCEPTED
input |
---|
12202 6721 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 55
Verdict: WRONG ANSWER
input |
---|
21200 20502 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 57
Verdict: ACCEPTED
input |
---|
46205 41255 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 58
Verdict: ACCEPTED
input |
---|
63200 4823 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 59
Verdict: WRONG ANSWER
input |
---|
87207 76170 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 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 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 61
Verdict: ACCEPTED
input |
---|
100000 54883 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 62
Verdict: ACCEPTED
input |
---|
100000 41703 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 63
Verdict: ACCEPTED
input |
---|
100000 43601 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |