Submission #14616

#TimeUsernameProblemLanguageResultExecution timeMemory
14616caphile98Be Two Bees (OJUZ10_b2b)C++98
0 / 100
1000 ms2256 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...