Submission #1085456

#TimeUsernameProblemLanguageResultExecution timeMemory
1085456I_am_Polish_GirlAdvertisement 2 (JOI23_ho_t2)C++14
59 / 100
2083 ms4812 KiB
#pragma target("arch=icelake-server") #include <iostream> #include <vector> #include <algorithm> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <stack> #include <queue> #include <cmath> #include <random> #include <chrono> #include <iomanip> #include <bitset> using namespace std; #define int long long typedef long long ll; typedef long double ld; int log_ = 21; int inf = 4000000007000000007; long long mod = 998244353; int p = 499; int NADIYA = 39; signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; cin >> n; vector <pair <int, int>> vp(n); for (int i = 0; i < n; i++) cin >> vp[i].first >> vp[i].second; vector <bool> t(n, false); int ans = 0; int c = 0; while (c < n) { ans++; int mx = -1; int p = -1; for (int i = 0; i < n; i++) { if (t[i] == false) { if (mx < vp[i].second) { mx = vp[i].second; p = vp[i].first; } } } for (int i = 0; i < n; i++) { if (t[i] == false) { if (abs(vp[i].first - p) <= (mx - vp[i].second)) { t[i] = true; c++; } } } } cout << ans; } /*5 1 2 1 2 3 1 2 4 1 1 5 4 */

Compilation message (stderr)

Main.cpp:1: warning: ignoring '#pragma target ' [-Wunknown-pragmas]
    1 | #pragma target("arch=icelake-server")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...