Submission #344800

#TimeUsernameProblemLanguageResultExecution timeMemory
344800scalesMoney (IZhO17_money)C++17
100 / 100
1270 ms64420 KiB
#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]); if(g==s.end()) { maxi=M; } else { maxi=*g; } kol++; } else { } s.insert(a[i]); } cout<<kol<<endl; return 0; }

Compilation message (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...