제출 #1106316

#제출 시각아이디문제언어결과실행 시간메모리
1106316LuvidiAdvertisement 2 (JOI23_ho_t2)C++17
59 / 100
2079 ms3832 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #define fs first #define sc second #define pb push_back void solve() { int n; cin>>n; pii a[n]; for(int i=0;i<n;i++)cin>>a[i].sc>>a[i].fs; sort(a,a+n); reverse(a,a+n); bool vis[n]; memset(vis,0,sizeof(vis)); int ans=0; for(int i=0;i<n;i++)if(!vis[i]){ ans++; for(int j=i;j<n;j++){ if(a[i].fs-a[j].fs>=abs(a[i].sc-a[j].sc)){ vis[j]=1; } } } cout<<ans<<'\n'; } int main() { #ifdef FPO freopen("in","r",stdin); freopen("out","w",stdout); #endif ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); 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...