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