제출 #810706

#제출 시각아이디문제언어결과실행 시간메모리
810706_martynasAdvertisement 2 (JOI23_ho_t2)C++11
100 / 100
373 ms18184 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define all(a) (a).begin(), (a).end() using pii = pair<int, int>; const int mxn = 5e5+5; int n; int X[mxn], E[mxn]; int main() { cin >> n; for(int i = 0; i < n; i++) cin >> X[i] >> E[i]; vector<pii> A; for(int i = 0; i < n; i++) { A.pb({X[i]-E[i], -(X[i]+E[i])}); } sort(all(A)); int mxr = -2e9-1; int cnt = 0; for(auto p : A) { int l = p.fi, r = -p.se; if(mxr >= r) continue;; cnt++, mxr = r; } cout << cnt << "\n"; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:28:13: warning: unused variable 'l' [-Wunused-variable]
   28 |         int l = p.fi, r = -p.se;
      |             ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...