| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 940002 | vjudge1 | Global Warming (CEOI18_glo) | C++17 | 2033 ms | 9696 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update> ordered_set;
#define int long long
#define ff first
#define ss second
const int INF = 1e9 + 7;
const int N = 1e6 + 1;
int LIS(vector<int> a){
set<int> dp;
for(int i = 0;i < (int)a.size(); i++){
int x = a[i];
if(dp.lower_bound(x) != dp.end()) dp.erase(dp.lower_bound(x));
dp.insert(x);
}
return (int)dp.size();
}
main(){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int n; cin >> n;
int x; cin >> x;
vector<int> a(n);
for(int i = 0;i < n; i++){
cin >> a[i];
}
vector<int> A = a;
int ans = LIS(a);
if(x == 0){
cout << ans;
return 0;
}
for(int i = 0;i < n; i++){
a[i]+= -x;
ans = max(ans, LIS(a));
}
a = A;
for(int i = n-1; i >= 0; i--){
a[i]+= x;
ans = max(ans, LIS(a));
}
cout << ans;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
