# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1072875 | Cyanberry | Global Warming (CEOI18_glo) | C++14 | 65 ms | 4812 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// earth cooling
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
int dayc, limit;
cin>>dayc>>limit;
int days[dayc];
for (int i = 0; i < dayc; ++i) {
cin>>days[i];
}
vector<int> LISs[2];
for (int i=0; i < dayc; ++i) {
if (LISs[0].size() > 0) {
int l = -1, r = LISs[0].size();
while (r - l > 1) {
int m = (r+l)/2;
if (LISs[0][m] >= days[i]) {
r = m;
} else {
l = m;
}
}
if (r >= LISs[0].size()) {
LISs[0].push_back(days[i]);
} else {
LISs[0][r] = min(LISs[0][r], days[i]);
}
days[i] += limit;
l = -1, r = LISs[0].size();
while (r - l > 1) {
int m = (r+l)/2;
if (LISs[0][m] >= days[i]) {
r = m;
} else {
l = m;
}
}
if (r >= LISs[1].size()) {
LISs[1].push_back(days[i]);
} else {
LISs[1][r] = min(LISs[1][r], days[i]);
}
l = -1, r = LISs[1].size();
while (r - l > 1) {
int m = (r+l)/2;
if (LISs[1][m] >= days[i]) {
r = m;
} else {
l = m;
}
}
if (r >= LISs[1].size()) {
LISs[1].push_back(days[i]);
} else {
LISs[1][r] = min(LISs[1][r], days[i]);
}
} else {
LISs[0].push_back(days[i]);
LISs[1].push_back(days[i] + limit);
}
}
// for (int i : LISs[0]) {
// cout<<i<<' ';
// }
// cout<<'\n';
// for (int i : LISs[1]) {
// cout<<i<<' ';
// }
// cout<<'\n';
cout<<LISs[1].size();
}
컴파일 시 표준 에러 (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... |