Submission #338918

# Submission time Handle Problem Language Result Execution time Memory
338918 2020-12-24T09:38:12 Z kkk Money (IZhO17_money) C++14
0 / 100
1 ms 364 KB
#include<iostream>
#include<set>
using namespace std;
long long m[1000004];
set <long long> s;
int main()
{
    long long n,i,pr=1e10,br=0;
    cin>>n;
    for(i=0;i<n;i++)cin>>m[i];
    s.insert(pr);
    for(i=0;i<n;i++)
    {
        pr=*s.upper_bound(m[i]);
        while(m[i]<m[i+1] && m[i]<pr)
        {s.insert(m[i]);i++;}
        br++;
    }
    cout<<br<<endl;

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