Submission #1109705

#TimeUsernameProblemLanguageResultExecution timeMemory
1109705KindaGoodGamesGlobal Warming (CEOI18_glo)C++14
10 / 100
63 ms2500 KiB
//11:48 #include<bits/stdc++.h> #define ll long long #define pii pair<int,int> #define tiii tuple<int,int,int> using namespace std; int main(){ int n, x; cin >> n >> x; vector<int> arr(n); for(int i = 0; i < n; i++ ){ cin >> arr[i]; } vector<int> dp; for(int i = 0; i < n; i++){ auto it = lower_bound(dp.begin(),dp.end(),arr[i]) - dp.begin(); if(it >= dp.size()) { dp.push_back(arr[i]); }else{ dp[it] = arr[i]; } } cout << dp.size() << endl; }

Compilation message (stderr)

glo.cpp: In function 'int main()':
glo.cpp:25:15: warning: comparison of integer expressions of different signedness: 'long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |         if(it >= dp.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...
#Verdict Execution timeMemoryGrader output
Fetching results...