Submission #819161

#TimeUsernameProblemLanguageResultExecution timeMemory
819161TS_2392Global Warming (CEOI18_glo)C++14
27 / 100
31 ms972 KiB
#include <bits/stdc++.h> #define pb push_back #define lwb lower_bound #define all(x) (x).begin(), (x).end() using namespace std; const int N = 2e5 + 3; int n, x; vector<int> lis; void solve(int v){ int i = lwb(all(lis), v) - lis.begin(); if(i == lis.size()) lis.pb(v); else lis[i] = v; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n >> x; for(int i = 1; i <= n; ++i){ int a; cin >> a; if(x != 0) solve(a + x); solve(a); } cout << lis.size(); return 0; }

Compilation message (stderr)

glo.cpp: In function 'void solve(int)':
glo.cpp:11:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     if(i == lis.size()) lis.pb(v);
      |        ~~^~~~~~~~~~~~~
#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...