This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
#include<algorithm>
typedef std::pair<double,int> pp;
#define ll long long
ll p,h[100010],t[100010];
pp s[100010];
int n;
int main(){
scanf("%d",&n);
for(int i=0;i<n;i++)scanf("%lld",&h[i]),p+=h[i];
for(int i=0;i<n;i++)scanf("%lld",&t[i]);
for(int i=0;i<n;i++)s[i]=pp((double)(p-h[i])/(double)t[i],i);
sort(s,s+n);
printf("%d %d\n",s[0].second,s[1].second);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |