49252023-04-07 12:55:26zolmikiAranycipők (45)javaAccepted 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);
            }
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/086ms45876 KiB
2Accepted0/093ms48868 KiB
3Accepted3/382ms46992 KiB
4Accepted3/382ms47556 KiB
5Accepted3/382ms47352 KiB
6Accepted3/383ms48064 KiB
7Accepted3/382ms48180 KiB
8Accepted3/385ms48560 KiB
9Accepted3/382ms48664 KiB
10Accepted3/3123ms53560 KiB
11Accepted3/398ms51648 KiB
12Accepted3/390ms50396 KiB
13Accepted3/3109ms53732 KiB
14Accepted3/3115ms54448 KiB
15Accepted3/3123ms54736 KiB
16Accepted3/3101ms52696 KiB
17Accepted3/3116ms55780 KiB