QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#673971 | #6110. Squirrel Game | stompQ | AC ✓ | 5ms | 5160kb | C++23 | 794b | 2024-10-25 12:39:31 | 2024-10-25 12:39:32 |
Judging History
answer
#include <iostream>
#include <deque>
using namespace std;
int a[100005];
long long int trya(deque<long long int> v) {
long long int res = 0;
for (int i = v.size() - 1; i >= 0; i -= 2) {
res ^= v[i];
}
return res;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int m, n, k;
cin >> m >> n >> k;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = n; i >= 1; i--) {
a[i] = a[i] - a[i - 1] - 1;
}
long long int res = 0;
for (int i = 1; i <= k; i++) {
deque<long long int> v;
for (int j = i; j <= n; j += k) {
v.push_back(a[j]);
}
res ^= trya(v);
}
if (res == 0) cout << "Nova";
else cout << "Twinkle";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3828kb
input:
7 3 2 1 4 7
output:
Nova
result:
ok single line: 'Nova'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
7 3 1 1 4 7
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1 1 1 1
output:
Nova
result:
ok single line: 'Nova'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1 1 10 1
output:
Nova
result:
ok single line: 'Nova'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
100000 1 1 19593
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
100000 1 10 62516
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
100 10 1 23 24 43 47 62 66 68 73 82 85
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
100 10 3 11 18 23 26 30 40 52 76 78 99
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
100 10 7 14 27 51 62 66 71 75 79 80 97
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
100 10 10 10 18 25 50 51 54 64 77 95 96
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
100 5 10 15 52 61 65 78
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
10 10 1 1 2 3 4 5 6 7 8 9 10
output:
Nova
result:
ok single line: 'Nova'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
10 10 3 1 2 3 4 5 6 7 8 9 10
output:
Nova
result:
ok single line: 'Nova'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
100 10 1 5 16 25 28 39 49 58 63 79 85
output:
Nova
result:
ok single line: 'Nova'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
100 10 3 11 18 28 37 51 68 78 86 88 90
output:
Nova
result:
ok single line: 'Nova'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
100 10 7 10 20 32 44 55 64 66 73 83 91
output:
Nova
result:
ok single line: 'Nova'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
100 10 10 6 9 20 23 31 38 48 55 58 62
output:
Nova
result:
ok single line: 'Nova'
Test #18:
score: 0
Accepted
time: 3ms
memory: 5124kb
input:
100000 99989 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
Nova
result:
ok single line: 'Nova'
Test #19:
score: 0
Accepted
time: 5ms
memory: 4356kb
input:
100000 99989 9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
100000 100 1 1585 3708 4825 5521 10036 10669 11878 12078 12547 12849 13324 15459 15499 15818 15871 17032 17412 18426 18538 18639 19665 21470 22304 22476 23107 23858 24844 27236 27286 28294 28688 30590 31204 32451 32711 34289 35800 36665 36974 40640 40899 41074 43977 44108 44210 44418 47233 48247 514...
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
100000 100 3 533 620 683 2157 2382 2617 3965 4810 7922 9768 10045 10228 10502 10807 11390 12331 13553 14049 14829 15902 16019 16498 18617 19244 19879 20141 20346 25262 25382 26840 28045 28777 30601 31175 31378 31421 34047 34631 36336 39981 40013 41134 41505 44450 45535 46096 46404 46710 51291 51546 ...
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
100000 100 7 1426 2304 5883 10070 10753 11723 12141 12206 12981 15835 17442 17949 18691 19585 21157 22242 22426 23104 24299 24536 27787 28059 28652 29035 29060 31882 31967 32873 33438 35783 35851 36139 37987 39548 42121 43699 47102 48793 49298 49509 50234 52137 52255 53732 54027 54867 55311 55451 56...
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
100000 100 10 16 743 2508 6315 6889 7672 8471 8630 9993 10122 11580 12140 13528 13790 14024 17808 18693 18697 19019 19817 19958 20210 20987 22313 22736 25442 28377 28702 30520 30777 30899 34352 36578 37754 38024 39242 39806 40793 40893 41167 41241 42515 44425 45324 45650 46108 46696 47022 47337 4746...
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #24:
score: 0
Accepted
time: 1ms
memory: 4208kb
input:
100000 19999 1 2 16 25 29 36 40 44 48 54 60 61 64 69 89 101 103 111 114 115 126 127 128 134 138 139 157 162 166 170 171 177 180 182 183 184 192 197 198 200 206 209 211 212 215 218 219 221 223 224 227 237 239 245 258 262 267 272 280 292 293 298 300 302 307 308 315 322 326 327 328 332 333 344 349 363 ...
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #25:
score: 0
Accepted
time: 1ms
memory: 3724kb
input:
100000 19999 3 1 9 14 17 30 31 34 50 51 52 56 58 61 65 70 71 81 83 90 97 104 105 129 134 135 136 150 155 157 165 168 169 170 174 176 177 182 185 186 191 194 202 207 214 215 221 222 226 230 237 240 243 250 251 254 257 261 270 275 284 285 286 287 297 301 312 318 325 333 336 339 341 350 355 356 358 361...
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #26:
score: 0
Accepted
time: 1ms
memory: 3720kb
input:
100000 19999 7 7 14 25 31 34 37 39 41 46 48 52 53 60 64 67 80 87 89 91 94 101 103 107 110 119 120 126 129 132 133 145 148 151 155 156 175 176 186 187 189 192 193 194 196 205 215 218 224 232 235 240 246 248 250 254 258 259 260 262 266 267 278 291 298 304 305 312 319 322 328 329 330 339 341 345 359 36...
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #27:
score: 0
Accepted
time: 1ms
memory: 3732kb
input:
100000 19999 10 1 2 3 8 13 15 22 27 32 36 37 38 40 43 44 48 53 57 63 64 76 92 94 96 98 100 106 108 112 121 131 135 139 144 160 163 164 166 168 170 174 177 181 191 194 195 201 202 214 215 221 227 238 249 251 257 262 277 278 279 290 295 296 297 300 304 317 322 323 326 337 345 348 359 360 373 379 391 3...
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #28:
score: 0
Accepted
time: 5ms
memory: 5160kb
input:
100000 100000 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
Nova
result:
ok single line: 'Nova'
Test #29:
score: 0
Accepted
time: 5ms
memory: 4184kb
input:
100000 100000 9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98...
output:
Nova
result:
ok single line: 'Nova'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
100000 100 1 1477 2422 3979 4026 5436 5440 6999 7504 9005 9696 11210 12006 13533 14494 16022 16591 18058 18144 19665 20277 21767 22404 23868 24596 26089 26728 28297 28670 30154 30237 31663 32239 33737 34606 36146 37073 38493 39342 40862 41638 43175 43865 45355 45408 46928 47677 49161 49582 51071 518...
output:
Nova
result:
ok single line: 'Nova'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
100000 100 3 1452 2160 3017 3422 4967 6501 7941 8334 8705 9639 11104 12577 14111 14548 14934 15016 16472 17974 19398 20177 21015 21496 22861 24296 25830 25891 26189 26311 27768 29238 30663 31592 32511 33396 34844 36338 37787 38056 38215 38787 40242 41701 43087 43732 44690 45529 46993 48439 49845 499...
output:
Nova
result:
ok single line: 'Nova'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
100000 100 7 978 1536 3102 4697 6290 7891 9495 11049 12559 12804 12973 13084 13264 13753 14237 14720 16242 17763 19284 20936 22551 24067 25744 25907 25965 26507 26617 27605 28449 28821 30368 31882 33511 35127 36703 38302 39847 40205 40742 41060 41841 41997 42551 42706 44265 45862 47445 49063 50603 5...
output:
Nova
result:
ok single line: 'Nova'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
100000 100 10 1399 2819 4208 5644 7052 8466 9817 11259 12611 13997 14593 15516 16289 16401 16948 17800 18015 18104 19077 19589 21015 22459 23955 25372 26789 28209 29625 30964 32348 33811 34640 34711 35142 35279 36084 36988 37225 37665 38371 38557 39953 41398 42771 44189 45618 47062 48475 49887 51292...
output:
Nova
result:
ok single line: 'Nova'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
100000 999 1 14 169 261 395 406 561 662 829 911 1073 1092 1231 1283 1441 1526 1679 1754 1902 1904 2034 2085 2225 2252 2373 2381 2532 2567 2726 2784 2953 2984 3148 3201 3361 3383 3522 3617 3773 3860 4004 4084 4223 4279 4431 4471 4606 4696 4842 4894 5049 5110 5279 5310 5463 5476 5609 5610 5765 5817 59...
output:
Nova
result:
ok single line: 'Nova'
Test #35:
score: 0
Accepted
time: 0ms
memory: 3480kb
input:
100000 999 3 115 136 146 295 455 625 654 719 733 884 1015 1181 1248 1294 1308 1466 1608 1760 1844 1921 1997 2154 2287 2440 2534 2560 2611 2758 2913 3077 3105 3188 3230 3381 3520 3688 3756 3785 3834 3989 4132 4260 4347 4349 4425 4564 4730 4880 4961 5002 5098 5251 5401 5543 5564 5638 5678 5816 5961 60...
output:
Nova
result:
ok single line: 'Nova'
Test #36:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
100000 999 7 53 131 183 196 203 344 504 647 802 925 1068 1215 1265 1322 1407 1417 1469 1482 1531 1685 1840 2021 2182 2344 2501 2638 2730 2777 2807 2856 2927 3013 3056 3217 3346 3488 3650 3804 3928 4078 4102 4155 4196 4206 4236 4326 4382 4543 4692 4843 4987 5149 5280 5435 5509 5585 5618 5700 5764 580...
output:
Nova
result:
ok single line: 'Nova'
Test #37:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
100000 999 10 159 308 477 617 737 887 1055 1210 1359 1363 1444 1476 1544 1637 1657 1738 1758 1838 1914 2052 2207 2367 2511 2662 2814 2949 3097 3243 3399 3409 3441 3464 3565 3659 3702 3794 3804 3887 3915 4073 4221 4372 4531 4666 4822 4985 5138 5272 5421 5497 5573 5668 5711 5809 5814 5892 5913 5975 60...
output:
Nova
result:
ok single line: 'Nova'
Test #38:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
100000 5 10 1661 3888 64309 79490 85369
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #39:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
100000 9 10 6680 33729 38078 46137 58324 59179 62144 74095 75181
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #40:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
100000 1 10 1
output:
Nova
result:
ok single line: 'Nova'
Test #41:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
100000 5 10 16135 17403 22925 31665 34809
output:
Nova
result:
ok single line: 'Nova'
Test #42:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
100000 9 10 15729 17655 24621 25718 34877 36879 42217 45696 52049
output:
Nova
result:
ok single line: 'Nova'