Submission #20219

#TimeUsernameProblemLanguageResultExecution timeMemory
20219suwon123컬러볼 (KOI15_ball)C11
0 / 25
1085 ms3 KiB
#include <stdio.h> #define MAX 200000 int main(void) { int size[MAX], col[MAX], result[MAX] = {0,}; int num, i, j; scanf("%d", &num); for(i=0; i<num; i++) scanf("%d %d", &col[i], &size[i]); i=0; j=i+1; while(i<num) { if(j == num) { i++; j = i+1; } if(col[i] != col[j] && size[i] > size[j]) result[i] += size[j]; j++; } for(i=0; i<num; i++) printf("%d\n", result[i]); }

Compilation message (stderr)

ball.c: In function 'main':
ball.c:9:5: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &num);
     ^
ball.c:11:9: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &col[i], &size[i]);
         ^
#Verdict Execution timeMemoryGrader output
Fetching results...