| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1221314 | sula2 | Advertisement 2 (JOI23_ho_t2) | C++20 | 66 ms | 1348 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];
for (auto& [x, y] : a) {
int pos, inf; cin >> pos >> inf;
x = inf + pos;
y = inf - pos;
}
sort(a, a+n);
vector<int> lis;
for (auto [x, y] : a) {
auto it = upper_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... | ||||
