Submission #710077

# Submission time Handle Problem Language Result Execution time Memory
710077 2023-03-15T04:24:23 Z Tyx2019 Money (IZhO17_money) C++17
0 / 100
0 ms 212 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    int N;
    cin >> N;
    int A[N];
    for(int i=0;i<N;i++) cin >> A[i];
    set<int> S;
    queue<int> Q;
    int prev=-1;
    int cnt=1;
    int lessthan=1e8;
    for(int i=0;i<N;i++){
        if(prev==-1){
            prev=A[i];
            auto k=S.upper_bound(A[i]);
            if(k!=S.end()){
                lessthan=*k;
            }
            continue;
        }
        if(A[i]>=A[i-1]&&A[i]<=lessthan)continue;
        prev=-1;
        cnt++;
        i--;

    }
    cout << cnt;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -