| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1221315 | sula2 | Advertisement 2 (JOI23_ho_t2) | C++20 | 266 ms | 6480 KiB |
#include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
using namespace std;
int main() {
int n; cin >> n;
pair<int,int> a[n];
// x[j] - x[i] <= e[i] - e[j]
// x[j] + e[j] <= e[i] + x[i]
for (auto& [x, y] : a) {
int pos, inf; cin >> pos >> inf;
x = inf + pos;
y = inf - pos;
}
sort(a, a+n, greater<>());
vector<int> lis;
for (auto [x, y] : a) {
auto it = lower_bound(all(lis), y);
if (it == lis.end())
lis.push_back(y);
else
*it = y;
}
cout << lis.size();
}| # | 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... | ||||
