| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1359798 | chiiu | Lightning Rod (NOI18_lightningrod) | C++20 | 1098 ms | 152280 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n; cin >> n;
vector<pair<int, int>> st, v;
st.reserve(n);
for (int i = 0; i < n; ++i) {
int x, y; cin >> x >> y;
v.push_back({x, y});
}
sort(v.begin(), v.end());
for(int i = 0; i < n; ++i){
int x = v[i].first;
int y = v[i].second;
int l = x - y;
int r = x + y;
while (!st.empty() && l <= st.back().first) {
st.pop_back();
}
if (!st.empty() && r <= st.back().second) {
continue;
}
st.push_back({l, r});
}
cout << st.size() << "\n";
return 0;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
