제출 #656511

#제출 시각아이디문제언어결과실행 시간메모리
656511someoneGlobal Warming (CEOI18_glo)C++14
27 / 100
114 ms5464 KiB
#include <bits/stdc++.h> //#define int long long using namespace std; const int N = 2500 + 42, INF = 1e9 + 42; int n, d; set<int> lis; void insert(int x) { auto it = lis.lower_bound(x); if(it != lis.end()) lis.erase(it); lis.insert(x); } signed main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n >> d; for(int i = 0; i < n; i++) { int a; cin >> a; insert(a + d); insert(a); } cout << lis.size(); }
#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...