| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1157637 | c4c7u5 | Advertisement 2 (JOI23_ho_t2) | C++20 | 0 ms | 324 KiB |
#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> a[500005];
vector<int> v;
int main() {
cin >> n;
for(int i=0;i<n;i++) cin >> a[i].first >> a[i].second;
sort(a, a+n);
int tmp=-1;
for(int i=0;i<n;i++) {
while(!v.empty() && v.front()<=a[i].second-a[i].first) v.pop_back();
if(a[i].second+a[i].first>tmp) {
v.push_back(a[i].second-a[i].first);
tmp = a[i].second+a[i].first;
}
}
cout << v.size() << "\n";
return 0;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
