# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
731670 | Toxtaq | Global Warming (CEOI18_glo) | C++17 | 2068 ms | 2576 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, x, res = 0;
cin >> n >> x;
vector<int>t(n);
for(int i = 0;i < n;++i)cin >> t[i];
for(int i = -x;i <= x;++i){
for(int l = 0;l < n;++l){
vector<int>modif;
modif = t;
for(int r = l;r < n;++r){
modif[r] += i;
vector<int>tempo;
for(int k = 0;k < n;++k){
int pos = lower_bound(tempo.begin(), tempo.end(), modif[k]) - tempo.begin();
if(pos == tempo.size())tempo.push_back(modif[k]);
else tempo[pos] = modif[k];
}
res = max(res, (int)tempo.size());
}
}
}
cout << res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |