Submission #731789

#TimeUsernameProblemLanguageResultExecution timeMemory
731789beabossGlobal Warming (CEOI18_glo)C++14
10 / 100
93 ms5572 KiB
#include "bits/stdc++.h" using namespace std; #define s second #define f first #define pb push_back typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> pii; const ll INF = 1e17 + 10ll; const ll N = 2*1e5 + 10; int main() { int n, x; cin >> n >> x; vi vals(n); vi dp(n); vi cur; for (int i = 0; i < n; i++) { cin >> vals[i]; auto ind = lower_bound(cur.begin(), cur.end(), vals[i]) - cur.begin(); if (ind == cur.size()) cur.pb(vals[i]); else cur[ind] = vals[i]; dp[i] = cur.size(); } cout << dp[n-1] << endl; }

Compilation message (stderr)

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