#include <cstdio>usingnamespace std;
int n;
int a[100];
intmain() {
scanf("%d", &n);
for (int i =1; i <= n; ++i)
scanf("%d", &a[i]);
int ans =1;
for (int i =1; i <= n; ++i) {
if (i >1&& a[i] < a[i -1])
ans = i;
while (ans < n && a[i] >= a[ans +1])
++ans;
printf("%d\n", ans);
}
return0;
}
Time limit: 0
Quiz Summary
0 of 6 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.