Submission #14147

#TimeUsernameProblemLanguageResultExecution timeMemory
14147minchurlBe Two Bees (OJUZ10_b2b)C++98
11 / 100
1000 ms1864 KiB
#include<stdio.h> #define oo 0x7fffffff int h[100005],n,dapx,dapy,t[100005]; double dap; FILE *in; int main(){ int i,j,sum=0; double x,y; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&h[i]); sum+=h[i]; } dap=oo; for(i=0;i<n;i++) scanf("%d",&t[i]); for(i=0;i<n;i++){ for(j=i+1;j<n;j++){ x=sum-h[i]-h[j]; y=1/((double)t[i])+1/((double)t[j]); x=x/y; if(x<dap){ dap=x; dapx=i+1; dapy=j+1; } } } printf("%d %d\n",dapx,dapy); 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...