Submission #2710509
Source Code Expand
#include <stdio.h>
int main(void)
{
int N, M, X, Y, a[100000] = {0}, b[100000] = {0}, i, j, count = 0,
position = 0;
scanf("%d %d %d %d ", &N, &M, &X, &Y);
for(i=0; i<N; i++) {
scanf("%d", &a[i]);
}
for(i=0; i<M; i++) {
scanf("%d", &b[i]);
}
int times = a[0];
i = 0, j = 0;
while(a[i] || b[j]) {
if(position%2) {
if(times <= b[j]) {
times = b[j] + Y ;
position++;
count++;
}
j++;
}else {
if(times <= a[i]) {
times = a[i] + X;
position++;
}
i++;
}
}
printf("%d\n", count);
return 0;
}
Submission Info
Submission Time |
|
Task |
A - 勝率計算 |
User |
testsute |
Language |
C (GCC 5.4.1) |
Score |
0 |
Code Size |
770 Byte |
Status |
WA |
Exec Time |
1 ms |
Memory |
896 KB |
Compile Error
./Main.c: In function ‘main’:
./Main.c:8:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d %d %d ", &N, &M, &X, &Y);
^
./Main.c:10:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &a[i]);
^
./Main.c:13:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &b[i]);
^
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 100 |
Status |
|
|
Set Name |
Test Cases |
Sample |
subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt |
All |
0.txt, 1.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 2.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt |
Case Name |
Status |
Exec Time |
Memory |
0.txt |
WA |
1 ms |
896 KB |
1.txt |
WA |
1 ms |
896 KB |
10.txt |
WA |
1 ms |
896 KB |
11.txt |
WA |
1 ms |
896 KB |
12.txt |
WA |
1 ms |
896 KB |
13.txt |
WA |
1 ms |
896 KB |
14.txt |
WA |
1 ms |
896 KB |
15.txt |
WA |
1 ms |
896 KB |
16.txt |
WA |
1 ms |
896 KB |
17.txt |
WA |
1 ms |
896 KB |
18.txt |
WA |
1 ms |
896 KB |
19.txt |
WA |
1 ms |
896 KB |
2.txt |
WA |
1 ms |
896 KB |
20.txt |
WA |
1 ms |
896 KB |
21.txt |
WA |
1 ms |
896 KB |
22.txt |
WA |
1 ms |
896 KB |
23.txt |
WA |
1 ms |
896 KB |
24.txt |
WA |
1 ms |
896 KB |
25.txt |
WA |
1 ms |
896 KB |
26.txt |
WA |
1 ms |
896 KB |
27.txt |
WA |
1 ms |
896 KB |
28.txt |
WA |
1 ms |
896 KB |
29.txt |
WA |
1 ms |
896 KB |
3.txt |
WA |
1 ms |
896 KB |
4.txt |
WA |
1 ms |
896 KB |
5.txt |
WA |
1 ms |
896 KB |
6.txt |
WA |
1 ms |
896 KB |
7.txt |
WA |
1 ms |
896 KB |
8.txt |
WA |
1 ms |
896 KB |
9.txt |
WA |
1 ms |
896 KB |
subtask0_sample_01.txt |
WA |
1 ms |
896 KB |
subtask0_sample_02.txt |
WA |
1 ms |
896 KB |
subtask0_sample_03.txt |
WA |
1 ms |
896 KB |