Submission #930407
Source Code Expand
Copy
#include<stdio.h>
int countup(int x, int y, int z){
if(y < z) return countup(x,y+x,z);
else return y;
}
int main(void){
int i;
int total = 0;
int N;
scanf("%d",&N);
int num[2][N];
scanf("%d %d",&num[0][0],&num[1][0]);
for(i = 1; i < N; i++){
scanf("%d %d",&num[0][i] ,&num[1][i]);
if(num[0][i] != num[0][i-1] || num[1][i] != num[1][i-1]){
total = countup(num[0][i] + num[1][i], num[0][i] + num[1][i], total);
}
}
printf("%d\n",total);
return 0;
}
Submission Info
Compile Error
./Main.c: In function ‘main’:
./Main.c:12:1: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&N);
^
./Main.c:16:1: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d",&num[0][0],&num[1][0]);
^
./Main.c:18:1: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d",&num[0][i] ,&num[1][i]);
^
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 300 |
Status |
|
|
Set Name |
Test Cases |
Sample |
0_000.txt, 0_001.txt, 0_002.txt |
All |
0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt |
Case Name |
Status |
Exec Time |
Memory |
0_000.txt |
WA |
1 ms |
128 KB |
0_001.txt |
AC |
1 ms |
128 KB |
0_002.txt |
WA |
1 ms |
128 KB |
1_003.txt |
WA |
1 ms |
128 KB |
1_004.txt |
WA |
1 ms |
128 KB |
1_005.txt |
WA |
1 ms |
128 KB |
1_006.txt |
WA |
1 ms |
128 KB |
1_007.txt |
WA |
1 ms |
128 KB |
1_008.txt |
WA |
1 ms |
128 KB |
1_009.txt |
WA |
1 ms |
128 KB |
1_010.txt |
WA |
1 ms |
128 KB |
1_011.txt |
WA |
1 ms |
128 KB |
1_012.txt |
WA |
1 ms |
128 KB |
1_013.txt |
WA |
1 ms |
128 KB |
1_014.txt |
WA |
1 ms |
128 KB |