| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1314670 | joshjuice | Lightning Rod (NOI18_lightningrod) | C++20 | 270 ms | 159156 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define fi first
#define se second
#define p push
inline void input(ll & x) {
x = 0;
char ch = getchar_unlocked();
while (ch < '0' || ch > '9') ch = getchar_unlocked();
while (ch >= '0' && ch <= '9') {
x = (x << 3) + (x << 1) + (ch & 15);
ch = getchar_unlocked();
}
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll n; input(n);
stack<pll> s;
for (ll i = 0; i < n; ++i) {
pll c; input(c.fi); input(c.se);
bool b = 1;
while (s.size()) {
ll tx = s.top().fi, ty = s.top().se;
ll x = c.fi, y = c.se;
if (abs(tx-x) <= ty-y) { //tx protect
b = 0;
break;
} else if (abs(x-tx) <= y-ty) s.pop(); // x protect
else break; // individual
}
if (b) s.p(c);
}
printf("%lld", 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... | ||||
