제출 #984502

#제출 시각아이디문제언어결과실행 시간메모리
984502AcanikolicGlobal Warming (CEOI18_glo)C++14
28 / 100
2050 ms5336 KiB
#include <bits/stdc++.h> #define int long long #define pb push_back #define F first #define S second const int N = 500 + 10; const int inf = 2e9; const int mod = 998244353; using namespace std; int lis(vector<int>v) { vector<int>ans; for(int i = 0; i < v.size(); i++) { if(ans.empty() || ans.back() < v[i]) { ans.pb(v[i]); }else { int lb = lower_bound(ans.begin(),ans.end(),v[i]) - ans.begin(); ans[lb] = v[i]; } } return (int)ans.size(); } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n,x,res = 0; cin >> n >> x; vector<int>a(n); for(int i = 0; i < n; i++) cin >> a[i]; res = lis(a); for(int i = 0; i < n; i++) { a[i] -= x; res = max(res,lis(a)); } cout << res; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

glo.cpp: In function 'long long int lis(std::vector<long long int>)':
glo.cpp:21:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |  for(int i = 0; i < v.size(); 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...