Submission #259874

#TimeUsernameProblemLanguageResultExecution timeMemory
259874peuchGlobal Warming (CEOI18_glo)C++17
10 / 100
57 ms3960 KiB
#include<bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 10; const int INF = 2e9 + 7; int n, x; int v[MAXN]; int dp[MAXN]; int ans; int main(){ scanf("%d %d", &n, &x); for(int i = 1; i <= n; i++){ scanf("%d", &v[i]); dp[i] = INF; } for(int i = 1; i <= n; i++){ int k = lower_bound(dp, dp + n + 1, v[i]) - dp; dp[k] = v[i]; ans = max(ans, k); } printf("%d\n", ans); }

Compilation message (stderr)

glo.cpp: In function 'int main()':
glo.cpp:13:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &x);
  ~~~~~^~~~~~~~~~~~~~~~~
glo.cpp:15:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &v[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...