Submission #48508

#TimeUsernameProblemLanguageResultExecution timeMemory
48508leehosu01사냥꾼 (KOI13_hunter)C++17
100 / 100
77 ms25624 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll N,M,L,cnt; ll Sh[100002]; bool pro() { ll x,y; cin>>x>>y; ll x1,x2; x1=*(lower_bound(Sh,Sh+N+1,x)-1); x2=*lower_bound(Sh,Sh+N+1,x); // printf("list:: %lld %lld ",x1,x2); if(abs(x1-x)+y>L&&abs(x2-x)+y>L) return 0;//(printf("unable\n"),0); //printf("able\n"); return 1; } int main() { ios::sync_with_stdio(0); cin.tie(0); cin>>N>>M>>L; for(int i=1;i<=N;i++)cin>>Sh[i]; sort(Sh+1,Sh+N+1); Sh[N+1]=1ll<<48; Sh[0]=-(1ll<<48); for(int i=0;i<M;i++)cnt+=pro(); printf("%lld",cnt); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...