ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#440 | #73. 「NOIP2016」蚯蚓 | Pigsyy | 0 | 821ms | 1928kb | C++23 | 1.8kb | 2025-04-24 13:30:20 | 2025-04-24 13:30:20 |
answer
#include <stdio.h>
int main() {
int x, n1, n2, x1 = 0, x2 = 0;
scanf("%d %d %d", &x, &n1, &n2);
int a[n1], b[n2];
for (int t = 0; t <= n1 - 1; t++) {
scanf("%d", &a[t]);
}
for (int t = 0; t <= n2 - 1; t++) {
scanf("%d", &b[t]);
}
int n, m, o, p;
for (int t = 0; t <= x - 1; t++) {
o = t % n1;
n = a[o];
p = t % n2;
m = b[p];
if (n == 0) {
if (m == 1) {
x2++;
} else if (m == 2) {
x1++;
} else if (m == 3) {
x1++;
} else if (m == 4) {
x2++;
}
} else if (n == 1) {
if (m == 0) {
x1++;
} else if (m == 2) {
x2++;
} else if (m == 3) {
x1++;
} else if (m == 4) {
x2++;
}
} else if (n == 2) {
if (m == 0) {
x2++;
} else if (m == 1) {
x1++;
} else if (m == 3) {
x2++;
} else if (m == 4) {
x1++;
}
} else if (n == 3) {
if (m == 0) {
x2++;
} else if (m == 1) {
x2++;
} else if (m == 2) {
x1++;
} else if (m == 4) {
x1++;
}
} else if (n == 4) {
if (m == 0) {
x1++;
} else if (m == 1) {
x1++;
} else if (m == 2) {
x2++;
} else if (m == 3) {
x2++;
}
}
}
printf("%d %d\n", x1, x2);
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Runtime Error
input:
1 0 0 1 2 1 915866
output:
result:
Test #2:
score: 0
Runtime Error
input:
1000 0 0 1 2 1 751103 789683 573261 759320 204083 582213 998020 554041 172192 585984 170816 847474 6...
output:
result:
Test #3:
score: 0
Runtime Error
input:
100000 0 0 1 2 1 680351 451124 48910 505493 930478 545620 34252 111923 107488 31506 334922 122964 44...
output:
result:
Test #4:
score: 0
Runtime Error
input:
1 1000 0 1 2 1 33386
output:
result:
Test #5:
score: 0
Runtime Error
input:
1000 1000 0 1 2 1 132625 572871 770124 563851 578941 933006 37851 712167 787787 21841 604359 544543 ...
output:
result:
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 1912kb
input:
1 1000 101 1 2 1 878550
output:
1 0
result:
wrong answer 1st words differ - expected: '878550', found: '1'
Test #7:
score: 0
Wrong Answer
time: 2ms
memory: 1864kb
input:
1000 1000 130 1 2 1 719730 265368 766225 978873 180882 759547 799075 652390 846784 103245 459582 527...
output:
0 0
result:
wrong answer 1st words differ - expected: '998520', found: '0'
Test #8:
score: 0
Runtime Error
input:
50000 50000 0 1 2 1 200240 332901 277204 806517 368526 442028 524956 700364 228807 786932 131910 655...
output:
result:
Test #9:
score: 0
Runtime Error
input:
100000 100000 0 1 2 2 959613 194150 85516 394977 870052 300505 900903 647300 231641 734416 481762 68...
output:
result:
Test #10:
score: 0
Runtime Error
input:
100000 2000000 0 1 2 21 66589 48392 791767 104800 766778 53663 117659 914981 951118 653732 575320 33...
output:
result:
Test #11:
score: 0
Runtime Error
input:
100000 2500000 0 1 2 26 49672 613410 576709 19013 843381 207064 930756 472514 731146 788207 286649 3...
output:
result:
Test #12:
score: 0
Runtime Error
input:
100000 3500000 0 1 2 36 2926831 7957102 9339535 6140298 9778289 7343914 3819688 3934516 4909839 1447...
output:
result:
Test #13:
score: 0
Runtime Error
input:
100000 5000000 0 153252866 506034425 51 9865456 7275647 9260296 4104264 5535150 462208 1644763 68910...
output:
result:
Test #14:
score: 0
Runtime Error
input:
100000 7000000 0 357111899 688810819 71 69584443 17447233 31714022 66332206 64271777 53896834 218916...
output:
result:
Test #15:
score: 0
Wrong Answer
time: 8ms
memory: 1764kb
input:
50000 50000 83 1 2 1 84360021 71347337 39044696 22626429 70396546 40094315 23005735 75656509 7170043...
output:
0 0
result:
wrong answer 1st words differ - expected: '99998786', found: '0'
Test #16:
score: 0
Wrong Answer
time: 26ms
memory: 1784kb
input:
50000 150000 131 1 2 2 20230216 16944549 92292904 97379087 27243476 17669963 70262093 22087930 15981...
output:
1 2
result:
wrong answer 1st words differ - expected: '99995655', found: '1'
Test #17:
score: 0
Wrong Answer
time: 30ms
memory: 1888kb
input:
100000 100000 178 132358018 140364259 3 83072957 5441239 53478006 30551173 88543592 82231284 9362625...
output:
0 0
result:
wrong answer 1st words differ - expected: '99996327', found: '0'
Test #18:
score: 0
Wrong Answer
time: 32ms
memory: 1928kb
input:
100000 300000 92 258729579 850884467 4 41792818 41347297 9862677 26430344 30975686 74655582 35126740...
output:
1 0
result:
wrong answer 1st words differ - expected: '99995333', found: '1'
Test #19:
score: 0
Wrong Answer
time: 253ms
memory: 1868kb
input:
100000 3500000 104 102514430 964087490 36 28839242 27693274 44178102 57443460 77799442 72224991 2775...
output:
0 0
result:
wrong answer 1st words differ - expected: '99974806', found: '0'
Test #20:
score: 0
Wrong Answer
time: 470ms
memory: 1872kb
input:
100000 7000000 67 208233944 504103320 71 7263944 53468728 10518204 48490395 37736986 77899217 303590...
output:
0 0
result:
wrong answer 1st words differ - expected: '99924577', found: '0'