4920 | 2023-04-07 12:24:45 | zolmiki | Negáló rendezés (55 pont) | java | Forditási hiba |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Hashtable;
public class feladat {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
int[] numbers = new int[N];
String [] readed = br.readLine().split(" ");
for(int i = 0; i < N; i++){
numbers[i] = Integer.parseInt(readed[i]);
}
Hashtable<Integer, Integer> agenda = new Hashtable<Integer, Integer>();
for(int n : numbers){
if(agenda.containsKey(n)){
agenda.put(n, agenda.get(n) + 1);
} else {
agenda.put(n, 1);
}
}
int minimum = Integer.MAX_VALUE;
for(int i : agenda.keySet()){
if(minimum > i){
minimum = i;
}
}
agenda.remove(minimum);
int modulo = (int)Math.pow(10, 9) + 7;
long result = 1;
for(int i : agenda.keySet()){
result = ( result * (agenda.get(i) + 1)) % modulo;
}
System.out.println(result);
}
}
exit status 1
main.java:5: error: class feladat is public, should be declared in a file named feladat.java
public class feladat {
^
1 error
Exited with error status 1