Task: | Auraus |
Sender: | Pauli Kauro |
Submission time: | 2020-02-09 14:46:52 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#2 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#3 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#4 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#5 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#6 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#7 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#8 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#9 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#10 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#11 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#12 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#13 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#14 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#15 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#16 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#17 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#18 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#19 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#20 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#21 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#22 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#23 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#24 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#25 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#26 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#27 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#28 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#29 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#30 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#31 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#32 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#33 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#34 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#35 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#36 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#37 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#38 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#39 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#40 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#41 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#42 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#43 | ACCEPTED | 0.01 s | 2, 3 | details |
#44 | ACCEPTED | 0.01 s | 2, 3 | details |
#45 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#46 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#47 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#48 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#49 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#50 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#51 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#52 | ACCEPTED | 0.01 s | 2, 3 | details |
#53 | WRONG ANSWER | 0.07 s | 2, 3 | details |
#54 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#55 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#56 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#57 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#58 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#59 | ACCEPTED | 0.01 s | 2, 3 | details |
#60 | ACCEPTED | 0.01 s | 2, 3 | details |
#61 | ACCEPTED | 0.01 s | 3 | details |
#62 | ACCEPTED | 0.01 s | 3 | details |
#63 | WRONG ANSWER | 0.01 s | 3 | details |
#64 | WRONG ANSWER | 0.01 s | 3 | details |
#65 | WRONG ANSWER | 0.01 s | 3 | details |
#66 | TIME LIMIT EXCEEDED | -- | 3 | details |
#67 | TIME LIMIT EXCEEDED | -- | 3 | details |
#68 | WRONG ANSWER | 0.01 s | 3 | details |
#69 | TIME LIMIT EXCEEDED | -- | 3 | details |
#70 | WRONG ANSWER | 0.01 s | 3 | details |
#71 | WRONG ANSWER | 0.01 s | 3 | details |
#72 | WRONG ANSWER | 0.01 s | 3 | details |
#73 | WRONG ANSWER | 0.01 s | 3 | details |
#74 | ACCEPTED | 0.01 s | 3 | details |
#75 | TIME LIMIT EXCEEDED | -- | 3 | details |
#76 | WRONG ANSWER | 0.01 s | 3 | details |
#77 | WRONG ANSWER | 0.01 s | 3 | details |
#78 | WRONG ANSWER | 0.01 s | 3 | details |
#79 | WRONG ANSWER | 0.01 s | 3 | details |
#80 | WRONG ANSWER | 0.01 s | 3 | details |
#81 | ACCEPTED | 0.01 s | 3 | details |
#82 | ACCEPTED | 0.01 s | 3 | details |
Compiler report
input/code.cpp: In function 'int pituus(toive)': input/code.cpp:16:7: warning: decomposition declaration only available with -std=c++1z or -std=gnu++1z auto [a, b] = t; ^ input/code.cpp: In function 'll tarkista(std::vector<std::pair<int, int> >&)': input/code.cpp:24:12: warning: decomposition declaration only available with -std=c++1z or -std=gnu++1z for (auto [a, b] : v) { ^
Code
#include <bits/stdc++.h> using namespace std; using toive = pair<int, int>; using ll = long long; constexpr ll M = 1000; int n, m, k; static inline int pituus(int a, int b) { return b - a + 1; } static inline int pituus(toive t) { auto [a, b] = t; return pituus(a, b); } vector<toive> toiveet; int kaytossa[M + 1]; ll tarkista(vector<toive> &v) { for (auto [a, b] : v) { fill_n(kaytossa + a, pituus(a, b), 1); } ll c = accumulate(kaytossa, kaytossa + n + 1, 0); fill_n(kaytossa, m, 0); return c <= k ? v.size() : 0; } int main() { cin >> n >> m >> k; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; // liian pitka toive if (pituus({a, b}) > k) continue; toiveet.emplace_back(a, b); } // toiveiden osajoukot ll ans = 0; for (ll i = 0; i < (1 << toiveet.size()); i++) { vector<toive> nyt; ll x = i; while (x > 0) { ll bit = x & -x; ll ix = __builtin_ctz(bit); nyt.push_back(toiveet[ix]); x -= bit; } ans = max(ans, tarkista(nyt)); } cout << ans << endl; return 0; }
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 4 4 1 3 3 4 2 3 3 6 |
correct output |
---|
3 |
user output |
---|
3 |
Test 2
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
3 3 2 1 1 1 3 3 3 |
correct output |
---|
2 |
user output |
---|
2 |
Test 3
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
1 0 0 |
correct output |
---|
0 |
user output |
---|
0 |
Test 4
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
1 1 0 1 1 |
correct output |
---|
0 |
user output |
---|
0 |
Test 5
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
1 1 1 1 1 |
correct output |
---|
1 |
user output |
---|
1 |
Test 6
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
2 1 1 1 2 |
correct output |
---|
0 |
user output |
---|
0 |
Test 7
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
2 1 2 1 2 |
correct output |
---|
1 |
user output |
---|
1 |
Test 8
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
2 2 1 1 1 2 2 |
correct output |
---|
1 |
user output |
---|
1 |
Test 9
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
2 2 2 1 1 2 2 |
correct output |
---|
2 |
user output |
---|
2 |
Test 10
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
2 2 2 1 2 1 2 |
correct output |
---|
2 |
user output |
---|
2 |
Test 11
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
5 5 2 1 2 1 2 3 5 3 5 ... |
correct output |
---|
2 |
user output |
---|
2 |
Test 12
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 3 4 1 3 2 4 5 6 |
correct output |
---|
2 |
user output |
---|
2 |
Test 13
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
4 2 2 2 3 2 3 |
correct output |
---|
2 |
user output |
---|
2 |
Test 14
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 3 1 3 6 1 3 2 5 |
correct output |
---|
0 |
user output |
---|
0 |
Test 15
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 3 0 3 3 2 5 2 5 |
correct output |
---|
0 |
user output |
---|
0 |
Test 16
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 3 1 1 3 2 5 1 6 |
correct output |
---|
0 |
user output |
---|
0 |
Test 17
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 4 3 2 4 1 6 2 4 2 5 |
correct output |
---|
2 |
user output |
---|
2 |
Test 18
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
13 14 9 6 7 1 3 1 10 4 4 ... |
correct output |
---|
7 |
user output |
---|
7 |
Test 19
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 4 3 1 3 1 4 4 4 2 2 |
correct output |
---|
2 |
user output |
---|
2 |
Test 20
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 3 3 5 5 2 4 3 3 |
correct output |
---|
2 |
user output |
---|
2 |
Test 21
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
1 4 1 1 1 1 1 1 1 1 1 |
correct output |
---|
4 |
user output |
---|
4 |
Test 22
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
7 13 7 3 7 3 5 5 7 1 6 ... |
correct output |
---|
13 |
user output |
---|
13 |
Test 23
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 3 4 2 2 1 4 4 4 |
correct output |
---|
3 |
user output |
---|
3 |
Test 24
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
3 2 2 1 1 3 3 |
correct output |
---|
2 |
user output |
---|
2 |
Test 25
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 6 7 15 7 13 4 12 1 5 ... |
correct output |
---|
5 |
user output |
---|
5 |
Test 26
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 8 1 5 12 14 2 6 2 13 ... |
correct output |
---|
7 |
user output |
---|
7 |
Test 27
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 3 6 6 10 14 7 10 10 15 ... |
correct output |
---|
3 |
user output |
---|
3 |
Test 28
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
15 15 6 2 11 8 14 3 12 3 6 ... |
correct output |
---|
4 |
user output |
---|
3 |
Test 29
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 5 1 9 4 13 5 13 7 9 ... |
correct output |
---|
3 |
user output |
---|
3 |
Test 30
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 5 4 10 6 8 7 9 2 8 ... |
correct output |
---|
3 |
user output |
---|
3 |
Test 31
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 10 3 14 1 8 1 10 14 15 ... |
correct output |
---|
6 |
user output |
---|
6 |
Test 32
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
15 15 10 7 10 5 8 2 13 9 12 ... |
correct output |
---|
9 |
user output |
---|
7 |
Test 33
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 15 8 14 6 14 6 11 11 15 ... |
correct output |
---|
15 |
user output |
---|
15 |
Test 34
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 15 1 15 1 15 1 15 1 15 ... |
correct output |
---|
15 |
user output |
---|
15 |
Test 35
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 14 1 15 1 15 1 15 1 15 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 36
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 12 2 2 5 10 7 14 1 14 ... |
correct output |
---|
9 |
user output |
---|
9 |
Test 37
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
15 15 7 1 8 6 8 1 8 11 11 ... |
correct output |
---|
7 |
user output |
---|
6 |
Test 38
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 11 6 9 1 11 11 14 6 6 ... |
correct output |
---|
11 |
user output |
---|
11 |
Test 39
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 15 10 3 11 6 11 7 9 4 10 ... |
correct output |
---|
10 |
user output |
---|
10 |
Test 40
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 8 8 1 1 3 3 5 5 7 7 ... |
correct output |
---|
8 |
user output |
---|
8 |
Test 41
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 0 0 |
correct output |
---|
0 |
user output |
---|
0 |
Test 42
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 0 15 |
correct output |
---|
0 |
user output |
---|
0 |
Test 43
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 100 0 94 95 31 65 35 95 70 78 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 44
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 100 1 23 39 46 85 72 97 41 70 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 45
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100 100 10 69 94 36 43 54 93 30 74 ... |
correct output |
---|
6 |
user output |
---|
(empty) |
Test 46
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 25 33 85 26 88 22 57 49 97 ... |
correct output |
---|
12 |
user output |
---|
3 |
Test 47
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 50 8 57 12 89 13 63 31 93 ... |
correct output |
---|
29 |
user output |
---|
5 |
Test 48
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 75 10 19 5 6 13 78 23 50 ... |
correct output |
---|
64 |
user output |
---|
0 |
Test 49
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 99 49 59 41 52 82 93 78 81 ... |
correct output |
---|
98 |
user output |
---|
4 |
Test 50
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 6 7 8 100 5 61 5 75 ... |
correct output |
---|
100 |
user output |
---|
4 |
Test 51
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 1 100 1 100 1 100 1 100 ... |
correct output |
---|
100 |
user output |
---|
4 |
Test 52
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 100 99 1 100 1 100 1 100 1 100 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 53
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 50 50 1 1 3 3 5 5 7 7 ... |
correct output |
---|
50 |
user output |
---|
18 |
Test 54
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 10 61 28 62 49 92 2 73 68 69 ... |
correct output |
---|
6 |
user output |
---|
1 |
Test 55
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100 100 90 1 1 1 2 1 3 1 4 ... |
correct output |
---|
90 |
user output |
---|
(empty) |
Test 56
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 1 1 1 2 1 3 1 4 ... |
correct output |
---|
100 |
user output |
---|
4 |
Test 57
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100 100 90 100 100 99 100 98 100 97 100 ... |
correct output |
---|
90 |
user output |
---|
(empty) |
Test 58
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 100 100 100 100 99 100 98 100 97 100 ... |
correct output |
---|
100 |
user output |
---|
4 |
Test 59
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 0 0 |
correct output |
---|
0 |
user output |
---|
0 |
Test 60
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 0 100 |
correct output |
---|
0 |
user output |
---|
0 |
Test 61
Group: 3
Verdict: ACCEPTED
input |
---|
500 1000 0 180 244 324 489 159 300 149 314 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 62
Group: 3
Verdict: ACCEPTED
input |
---|
500 1000 1 88 104 234 302 76 412 6 324 ... |
correct output |
---|
1 |
user output |
---|
1 |
Test 63
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 10 182 372 205 444 136 417 112 166 ... |
correct output |
---|
4 |
user output |
---|
1 |
Test 64
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 50 11 53 93 370 107 272 171 224 ... |
correct output |
---|
22 |
user output |
---|
4 |
Test 65
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 100 156 169 331 451 309 348 398 428 ... |
correct output |
---|
61 |
user output |
---|
5 |
Test 66
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 1000 200 296 414 85 133 23 86 54 416 ... |
correct output |
---|
187 |
user output |
---|
(empty) |
Test 67
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 1000 300 152 172 111 442 7 363 404 413 ... |
correct output |
---|
364 |
user output |
---|
(empty) |
Test 68
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 400 417 497 196 292 127 182 69 96 ... |
correct output |
---|
666 |
user output |
---|
3 |
Test 69
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 1000 450 175 446 175 218 145 183 169 222 ... |
correct output |
---|
817 |
user output |
---|
(empty) |
Test 70
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 490 34 85 148 275 308 346 35 77 ... |
correct output |
---|
973 |
user output |
---|
7 |
Test 71
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 499 393 462 11 70 348 467 323 398 ... |
correct output |
---|
996 |
user output |
---|
8 |
Test 72
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 500 137 175 270 449 369 404 32 380 ... |
correct output |
---|
1000 |
user output |
---|
8 |
Test 73
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 500 1 500 1 500 1 500 1 500 ... |
correct output |
---|
1000 |
user output |
---|
8 |
Test 74
Group: 3
Verdict: ACCEPTED
input |
---|
500 1000 499 1 500 1 500 1 500 1 500 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 75
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
500 250 250 1 1 3 3 5 5 7 7 ... |
correct output |
---|
250 |
user output |
---|
(empty) |
Test 76
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 10 241 18 75 36 348 63 142 236 350 ... |
correct output |
---|
5 |
user output |
---|
3 |
Test 77
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 450 1 1 1 2 1 3 1 4 ... |
correct output |
---|
900 |
user output |
---|
4 |
Test 78
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 500 1 1 1 2 1 3 1 4 ... |
correct output |
---|
1000 |
user output |
---|
8 |
Test 79
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 450 500 500 499 500 498 500 497 500 ... |
correct output |
---|
900 |
user output |
---|
4 |
Test 80
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 1000 500 500 500 499 500 498 500 497 500 ... |
correct output |
---|
1000 |
user output |
---|
8 |
Test 81
Group: 3
Verdict: ACCEPTED
input |
---|
500 0 0 |
correct output |
---|
0 |
user output |
---|
0 |
Test 82
Group: 3
Verdict: ACCEPTED
input |
---|
500 0 500 |
correct output |
---|
0 |
user output |
---|
0 |