Submission #14146

# Submission time Handle Problem Language Result Execution time Memory
14146 2015-05-02T08:40:06 Z juchan1220 Be Two Bees (OJUZ10_b2b) C++
0 / 100
1000 ms 1864 KB
#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 time Memory Grader output
1 Incorrect 0 ms 1864 KB Output isn't correct
2 Incorrect 0 ms 1864 KB Output isn't correct
3 Incorrect 0 ms 1864 KB Output isn't correct
4 Correct 0 ms 1864 KB Output is correct
5 Incorrect 0 ms 1864 KB Output isn't correct
6 Correct 0 ms 1864 KB Output is correct
7 Incorrect 0 ms 1864 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1864 KB Output isn't correct
2 Incorrect 3 ms 1864 KB Output isn't correct
3 Incorrect 3 ms 1864 KB Output isn't correct
4 Incorrect 0 ms 1864 KB Output isn't correct
5 Incorrect 0 ms 1864 KB Output isn't correct
6 Incorrect 0 ms 1864 KB Output isn't correct
7 Incorrect 3 ms 1864 KB Output isn't correct
8 Incorrect 0 ms 1864 KB Output isn't correct
9 Incorrect 3 ms 1864 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 1860 KB Program timed out
2 Execution timed out 1000 ms 1860 KB Program timed out
3 Execution timed out 1000 ms 1860 KB Program timed out
4 Execution timed out 1000 ms 1860 KB Program timed out
5 Execution timed out 1000 ms 1860 KB Program timed out
6 Execution timed out 1000 ms 1860 KB Program timed out
7 Execution timed out 1000 ms 1860 KB Program timed out
8 Execution timed out 1000 ms 1860 KB Program timed out
9 Execution timed out 1000 ms 1860 KB Program timed out
10 Execution timed out 1000 ms 1860 KB Program timed out
11 Execution timed out 1000 ms 1860 KB Program timed out
12 Execution timed out 1000 ms 1860 KB Program timed out
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 1860 KB Program timed out
2 Execution timed out 1000 ms 1860 KB Program timed out
3 Execution timed out 1000 ms 1860 KB Program timed out
4 Execution timed out 1000 ms 1860 KB Program timed out
5 Execution timed out 1000 ms 1860 KB Program timed out
6 Execution timed out 1000 ms 1860 KB Program timed out
7 Execution timed out 1000 ms 1860 KB Program timed out
8 Execution timed out 1000 ms 1860 KB Program timed out
9 Execution timed out 1000 ms 1860 KB Program timed out
10 Execution timed out 1000 ms 1860 KB Program timed out
11 Execution timed out 1000 ms 1860 KB Program timed out
12 Execution timed out 1000 ms 1860 KB Program timed out
13 Execution timed out 1000 ms 1860 KB Program timed out
14 Execution timed out 1000 ms 1860 KB Program timed out
15 Execution timed out 1000 ms 1860 KB Program timed out
16 Execution timed out 1000 ms 1860 KB Program timed out
17 Execution timed out 1000 ms 1860 KB Program timed out