# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
219595 | GioChkhaidze | Lightning Rod (NOI18_lightningrod) | C++14 | 778 ms | 236936 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N=1e7+7;
bool f[N];
int n,x,y,X[N],Y[N],st[N],sts;
int getn() {
char ch = getchar_unlocked();
int ans = 0;
while(!isdigit(ch)) {
ch = getchar_unlocked();
}
while(isdigit(ch)) {
ans = ans * 10 + ch - '0';
ch = getchar_unlocked();
}
return ans;
}
main () {
n=getn();
for (int i=1; i<=n; i++) {
x=getn();
y=getn();
X[i]=x-y;
Y[i]=x+y;
}
for (int i=1; i<=n; i++) {
if (sts) {
while (sts && X[st[sts]]>=X[i]) {
f[st[sts]]=1;
--sts;
}
}
st[++sts]=i;
}
sts=0;
for (int i=n; i>=1; i--) {
if (f[i]) continue;
if (sts) {
while (sts && Y[st[sts]]<=Y[i]) {
--sts;
}
}
st[++sts]=i;
}
cout<<sts;
}
컴파일 시 표준 에러 (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... |