제출 #857114

#제출 시각아이디문제언어결과실행 시간메모리
857114NotLinuxAdvertisement 2 (JOI23_ho_t2)C++17
100 / 100
124 ms12528 KiB
#include <bits/stdc++.h> using namespace std; #define int long long pair < int , int > rot(pair < int , int > a){ return {a.first - a.second , a.first + a.second}; } void solve(){ int n;cin >> n; pair < int , int > arr[n]; for(int i = 0;i<n;i++){ cin >> arr[i].first >> arr[i].second; arr[i] = rot(rot(rot(arr[i]))); } sort(arr , arr + n); int ans = 0 , miny = 1e18 + 7; for(int i = 0;i<n;i++){ if(arr[i].second < miny){ miny = arr[i].second; ans++; } } cout << ans << endl; } signed main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); int testcase = 1;//cin >> testcase; while(testcase--)solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...