#include<stdio.h>
int n;
long long int a[1009];
long long int b[1009];
long long int x;
int main()
{
scanf("%d",&n);
if(n>1000)printf("2 7\n");
int i, j, k;
for(i=0;i<n;i++)
{
scanf("%lld",&a[i]);
x += a[i];
}
for(i=0;i<n;i++)
scanf("%lld",&b[i]);
long long int p,q;
int mi,mj;
mi=mj=-1;
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
{
if(mi==-1)
{
p = (x-a[i]-a[j])*b[i]*b[j];
q = b[i]+b[j];
mi = i;
mj = j;
}
else
{
if(p *(b[i]+b[j]) > q*(x-a[i]-a[j])*b[i]*b[j] )
{
p = (x-a[i]-a[j])*b[i]*b[j];
q = (b[i]+b[j]);
mi = i;mj = j;
}
}
}
printf("%d %d\n",mi+1,mj+1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1100 KB |
Output is correct |
2 |
Correct |
0 ms |
1100 KB |
Output is correct |
3 |
Correct |
0 ms |
1100 KB |
Output is correct |
4 |
Incorrect |
0 ms |
1100 KB |
Output isn't correct |
5 |
Correct |
0 ms |
1100 KB |
Output is correct |
6 |
Correct |
0 ms |
1100 KB |
Output is correct |
7 |
Correct |
0 ms |
1100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1100 KB |
Output is correct |
2 |
Incorrect |
6 ms |
1100 KB |
Output isn't correct |
3 |
Correct |
0 ms |
1100 KB |
Output is correct |
4 |
Incorrect |
0 ms |
1100 KB |
Output isn't correct |
5 |
Incorrect |
6 ms |
1100 KB |
Output isn't correct |
6 |
Correct |
0 ms |
1100 KB |
Output is correct |
7 |
Incorrect |
6 ms |
1100 KB |
Output isn't correct |
8 |
Correct |
2 ms |
1100 KB |
Output is correct |
9 |
Correct |
0 ms |
1100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
2 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
3 |
Incorrect |
0 ms |
1100 KB |
Output isn't correct |
4 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
5 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
6 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
7 |
Incorrect |
0 ms |
1100 KB |
Output isn't correct |
8 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
9 |
Incorrect |
0 ms |
1100 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
1100 KB |
Output isn't correct |
11 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
12 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
2 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
3 |
Incorrect |
0 ms |
1100 KB |
Output isn't correct |
4 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
5 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
6 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
7 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
8 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
9 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
10 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
11 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
12 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
13 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
14 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
15 |
Runtime error |
0 ms |
1100 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
16 |
Incorrect |
0 ms |
1100 KB |
Output isn't correct |
17 |
Incorrect |
0 ms |
1100 KB |
Output isn't correct |