49252023-04-07 12:55:26zolmikiAranycipők (45)javaElfogadva 45/45123ms55780 KiB
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class main{
    public static void main(String[] args) throws Exception{

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        int[] goals = new int[N];
        for(int i = 0; i < N; i++){
            goals[i] = Integer.parseInt(br.readLine());
        }

        int maxGoal = -1;
        for(int i = 0; i < N; i++){
            if(goals[i] >= maxGoal){
                maxGoal = goals[i];
            }
        }
        System.out.println(maxGoal);

        int count = 0;
        for(int i = 0; i < N; i++){
            if(goals[i] == maxGoal){
                count++;
            }
        }
        System.out.println(count);

        for(int i = 0; i < N; i++){
            if(goals[i] == maxGoal){
                System.out.println(i + 1);
            }
        }
    }
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base45/45
1Elfogadva0/086ms45876 KiB
2Elfogadva0/093ms48868 KiB
3Elfogadva3/382ms46992 KiB
4Elfogadva3/382ms47556 KiB
5Elfogadva3/382ms47352 KiB
6Elfogadva3/383ms48064 KiB
7Elfogadva3/382ms48180 KiB
8Elfogadva3/385ms48560 KiB
9Elfogadva3/382ms48664 KiB
10Elfogadva3/3123ms53560 KiB
11Elfogadva3/398ms51648 KiB
12Elfogadva3/390ms50396 KiB
13Elfogadva3/3109ms53732 KiB
14Elfogadva3/3115ms54448 KiB
15Elfogadva3/3123ms54736 KiB
16Elfogadva3/3101ms52696 KiB
17Elfogadva3/3116ms55780 KiB