結果

問題 No.1908 Assault for Keys
ユーザー 37zigen37zigen
提出日時 2022-04-22 21:08:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 350 ms / 2,000 ms
コード長 807 bytes
コンパイル時間 2,466 ms
コンパイル使用メモリ 73,992 KB
実行使用メモリ 61,548 KB
最終ジャッジ日時 2023-09-06 07:22:29
合計ジャッジ時間 10,239 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,832 KB
testcase_01 AC 128 ms
55,700 KB
testcase_02 AC 337 ms
60,912 KB
testcase_03 AC 339 ms
60,944 KB
testcase_04 AC 336 ms
60,624 KB
testcase_05 AC 350 ms
60,816 KB
testcase_06 AC 339 ms
61,468 KB
testcase_07 AC 330 ms
61,548 KB
testcase_08 AC 340 ms
61,272 KB
testcase_09 AC 339 ms
60,940 KB
testcase_10 AC 336 ms
61,464 KB
testcase_11 AC 345 ms
59,248 KB
testcase_12 AC 340 ms
60,888 KB
testcase_13 AC 339 ms
61,328 KB
testcase_14 AC 342 ms
60,568 KB
testcase_15 AC 337 ms
61,380 KB
testcase_16 AC 132 ms
55,736 KB
testcase_17 AC 193 ms
56,820 KB
testcase_18 AC 349 ms
61,504 KB
testcase_19 AC 333 ms
60,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main implements Runnable { //Runnableを実装する
    public static void main(String[] args) {
        new Thread(null, new Main(), "", 16 * 1024 * 1024).start(); //16MBスタックを確保して実行
    }
	
	public void run() {
		Scanner sc=new Scanner(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		int N=sc.nextInt();
		int M=sc.nextInt();
		int[] cnt=new int[M];
		for (int i=0;i<N;++i) {
			char[] cs=sc.next().toCharArray();
			for (int j=0;j<cs.length;++j) {
				if (cs[j]=='x') ++cnt[j];
			}
		}
		int ans=Arrays.stream(cnt).max().getAsInt()+1;
		pw.println(ans);
		pw.close();
		
	}	
	
	void tr(Object ... o) {System.out.println(Arrays.deepToString(o));}
}
0