슈콩

[SWEA] 동철이의 프로그래밍 대회 본문

Algorithms/SWEA

[SWEA] 동철이의 프로그래밍 대회

shukong 2025. 11. 18. 22:04

 

 

[문제]

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWjlFcGK3dMDFAVT

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

 

 

[소스 코드]

import java.io.*;
import java.util.*;
public class Solution {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;
		int T = Integer.parseInt(br.readLine());
		for(int tc=1;tc<=T;tc++) {
			st = new StringTokenizer(br.readLine());
			int n = Integer.parseInt(st.nextToken());
			int m = Integer.parseInt(st.nextToken());
			int[] score = new int[n];
			int max = 0;
			for(int i=0;i<n;i++) {
				st = new StringTokenizer(br.readLine());
				for(int j=0;j<m;j++) {
					score[i] += Integer.parseInt(st.nextToken());
				}
				max = Math.max(max, score[i]);
			}
			int result = 0;
			for(int i=0;i<n;i++) {
				if(score[i]==max) result++;
			}
			System.out.println("#"+tc+" "+result+" "+max);
		}
	}
}

'Algorithms > SWEA' 카테고리의 다른 글

[SWEA] 보충학습과 평균  (0) 2025.11.19
[SWEA] Digit sum  (0) 2025.11.18
[SWEA] 두가지 빵의 딜레마  (0) 2025.11.18
[SWEA] 일요일  (0) 2025.11.18
[SWEA] 몬스터 사냥  (0) 2025.11.18