-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPungi de monede.java
More file actions
31 lines (31 loc) · 895 Bytes
/
Pungi de monede.java
File metadata and controls
31 lines (31 loc) · 895 Bytes
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
import java.util.*;
public class ECCPR{
public static void main(String []args){
double n,m,nr,suma=0,cnt=0,y=0;
Set<Double>s=new HashSet<Double>();
Scanner sc= new Scanner(System.in);
n=sc.nextInt();
for(int i=0;i<n;i++){
m=sc.nextInt();
for(int j=0;j<m;j++){
nr=sc.nextInt();
s.add(nr);
suma+=nr;
if(nr>=100){
cnt++;
}
}
if((cnt<(m-cnt))&&(suma<2900)&&(s.size()==6)&&(m>=8)&&(m<=20)){
System.out.print(1+" ");
}else {
System.out.print(0+" ");
y++;
}
cnt=0;
suma=0;
s.clear();
}
System.out.println();
System.out.printf("%.2f",(y/n));
}
}