제출 #14210

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
142102015-05-05 06:10:56khsoo01Be Two Bees (OJUZ10_b2b)C++98
11 / 100
1000 ms2744 KiB
#include<cstdio>
#include<algorithm>
using namespace std;
long long n,mh,cnt,s,a1,a2;
double mn=1000000000005,t;
bool dom[100005];
struct Data{
long long h,t;
bool operator ()(Data q,Data w){
if(q.t<w.t)return true;
if(q.t==w.t && q.h>w.h)return true;
return false;
}
}r[100005];
int main()
{
int i,j;
scanf("%d",&n);
for(i=0;i<n;s+=r[i++].h)
scanf("%d",&r[i].h);
for(i=0;i<n;i++)
scanf("%d",&r[i].t);
for(i=0;i<n;i++){
for(j=i+1;j<n;j++) {
t=(double)(s-r[i].h-r[j].h)/((double)1/r[i].t+(double)1/r[j].t);
if(t<mn){
mn=t;
a1=i+1;
a2=j+1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...