# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
85534 | 2018-11-20T18:53:36 Z | farukkastamonuda | Money (IZhO17_money) | C++14 | 3 ms | 688 KB |
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define lo long long #define inf 1000000000 #define md 1000000007 #define pb push_back #define li 1000005 using namespace std; int n,A[li],flag,tut=1,cev=1; set<int> s; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&A[i]); s.insert(inf); s.insert(A[1]); for(int i=2;i<=n;i++){ if(A[i]>=A[i-1]){ s.insert(A[i]); tut=i; } else break; } int bas=tut+1; if(bas<=n) cev++; for(int i=tut+1;i<=n;i++){ //~ printf("I :: %d CEV :: %d\n",i,cev); if(i==bas || A[i]>=A[i-1]){ int it1=*s.upper_bound(A[bas]); //int it2=*s.upper_bound(A[bas]); //~ cout<<"YETETETETETETETETERRRETETE::: :: "<<it1<<" "<<it2<<endl; if(it1>=A[i]) {s.insert(A[i]);} else{ //~ cout<<"EASAS :: : : "<<i<<endl; cev++; bas=i; i--; } } else{ bas=i; cev++; i--; } } printf("%d\n",cev); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 484 KB | Output is correct |
3 | Correct | 2 ms | 484 KB | Output is correct |
4 | Correct | 2 ms | 484 KB | Output is correct |
5 | Correct | 2 ms | 484 KB | Output is correct |
6 | Correct | 2 ms | 484 KB | Output is correct |
7 | Correct | 2 ms | 484 KB | Output is correct |
8 | Correct | 2 ms | 484 KB | Output is correct |
9 | Correct | 2 ms | 484 KB | Output is correct |
10 | Correct | 2 ms | 484 KB | Output is correct |
11 | Correct | 2 ms | 484 KB | Output is correct |
12 | Correct | 2 ms | 484 KB | Output is correct |
13 | Correct | 2 ms | 484 KB | Output is correct |
14 | Correct | 2 ms | 508 KB | Output is correct |
15 | Correct | 2 ms | 548 KB | Output is correct |
16 | Correct | 2 ms | 552 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 484 KB | Output is correct |
3 | Correct | 2 ms | 484 KB | Output is correct |
4 | Correct | 2 ms | 484 KB | Output is correct |
5 | Correct | 2 ms | 484 KB | Output is correct |
6 | Correct | 2 ms | 484 KB | Output is correct |
7 | Correct | 2 ms | 484 KB | Output is correct |
8 | Correct | 2 ms | 484 KB | Output is correct |
9 | Correct | 2 ms | 484 KB | Output is correct |
10 | Correct | 2 ms | 484 KB | Output is correct |
11 | Correct | 2 ms | 484 KB | Output is correct |
12 | Correct | 2 ms | 484 KB | Output is correct |
13 | Correct | 2 ms | 484 KB | Output is correct |
14 | Correct | 2 ms | 508 KB | Output is correct |
15 | Correct | 2 ms | 548 KB | Output is correct |
16 | Correct | 2 ms | 552 KB | Output is correct |
17 | Correct | 2 ms | 552 KB | Output is correct |
18 | Correct | 2 ms | 552 KB | Output is correct |
19 | Correct | 2 ms | 564 KB | Output is correct |
20 | Correct | 2 ms | 628 KB | Output is correct |
21 | Correct | 2 ms | 628 KB | Output is correct |
22 | Correct | 2 ms | 628 KB | Output is correct |
23 | Correct | 3 ms | 656 KB | Output is correct |
24 | Correct | 2 ms | 656 KB | Output is correct |
25 | Correct | 2 ms | 664 KB | Output is correct |
26 | Correct | 2 ms | 664 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 484 KB | Output is correct |
3 | Correct | 2 ms | 484 KB | Output is correct |
4 | Correct | 2 ms | 484 KB | Output is correct |
5 | Correct | 2 ms | 484 KB | Output is correct |
6 | Correct | 2 ms | 484 KB | Output is correct |
7 | Correct | 2 ms | 484 KB | Output is correct |
8 | Correct | 2 ms | 484 KB | Output is correct |
9 | Correct | 2 ms | 484 KB | Output is correct |
10 | Correct | 2 ms | 484 KB | Output is correct |
11 | Correct | 2 ms | 484 KB | Output is correct |
12 | Correct | 2 ms | 484 KB | Output is correct |
13 | Correct | 2 ms | 484 KB | Output is correct |
14 | Correct | 2 ms | 508 KB | Output is correct |
15 | Correct | 2 ms | 548 KB | Output is correct |
16 | Correct | 2 ms | 552 KB | Output is correct |
17 | Correct | 2 ms | 552 KB | Output is correct |
18 | Correct | 2 ms | 552 KB | Output is correct |
19 | Correct | 2 ms | 564 KB | Output is correct |
20 | Correct | 2 ms | 628 KB | Output is correct |
21 | Correct | 2 ms | 628 KB | Output is correct |
22 | Correct | 2 ms | 628 KB | Output is correct |
23 | Correct | 3 ms | 656 KB | Output is correct |
24 | Correct | 2 ms | 656 KB | Output is correct |
25 | Correct | 2 ms | 664 KB | Output is correct |
26 | Correct | 2 ms | 664 KB | Output is correct |
27 | Correct | 2 ms | 672 KB | Output is correct |
28 | Incorrect | 2 ms | 688 KB | Output isn't correct |
29 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 484 KB | Output is correct |
3 | Correct | 2 ms | 484 KB | Output is correct |
4 | Correct | 2 ms | 484 KB | Output is correct |
5 | Correct | 2 ms | 484 KB | Output is correct |
6 | Correct | 2 ms | 484 KB | Output is correct |
7 | Correct | 2 ms | 484 KB | Output is correct |
8 | Correct | 2 ms | 484 KB | Output is correct |
9 | Correct | 2 ms | 484 KB | Output is correct |
10 | Correct | 2 ms | 484 KB | Output is correct |
11 | Correct | 2 ms | 484 KB | Output is correct |
12 | Correct | 2 ms | 484 KB | Output is correct |
13 | Correct | 2 ms | 484 KB | Output is correct |
14 | Correct | 2 ms | 508 KB | Output is correct |
15 | Correct | 2 ms | 548 KB | Output is correct |
16 | Correct | 2 ms | 552 KB | Output is correct |
17 | Correct | 2 ms | 552 KB | Output is correct |
18 | Correct | 2 ms | 552 KB | Output is correct |
19 | Correct | 2 ms | 564 KB | Output is correct |
20 | Correct | 2 ms | 628 KB | Output is correct |
21 | Correct | 2 ms | 628 KB | Output is correct |
22 | Correct | 2 ms | 628 KB | Output is correct |
23 | Correct | 3 ms | 656 KB | Output is correct |
24 | Correct | 2 ms | 656 KB | Output is correct |
25 | Correct | 2 ms | 664 KB | Output is correct |
26 | Correct | 2 ms | 664 KB | Output is correct |
27 | Correct | 2 ms | 672 KB | Output is correct |
28 | Incorrect | 2 ms | 688 KB | Output isn't correct |
29 | Halted | 0 ms | 0 KB | - |