# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
78758 | ksmzzang2003 | 공주님의 정원 (KOI11_flower) | C++11 | 49 ms | 7488 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <algorithm>
#define fst first
#define snd second
using namespace std;
int n;
pair<int, int> f[100001];
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
int a, b, c, d;
scanf("%d %d %d %d", &a, &b, &c, &d);
f[i].fst = a * 100 + b, f[i].snd = c * 100 + d;
}
sort(f, f + n);
int date = 301, flag = 0, temp = 0, ans = 0, i = -1;
while (date <= 1130 && i < n) {
flag = 0, i++;
for (int j = i; j < n; j++) {
if (f[j].fst > date) break;
if (temp < f[j].snd) temp = f[j].snd, flag = 1, i = j;
}
if (flag) date = temp, ans++;
else {
printf("0");
return 0;
}
}
printf("%d", 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... |