Submission #480119

#TimeUsernameProblemLanguageResultExecution timeMemory
480119rainboyACM (COCI19_acm)C11
50 / 50
6 ms460 KiB
#include <stdio.h> #include <string.h> #define N 1000 int main() { static char cc[N][32]; static int aa[N], bb[N]; int n, m, i, j, a, b, cnt; scanf("%d%d", &n, &m); for (i = 0; i < n; i++) { scanf("%s", cc[i]); for (j = 0; j < m; j++) { static char str[16]; int k, h, m, s; scanf("%s", str); if (str[0] == '-') continue; sscanf(str, "%*c%d/%d:%d:%d", &k, &h, &m, &s); aa[i]++, bb[i] += k * 20 * 60 + (h * 60 + m) * 60 + s; } } scanf("%*s"); a = b = 0; for (j = 0; j < m; j++) { static char str[16]; int k, h, m, s; scanf("%s", str); if (str[0] == '+') { sscanf(str, "%*c%d/%d:%d:%d", &k, &h, &m, &s); a++, b += k * 20 * 60 + (h * 60 + m) * 60 + s; } } cnt = 1; for (i = 0; i < n; i++) { int c = strcmp(cc[i], "NijeZivotJedanACM"); if (c == 0) continue; if (a < aa[i] || a == aa[i] && (b > bb[i] || b == bb[i] && c < 0)) cnt++; } printf("%d\n", cnt); return 0; }

Compilation message (stderr)

acm.c: In function 'main':
acm.c:43:59: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   43 |   if (a < aa[i] || a == aa[i] && (b > bb[i] || b == bb[i] && c < 0))
      |                                                ~~~~~~~~~~~^~~~~~~~
acm.c:43:31: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   43 |   if (a < aa[i] || a == aa[i] && (b > bb[i] || b == bb[i] && c < 0))
      |                    ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
acm.c:11:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |  scanf("%d%d", &n, &m);
      |  ^~~~~~~~~~~~~~~~~~~~~
acm.c:13:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%s", cc[i]);
      |   ^~~~~~~~~~~~~~~~~~
acm.c:18:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |    scanf("%s", str);
      |    ^~~~~~~~~~~~~~~~
acm.c:25:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |  scanf("%*s");
      |  ^~~~~~~~~~~~
acm.c:31:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |   scanf("%s", str);
      |   ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...