Submission #484282

#TimeUsernameProblemLanguageResultExecution timeMemory
484282rainboyPo (COCI21_po)C11
20 / 70
13 ms1740 KiB
#include <stdio.h> #define N 100000 int main() { static int aa[N], qu[N]; int n, i, cnt, ans; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &aa[i]); ans = n, cnt = 0; for (i = 0; i < n; i++) { while (cnt && aa[qu[cnt - 1]] > aa[i]) cnt--; if (cnt && aa[qu[cnt - 1]] == aa[i]) ans--; qu[cnt++] = i; } printf("%d\n", ans); return 0; }

Compilation message (stderr)

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