Submission #260691

#TimeUsernameProblemLanguageResultExecution timeMemory
260691biggGlobal Warming (CEOI18_glo)C++14
10 / 100
54 ms5496 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 10;
const ll INF =1e18;
ll dp[MAXN], v[MAXN];
int main(){
	int n;
	ll x;
	scanf("%d %lld", &n, &x);
	for(int i = 1; i <= n; i++) scanf("%lld", &v[i]), dp[i] = INF;
	dp[0] = INF;
	int ans = -1;
	for(int i = 1; i <= n; i++){
		int it1 = lower_bound(dp, dp + n, v[i]) - dp;
		dp[it1] = v[i];
		ans = max(ans, it1 + 1);
	}
	printf("%d\n",ans );

}

Compilation message (stderr)

glo.cpp: In function 'int main()':
glo.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %lld", &n, &x);
  ~~~~~^~~~~~~~~~~~~~~~~~~
glo.cpp:11:50: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i = 1; i <= n; i++) scanf("%lld", &v[i]), dp[i] = INF;
                              ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
#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...