# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
515943 | Joo | Lightning Rod (NOI18_lightningrod) | C++17 | 382 ms | 80056 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
inline void read(int& x) {
x = 0;
char ch = getchar_unlocked();
while (ch&16){
x = (x << 3) + (x << 1) + (ch&15);
ch = getchar_unlocked();
}
}
int main(void){
int n; read(n);
stack<pair<int, int>> st;
for(int i = 1; i <= n; i++){
int x, y; read(x), read(y);
while(!st.empty() and x-st.top().first <= y-st.top().second) st.pop();
if(st.empty() or (x-st.top().first > y-st.top().second and x-st.top().first > st.top().second-y)) st.push({x, y});
}
printf("%d\n", st.size());
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... |