QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#106820 | #6368. Zenyk, Marichka and Interesting Game | ckiseki# | WA | 2ms | 3592kb | C++20 | 852b | 2023-05-19 13:52:26 | 2023-05-19 13:52:29 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr) -> sync_with_stdio(false);
int n, a, b;
cin >> n >> a >> b;
int64_t x = 0, y = 0;
while (n--) {
int v;
cin >> v;
v %= (a + b);
if (a <= b) {
if (v >= b) {
y += v;
} else if (v >= a) {
x += v;
}
} else {
if (v >= a) {
x += v;
} else if (v >= b) {
y += v;
}
}
}
if (a <= b) {
if (x > 0 or (y & 1)) {
cout << "Zenyk\n";
} else {
cout << "Marichka\n";
}
} else {
if (y > 0 or (x % 2 == 0)) {
cout << "Marichka\n";
} else {
cout << "Zenyk\n";
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3412kb
input:
4 4 7 7 2 14 7
output:
Marichka
result:
ok single line: 'Marichka'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3532kb
input:
20 1 1 6 10 2 4 7 8 8 1 5 5 7 7 4 1 10 9 9 4 8 1
output:
Marichka
result:
ok single line: 'Marichka'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3364kb
input:
20 1 1 414 181 316 53 92 312 622 524 552 324 288 895 708 373 352 167 424 989 976 276
output:
Marichka
result:
ok single line: 'Marichka'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
20 1 1 2476 3753 129 43 5076 8018 4382 2175 8178 8843 3061 9366 3344 8642 2148 785 8670 2428 2300 2999
output:
Marichka
result:
ok single line: 'Marichka'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3400kb
input:
20 1 1 137810 629048 57380 122292 841453 831316 109917 665931 784954 324075 599876 495466 276505 974952 967899 94960 447567 894845 70023 743552
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #6:
score: 0
Accepted
time: 1ms
memory: 3420kb
input:
20 1 1 603612750 319945652 916047899 984639911 36858338 307217388 346606441 854711869 9443937 55167056 157372379 873443436 183061243 692493631 554311914 5098733 188700177 947666284 993329795 896423950
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3408kb
input:
20 1 100 10 6 9 7 4 4 8 9 2 10 8 7 9 1 4 7 7 5 9 1
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
20 1 100 940 930 560 776 668 23 120 32 523 711 918 281 404 927 41 192 200 170 290 586
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #9:
score: 0
Accepted
time: 2ms
memory: 3408kb
input:
20 1 100 1732 1420 551 8359 6871 8284 8135 8533 1164 8016 2713 1418 3996 8589 200 3404 1267 5804 4800 1991
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3416kb
input:
20 1 100 105878 323662 468400 734087 321718 827773 628979 354725 176831 493726 43144 916118 866452 393003 80518 9044 918239 857346 851719 790018
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #11:
score: 0
Accepted
time: 2ms
memory: 3308kb
input:
20 1 100 114483985 70948228 933107906 581251601 63833847 760459167 522351316 314146499 763641131 554926752 234970125 609052828 134295972 504224598 56091200 116857047 508324783 942411783 72916944 843202913
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #12:
score: 0
Accepted
time: 2ms
memory: 3448kb
input:
20 1 100000 5 2 4 9 3 2 9 3 5 7 8 1 6 6 4 8 5 4 5 7
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
20 1 100000 376 743 445 925 699 607 565 466 862 611 945 677 243 264 604 622 335 920 718 386
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #14:
score: 0
Accepted
time: 2ms
memory: 3420kb
input:
20 1 100000 8252 8803 88 2291 6507 459 9824 9956 5719 7886 5332 9731 5642 1913 6440 6311 6787 7963 1445 2601
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #15:
score: 0
Accepted
time: 1ms
memory: 3412kb
input:
20 1 100000 10156 503199 586524 403723 453893 429463 330401 769280 620893 336345 848753 877763 697072 569244 147617 953077 240397 153991 729626 208934
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3408kb
input:
20 1 100000 850297134 667239066 735269786 233353557 570873281 703424507 389900216 864638630 286356719 944248400 584368974 739146392 557877402 848545733 540305949 4903691 574760582 419674381 439788045 728944291
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #17:
score: 0
Accepted
time: 1ms
memory: 3408kb
input:
20 1 1000000000 10 4 9 5 1 7 5 6 10 3 10 1 4 10 8 5 7 10 6 2
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #18:
score: 0
Accepted
time: 2ms
memory: 3424kb
input:
20 1 1000000000 817 750 402 647 322 952 532 291 566 123 647 379 210 775 168 307 531 377 481 120
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #19:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
20 1 1000000000 2063 4090 297 9490 5283 2521 545 3267 5312 3841 2871 8445 5531 9062 8231 3423 1084 7907 3366 8189
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #20:
score: 0
Accepted
time: 1ms
memory: 3408kb
input:
20 1 1000000000 138147 983408 916827 779795 505956 417480 153713 726169 786848 253884 851659 100356 496925 331035 754728 514670 573046 295912 885213 834849
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #21:
score: 0
Accepted
time: 2ms
memory: 3452kb
input:
20 1 1000000000 389741152 41754585 358701835 444625716 265402105 356196211 963731432 397616524 985364717 353003262 640362973 11306956 47119087 151033033 699134111 53713942 244495828 709295081 130562628 675461519
output:
Zenyk
result:
ok single line: 'Zenyk'
Test #22:
score: 0
Accepted
time: 2ms
memory: 3412kb
input:
20 100 1 6 4 4 8 9 6 9 5 4 7 9 5 10 3 2 5 10 10 10 8
output:
Marichka
result:
ok single line: 'Marichka'
Test #23:
score: 0
Accepted
time: 2ms
memory: 3592kb
input:
20 100 1 811 93 557 504 242 101 807 415 244 83 991 131 132 836 748 429 741 586 873 561
output:
Marichka
result:
ok single line: 'Marichka'
Test #24:
score: 0
Accepted
time: 1ms
memory: 3412kb
input:
20 100 1 5744 544 6536 703 878 710 5083 510 7165 1395 5050 3651 8907 1461 808 2701 6655 3822 6777 415
output:
Marichka
result:
ok single line: 'Marichka'
Test #25:
score: 0
Accepted
time: 2ms
memory: 3456kb
input:
20 100 1 894602 439647 13448 175390 14144 357425 526763 280725 870210 556064 612672 741029 362028 123611 249814 707136 620448 746618 317440 252224
output:
Marichka
result:
ok single line: 'Marichka'
Test #26:
score: 0
Accepted
time: 2ms
memory: 3532kb
input:
20 100 1 408402009 482544610 436168280 360134583 441562229 374857184 199372496 635920868 389747173 212210184 296343842 323734536 776193209 389874947 405394615 3258038 331828565 898172909 548543118 99058741
output:
Marichka
result:
ok single line: 'Marichka'
Test #27:
score: 0
Accepted
time: 2ms
memory: 3424kb
input:
20 100 100 10 4 4 9 2 1 9 8 8 9 10 6 2 3 5 10 3 10 6 2
output:
Marichka
result:
ok single line: 'Marichka'
Test #28:
score: 0
Accepted
time: 1ms
memory: 3368kb
input:
20 100 100 851 874 308 438 945 207 499 532 282 413 154 513 162 27 303 212 797 67 870 699
output:
Marichka
result:
ok single line: 'Marichka'
Test #29:
score: -100
Wrong Answer
time: 2ms
memory: 3420kb
input:
20 100 100 1228 5123 1211 1457 3755 201 6469 3328 6421 2709 6998 2789 6815 7248 2115 8684 4148 3385 4921 4854
output:
Zenyk
result:
wrong answer 1st lines differ - expected: 'Marichka', found: 'Zenyk'