-
Notifications
You must be signed in to change notification settings - Fork 7
/
Main.java
47 lines (39 loc) · 841 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package basicLevel1053;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
double e = in.nextDouble();
int d = in.nextInt();
int mustEmpty = 0;
int maybeEmpty = 0;
for (int i = 0; i < n; i++) {
int k = in.nextInt();
int cnt = 0;
if (k > d) {
for (int j = 0; j < k; j++) {
double temp = in.nextDouble();
if (temp < e) {
cnt++;
}
}
if (cnt > k / 2) {
mustEmpty++;
}
} else {
for (int j = 0; j < k; j++) {
double temp = in.nextDouble();
if (temp < e) {
cnt++;
}
}
if (cnt > k / 2) {
maybeEmpty++;
}
}
}
in.close();
System.out.printf("%.1f%% %.1f%%", maybeEmpty * 1.0 / n * 100, mustEmpty * 1.0 / n * 100);
}
}