Submission #344797

# Submission time Handle Problem Language Result Execution time Memory
344797 2021-01-06T14:50:24 Z scales Money (IZhO17_money) C++17
9 / 100
1 ms 364 KB
#include <bits/stdc++.h>
/*#ifndef LOCAL_RUN
    #pragma GCC optimize("Ofast")
    #pragma GCC optimize("unroll-loops")
    #pragma GCC optimize("fast-math")
    #pragma GCC target("avx2,tune=native")
#endif*/
using namespace std;
long long M=1000000007;

int main()
{
        ios::sync_with_stdio(false);
        cin.tie(0);
    long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin>>n;
    vector<long long> a(n),b(n);
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    kol=1;
    maxi=M;
    set<long long> s;
    auto g=s.end();
    s.insert(a[0]);
    for(i=1;i<n;i++)
    {
        if(a[i]<a[i-1] || a[i]>maxi)
        {
            g=s.upper_bound(a[i]);
            maxi=*g;
            kol++;
        }
        else
        {

        }
        s.insert(a[i]);
    }
    cout<<kol<<endl;
    return 0;
}

Compilation message

money.cpp: In function 'int main()':
money.cpp:15:17: warning: unused variable 't' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                 ^
money.cpp:15:21: warning: unused variable 'j' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                     ^
money.cpp:15:23: warning: unused variable 'y' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                       ^
money.cpp:15:25: warning: unused variable 'x1' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                         ^~
money.cpp:15:28: warning: unused variable 'y1' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                            ^~
money.cpp:15:31: warning: unused variable 'sum' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                               ^~~
money.cpp:15:35: warning: unused variable 'x' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                                   ^
money.cpp:15:37: warning: unused variable 'q' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                                     ^
money.cpp:15:39: warning: unused variable 'l' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                                       ^
money.cpp:15:41: warning: unused variable 'r' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                                         ^
money.cpp:15:43: warning: unused variable 'tip' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                                           ^~~
money.cpp:15:47: warning: unused variable 'k' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                                               ^
money.cpp:15:49: warning: unused variable 'mini' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                                                 ^~~~
money.cpp:15:63: warning: unused variable 'p' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                                                               ^
money.cpp:15:65: warning: unused variable 'v' [-Wunused-variable]
   15 |     long long   t,i,j,y,x1,y1,sum,x,q,l,r,tip,k,mini,maxi,kol,p,v,n;
      |                                                                 ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 0 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 0 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 0 ms 364 KB Output is correct
11 Correct 1 ms 364 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 364 KB Output is correct
14 Correct 1 ms 364 KB Output is correct
15 Correct 1 ms 364 KB Output is correct
16 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 0 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 0 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 0 ms 364 KB Output is correct
11 Correct 1 ms 364 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 364 KB Output is correct
14 Correct 1 ms 364 KB Output is correct
15 Correct 1 ms 364 KB Output is correct
16 Correct 1 ms 364 KB Output is correct
17 Incorrect 1 ms 364 KB Output isn't correct
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 0 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 0 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 0 ms 364 KB Output is correct
11 Correct 1 ms 364 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 364 KB Output is correct
14 Correct 1 ms 364 KB Output is correct
15 Correct 1 ms 364 KB Output is correct
16 Correct 1 ms 364 KB Output is correct
17 Incorrect 1 ms 364 KB Output isn't correct
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 0 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 0 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 0 ms 364 KB Output is correct
11 Correct 1 ms 364 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 1 ms 364 KB Output is correct
14 Correct 1 ms 364 KB Output is correct
15 Correct 1 ms 364 KB Output is correct
16 Correct 1 ms 364 KB Output is correct
17 Incorrect 1 ms 364 KB Output isn't correct
18 Halted 0 ms 0 KB -