답안 #14616

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14616 2015-05-21T17:12:15 Z caphile98 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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2256 KB Output is 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 Incorrect 0 ms 2256 KB Output isn't correct
6 Correct 0 ms 2256 KB Output is correct
7 Correct 0 ms 2256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 11 ms 2256 KB Output isn't correct
2 Incorrect 1 ms 2256 KB Output isn't correct
3 Incorrect 3 ms 2256 KB Output isn't correct
4 Correct 11 ms 2256 KB Output is correct
5 Incorrect 11 ms 2256 KB Output isn't correct
6 Correct 10 ms 2256 KB Output is correct
7 Incorrect 11 ms 2256 KB Output isn't correct
8 Incorrect 11 ms 2256 KB Output isn't correct
9 Correct 0 ms 2256 KB Output is correct
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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