백준 2566

김경욱·2025년 8월 1일

백준

목록 보기
11/121

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);

    int[][] array = new int[9][9];




    for (int i = 0; i < 9; i++) {
        for (int j=0; j < 9; j++)
        {
            int value = in.nextInt();
            array[i][j] = value;
    }
    }
    int max=0;

    int row=0;
    int column=0;

    for (int i=0; i<9; i++)
    {
        for (int j=0; j < 9; j++) {
            if (array[i][j] > max)
            {
                max = array[i][j];
                row=i;
                column=j;
            }
        }
    }
 

    row ++;
    column++;
    System.out.println(max);
    System.out.println(row+" "+column);








}

}
근래에 푼 문제중에 제일 쉬운 문제였다. 조건이 최댓값이 같은 것이 나왔을 때는 그 둘중에 하나의 위치만 나와도 된다고 하여 문제의 난이도가 상당히 낮아진 것 같다. 오랜만에 자신감을 얻은 것 같다.

0개의 댓글