제출 #1102573

#제출 시각아이디문제언어결과실행 시간메모리
1102573ramzialoulouAdvertisement 2 (JOI23_ho_t2)C++17
0 / 100
2087 ms1720 KiB
#include <bits/stdc++.h> using namespace std; #ifdef Ramzi #include "debug.h" #else #define debug(...) #endif int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<pair<int, int>> p(n); for (int i = 0; i < n; i++) { cin >> p[i].second >> p[i].first; } sort(p.begin(), p.end()); vector<int> v(n, 0); int ans = 0; for (int i = n - 1; i >= 0; i--) { if (count(v.begin(), v.end(), 1) == n) { ans = n - i - 1; break; } for (int j = 0; j < n; j++) { if (abs(p[i].second - p[j].second) <= p[i].first - p[j].first) { v[j] = 1; } } } cout << ans << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...