Submission #1109711

#TimeUsernameProblemLanguageResultExecution timeMemory
1109711KindaGoodGamesGlobal Warming (CEOI18_glo)C++14
15 / 100
2059 ms1864 KiB
#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> oarr(n); for(int i = 0; i < n; i++ ){ cin >> oarr[i]; } int ma = 0; for(int k = -x; k <= x; k++){ for(int l = 0; l < n; l++){ for(int r = l; r< n; r++){ vector<int> arr = oarr; for(int i = l; i <= r; i++){ arr[i] += k; } 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]; } } ma = max(ma,(int)dp.size()); } } } cout << ma << endl; }

Compilation message (stderr)

glo.cpp: In function 'int main()':
glo.cpp:32:27: warning: comparison of integer expressions of different signedness: 'long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |                     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...