# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1066681 |
2024-08-20T04:52:39 Z |
Oz121 |
Balloons (CEOI11_bal) |
Java 11 |
|
1728 ms |
56376 KB |
import java.io.*;
import java.util.*;
public class bal {
public static void main(String[] args) throws IOException {
BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer l1 = new StringTokenizer(scan.readLine()); int num = Integer.parseInt(l1.nextToken()); double[][] arr = new double[num][2];
for (int i = 0;i<num;i++) {
StringTokenizer st = new StringTokenizer(scan.readLine());
arr[i][0] = Integer.parseInt(st.nextToken());
arr[i][1] = Integer.parseInt(st.nextToken());
}
Stack<Integer> idx = new Stack<>(); double[] ans = new double[num];
for (int i = 0;i<num;i++) {
while (!idx.isEmpty()) {
int j = idx.peek();
double maxR = Math.pow(arr[i][0]-arr[j][0],2)/(4*arr[j][1]);
if (maxR>arr[i][1]) {
if (arr[i][1]<=arr[j][1]) {
idx.add(i); ans[i] = arr[i][1];
break;
}
else idx.pop();
} else { //maxR<=arr[i][1]
if (maxR<=arr[j][1]) {
idx.add(i); ans[i] = maxR;
break;
}
else idx.pop();
}
}
if (idx.isEmpty()) ans[i] = arr[i][1];
idx.add(i);
}
for (double i : ans) System.out.println(i+" ");
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
69 ms |
10052 KB |
5th numbers differ - expected: '17.1630000000', found: '4.3706896552', error = '12.7923103448' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
69 ms |
10124 KB |
2nd numbers differ - expected: '252735385.4379999936', found: '1000000000.0000000000', error = '747264614.5620000362' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
107 ms |
10576 KB |
3rd numbers differ - expected: '0.0420000000', found: '2.0833333333', error = '2.0413333333' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
320 ms |
19500 KB |
3rd numbers differ - expected: '121.0000000000', found: '120.0182926829', error = '0.9817073171' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
713 ms |
20628 KB |
3rd numbers differ - expected: '211.0000000000', found: '210.0105633803', error = '0.9894366197' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1004 ms |
36048 KB |
3rd numbers differ - expected: '15396.0000000000', found: '9489.3934618156', error = '5906.6065381844' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1446 ms |
41356 KB |
3rd numbers differ - expected: '7936.0000000000', found: '6084.6244445518', error = '1851.3755554482' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1545 ms |
44068 KB |
6th numbers differ - expected: '5053.0000000000', found: '5052.0004451039', error = '0.9995548961' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1270 ms |
39596 KB |
3rd numbers differ - expected: '1872.0000000000', found: '1871.0012006403', error = '0.9987993597' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1728 ms |
56376 KB |
3rd numbers differ - expected: '2960.0000000000', found: '2959.0007596219', error = '0.9992403781' |
2 |
Halted |
0 ms |
0 KB |
- |