Submission #14146

#TimeUsernameProblemLanguageResultExecution timeMemory
14146juchan1220Be Two Bees (OJUZ10_b2b)C++98
0 / 100
1000 ms1864 KiB
#include <stdio.h> #include <algorithm> using namespace std; struct emp { int n,t; }d[100001]; int n; int main (void) { int i,j,a,b,num,mxt=0,totn=0,tott=0,temp,temp2; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&d[i].n); totn+=d[i].n; } for(i=0;i<n;i++){ scanf("%d",&d[i].t); tott+=d[i].t; } a=0; b=1; num=totn-(d[0].n+d[1].n); mxt=d[0].t+d[1].t; for(i=0;i<n;i++){ for(j=i+1;j<n;j++){ temp=totn-(d[i].n+d[j].n); temp2=d[i].t+d[j].t; if(mxt*temp>num*temp2){ a=i+1; b=j+1; num=temp; mxt=temp2; } } //printf("%d %d %d %d\n",a,b,num,mxt); } printf("%d %d\n",a,b); 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...