SWEA_6958) 동철이의 프로그래밍 대회

6958, 6913) 동철이의 프로그래밍 대회 (19.10.15)


문제 링크 (SW Expert Academy)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        StringTokenizer tk;
        
        int test = Integer.parseInt(br.readLine());
        
        for(int i=1;i<=test;i++) {
            tk = new StringTokenizer(br.readLine());
            
            int n = Integer.parseInt(tk.nextToken());
            int m = Integer.parseInt(tk.nextToken());
            
            int[][] map = new int[n][m];
            int[] score = new int[n];
            int max = 0;
            for(int a=0;a<n;a++) {
                tk = new StringTokenizer(br.readLine());
                int sum = 0;
                for(int b=0;b<m;b++) {
                    map[a][b] = Integer.parseInt(tk.nextToken());
                    sum = sum + map[a][b];
                }
                score[a] = sum;
                if(max<sum) max = sum;
            }

            int cnt = 0;
            for(int j: score) {
                if(j==max) cnt = cnt+1;
            }
            
            bw.write("#" + i + " " + cnt + " " + max + "\n");
        }
        
        bw.flush();
        bw.close();
    }
}
cs



* 6913문제와 동일.

댓글

이 블로그의 인기 게시물