# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20219 | suwon123 | 컬러볼 (KOI15_ball) | C11 | 1085 ms | 3 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |