| Task: | Arvonta |
| Sender: | TapaniS |
| Submission time: | 2025-09-06 12:50:50 +0300 |
| Language: | Java |
| Status: | READY |
| Result: | 100 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 37 |
| #2 | ACCEPTED | 63 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.14 s | 1, 2 | details |
| #2 | ACCEPTED | 0.42 s | 2 | details |
Compiler report
Note: input/arvonta.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.
Code
import java.util.*;
import java.math.BigDecimal;
import java.math.MathContext;
public class arvonta {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int t = Integer.parseInt(input.nextLine());
double[] ans = new double[t];
for (int i = 0; i < t; i++) {
int a = input.nextInt();
int exponent = a;
BigDecimal c1 = new BigDecimal(a-1);
BigDecimal d1 = new BigDecimal(a);
BigDecimal base = c1.divide(d1, 30, BigDecimal.ROUND_HALF_UP);
BigDecimal result = base.pow(exponent, MathContext.DECIMAL128);
ans[i] = 1.0 - result.doubleValue();
}
input.close();
for (int i3 = 0; i3 < t; i3++) {
System.out.println(ans[i3]);
}
}
}Test details
Test 1
Group: 1, 2
Verdict: ACCEPTED
| input |
|---|
| 10 1 2 3 4 ... |
| correct output |
|---|
| 1.0 0.75 0.7037037037 0.68359375 0.67232 ... |
| user output |
|---|
| 1.0 0.75 0.7037037037037037 0.68359375 0.67232 ... Truncated |
Test 2
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 1000 1 2 3 4 ... |
| correct output |
|---|
| 1.0 0.75 0.7037037037 0.68359375 0.67232 ... |
| user output |
|---|
| 1.0 0.75 0.7037037037037037 0.68359375 0.67232 ... Truncated |
