Submission #392847

#TimeUsernameProblemLanguageResultExecution timeMemory
392847rainboyBaloni (COCI15_baloni)C11
100 / 100
98 ms272 KiB
#include <stdio.h> #define A 1000000 int main() { static int kk[A + 2]; int n, ans; scanf("%d", &n); ans = n; while (n--) { int a; scanf("%d", &a); if (kk[a + 1] > 0) kk[a + 1]--, ans--; kk[a]++; } printf("%d\n", ans); return 0; }

Compilation message (stderr)

baloni.c: In function 'main':
baloni.c:9:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
    9 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
baloni.c:14:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   14 |   scanf("%d", &a);
      |   ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...