Submission #4504

#TimeUsernameProblemLanguageResultExecution timeMemory
4504ansol1111사냥꾼 (KOI13_hunter)C++98
70 / 100
1000 ms3820 KiB
#include<stdio.h> int i, j, n, m, l, gun[100005], animal[100005][5], cnt[100005], a; int input() { int i; scanf("%d %d %d",&n,&m,&l); for(i=1 ; i<=n ; i++) { scanf("%d",&gun[i]); } for(i=1 ; i<=m ; i++) { scanf("%d %d",&animal[i][1],&animal[i][2]); } return 0; } int process() { int i, j, temp; for(i=1 ; i<=n ; i++) { for(j=1 ; j<=m ; j++) { if(cnt[j]==0) { temp=gun[i]-animal[j][1]; if(temp>=0) { temp+=animal[j][2]; } else { temp=temp*(-1); temp+=animal[j][2]; } if(temp<=l) { cnt[j]=1; a++; } if(a==m) { break; } } } if(j!=m+1) { break; } } return 0; } int output() { printf("%d\n",a); return 0; } int main() { input(); process(); output(); return 0; }
#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...