Submission #662170

#TimeUsernameProblemLanguageResultExecution timeMemory
662170Darren0724Financial Report (JOI21_financial)C++17
5 / 100
53 ms8364 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define all(x) x.begin(),x.end() const int INF=1e18; const int mod=1e9+7; signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n,k;cin>>n>>k; vector<int> v(n); vector<int> a; for(int i=0;i<n;i++){ cin>>v[i]; } reverse(all(v)); for(int i=0;i<n;i++){ v[i]=-v[i]; } for(int i=0;i<n;i++){ int p=lower_bound(all(a),v[i])-a.begin(); if(p>=a.size()){ a.push_back(v[i]); } else{ a[p]=v[i]; } } cout<<a.size()<<endl; return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:23:13: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         if(p>=a.size()){
      |            ~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...