Submission #14596

# Submission time Handle Problem Language Result Execution time Memory
14596 2015-05-21T03:40:44 Z ics0503 Be Two Bees (OJUZ10_b2b) C++
0 / 100
1000 ms 2256 KB
#include <stdio.h>
#define MAX 100001
int h[MAX];
int t[MAX];
int p[MAX];

int main()
{
	int n;
	scanf("%d", &n);

	long long int sum_h = 0;
	int i, j;
	for (i = 1; i <= n; i++)
	{
		scanf("%d", &h[i]);
		sum_h += h[i];
	}
	for (i = 1; i <= n; i++)
		scanf("%d", &t[i]);
	double m;
	long long int sum;
	double sec;
	double min = 1000000000;
	int a_b, b_b;
	for (i = 1; i <= n; i++)
	{
		for (j = i + 1; j <= n; j++)
		{
			sum = sum_h;
			sum -= (h[i] + h[j]);
			m = t[i] + t[j];
			m /= t[i] * t[j];
			sec = sum / m;
			if (sec < min)
			{
				min = sec;
				a_b = i;
				b_b = j;
			}
		}
	}
	printf("%d %d", a_b, b_b);
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2256 KB Output isn't correct
2 Correct 0 ms 2256 KB Output is correct
3 Correct 0 ms 2256 KB Output is correct
4 Correct 0 ms 2256 KB Output is correct
5 Correct 0 ms 2256 KB Output is correct
6 Correct 0 ms 2256 KB Output is correct
7 Correct 0 ms 2256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 2256 KB Output isn't correct
2 Correct 0 ms 2256 KB Output is correct
3 Correct 10 ms 2256 KB Output is correct
4 Incorrect 11 ms 2256 KB Output isn't correct
5 Incorrect 11 ms 2256 KB Output isn't correct
6 Incorrect 1 ms 2256 KB Output isn't correct
7 Incorrect 7 ms 2256 KB Output isn't correct
8 Incorrect 3 ms 2256 KB Output isn't correct
9 Correct 11 ms 2256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 2252 KB Program timed out
2 Execution timed out 1000 ms 2252 KB Program timed out
3 Execution timed out 1000 ms 2252 KB Program timed out
4 Execution timed out 1000 ms 2252 KB Program timed out
5 Execution timed out 1000 ms 2252 KB Program timed out
6 Execution timed out 1000 ms 2252 KB Program timed out
7 Execution timed out 1000 ms 2252 KB Program timed out
8 Execution timed out 1000 ms 2252 KB Program timed out
9 Execution timed out 1000 ms 2252 KB Program timed out
10 Execution timed out 1000 ms 2252 KB Program timed out
11 Execution timed out 1000 ms 2252 KB Program timed out
12 Execution timed out 1000 ms 2252 KB Program timed out
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 2252 KB Program timed out
2 Execution timed out 1000 ms 2252 KB Program timed out
3 Execution timed out 1000 ms 2252 KB Program timed out
4 Execution timed out 1000 ms 2252 KB Program timed out
5 Execution timed out 1000 ms 2252 KB Program timed out
6 Execution timed out 1000 ms 2252 KB Program timed out
7 Execution timed out 1000 ms 2252 KB Program timed out
8 Execution timed out 1000 ms 2252 KB Program timed out
9 Execution timed out 1000 ms 2252 KB Program timed out
10 Execution timed out 1000 ms 2252 KB Program timed out
11 Execution timed out 1000 ms 2252 KB Program timed out
12 Execution timed out 1000 ms 2252 KB Program timed out
13 Execution timed out 1000 ms 2252 KB Program timed out
14 Execution timed out 1000 ms 2252 KB Program timed out
15 Execution timed out 1000 ms 2252 KB Program timed out
16 Execution timed out 1000 ms 2252 KB Program timed out
17 Execution timed out 1000 ms 2252 KB Program timed out