Submission #944499

#TimeUsernameProblemLanguageResultExecution timeMemory
944499rainboy올림픽 (KOI13_olympic)C11
100 / 100
1 ms436 KiB
#include <stdio.h> #define N 1000 int main() { static int gg[N], ss[N], bb[N]; int n, h, i, i_, r; scanf("%d%d", &n, &i_), i_--; for (h = 0; h < n; h++) { scanf("%d", &i), i--; scanf("%d%d%d", &gg[i], &ss[i], &bb[i]); } r = 1; for (i = 0; i < n; i++) if (gg[i] > gg[i_] || gg[i] == gg[i_] && (ss[i] > ss[i_] || ss[i] == ss[i_] && bb[i] > bb[i_])) r++; printf("%d\n", r); return 0; }

Compilation message (stderr)

olympic.c: In function 'main':
olympic.c:16:79: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   16 |   if (gg[i] > gg[i_] || gg[i] == gg[i_] && (ss[i] > ss[i_] || ss[i] == ss[i_] && bb[i] > bb[i_]))
      |                                                               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
olympic.c:16:41: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   16 |   if (gg[i] > gg[i_] || gg[i] == gg[i_] && (ss[i] > ss[i_] || ss[i] == ss[i_] && bb[i] > bb[i_]))
      |                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
olympic.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d%d", &n, &i_), i_--;
      |  ^~~~~~~~~~~~~~~~~~~~~~
olympic.c:11:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%d", &i), i--;
      |   ^~~~~~~~~~~~~~~
olympic.c:12:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%d%d%d", &gg[i], &ss[i], &bb[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...