# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
484282 | rainboy | Po (COCI21_po) | C11 | 13 ms | 1740 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 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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |