| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1136128 | fzyzzz_z | Advertisement 2 (JOI23_ho_t2) | C++20 | 99 ms | 4168 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<pair<int, int>> a(n);
for (auto & [x, y]: a) {
cin >> x >> y;
auto x1 = x - y;
auto y1 = x + y;
x = x1;
y = y1;
}
sort(a.begin(), a.end());
// find upper hull
int ans = 0;
int xx = -1, yy = -1;
for (auto [x, y]: a) {
if (xx == x && yy <= y) {
xx = x;
yy = y;
} else if (y > yy) {
xx = x;
yy = y;
ans++;
}
}
cout << ans << '\n';
return 0;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
