답안 #14211

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14211 2015-05-05T06:18:47 Z khsoo01 Be Two Bees (OJUZ10_b2b) C++
33 / 100
1000 ms 2744 KB
#include<cstdio>
#include<algorithm>
using namespace std;
long long n,mh,cnt,s,a1,a2;
double mn=1000000000000000000000000000005,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;
            }
        }
    }
    printf("%lld %lld",a1,a2);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2744 KB Output is correct
2 Correct 0 ms 2744 KB Output is correct
3 Correct 0 ms 2744 KB Output is correct
4 Correct 0 ms 2744 KB Output is correct
5 Correct 0 ms 2744 KB Output is correct
6 Correct 0 ms 2744 KB Output is correct
7 Correct 0 ms 2744 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 2744 KB Output is correct
2 Correct 11 ms 2744 KB Output is correct
3 Correct 11 ms 2744 KB Output is correct
4 Correct 0 ms 2744 KB Output is correct
5 Correct 11 ms 2744 KB Output is correct
6 Correct 0 ms 2744 KB Output is correct
7 Correct 11 ms 2744 KB Output is correct
8 Correct 3 ms 2744 KB Output is correct
9 Correct 10 ms 2744 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2740 KB Program timed out
2 Execution timed out 1000 ms 2740 KB Program timed out
3 Execution timed out 1000 ms 2740 KB Program timed out
4 Execution timed out 1000 ms 2740 KB Program timed out
5 Execution timed out 1000 ms 2740 KB Program timed out
6 Execution timed out 1000 ms 2740 KB Program timed out
7 Execution timed out 1000 ms 2740 KB Program timed out
8 Execution timed out 1000 ms 2740 KB Program timed out
9 Execution timed out 1000 ms 2740 KB Program timed out
10 Execution timed out 1000 ms 2740 KB Program timed out
11 Execution timed out 1000 ms 2740 KB Program timed out
12 Execution timed out 1000 ms 2740 KB Program timed out
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2740 KB Program timed out
2 Execution timed out 1000 ms 2740 KB Program timed out
3 Execution timed out 1000 ms 2740 KB Program timed out
4 Execution timed out 1000 ms 2740 KB Program timed out
5 Execution timed out 1000 ms 2740 KB Program timed out
6 Execution timed out 1000 ms 2740 KB Program timed out
7 Execution timed out 1000 ms 2740 KB Program timed out
8 Execution timed out 1000 ms 2740 KB Program timed out
9 Execution timed out 1000 ms 2740 KB Program timed out
10 Execution timed out 1000 ms 2740 KB Program timed out
11 Execution timed out 1000 ms 2740 KB Program timed out
12 Execution timed out 1000 ms 2740 KB Program timed out
13 Execution timed out 1000 ms 2740 KB Program timed out
14 Execution timed out 1000 ms 2740 KB Program timed out
15 Execution timed out 1000 ms 2740 KB Program timed out
16 Execution timed out 1000 ms 2740 KB Program timed out
17 Execution timed out 1000 ms 2740 KB Program timed out