# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
141080 | tincamatei | Lightning Rod (NOI18_lightningrod) | C++14 | 639 ms | 188208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
const int BUFF = 1 << 12;
const int MAX_N = 10000000;
int cursor = BUFF - 1;
char buff[BUFF];
char getChar(FILE *fin) {
cursor++;
if(cursor == BUFF) {
cursor = 0;
fread(buff, 1, BUFF, fin);
}
return buff[cursor];
}
int getnr(FILE *fin) {
char ch = getChar(fin);
while(!isdigit(ch))
ch = fgetc(fin);
int nr = 0;
while(isdigit(ch)) {
nr = nr * 10 + ch - '0';
ch = getChar(fin);
}
return nr;
}
struct Point {
int x, y;
} v[MAX_N];
int main() {
int N, x, y;
Point pnt;
N = getnr(stdin);
int top = 0;
for(int i = 0; i < N; ++i) {
x = getnr(stdin);
y = getnr(stdin);
pnt = {x - y, x + y};
while(top > 0 && pnt.x <= v[top - 1].x && pnt.y >= v[top - 1].y)
--top;
if(top == 0 || (top > 0 && !(v[top - 1].x <= pnt.x && v[top - 1].y >= pnt.y)))
v[top++] = pnt;
}
printf("%d", top);
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... |