結果

問題 No.712 赤旗
ユーザー a1k2y7m2a1k2y7m2
提出日時 2018-07-29 13:15:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 4,493 ms
コンパイル使用メモリ 72,732 KB
実行使用メモリ 56,112 KB
最終ジャッジ日時 2023-09-23 02:49:50
合計ジャッジ時間 5,803 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
56,092 KB
testcase_01 AC 128 ms
56,112 KB
testcase_02 AC 127 ms
55,596 KB
testcase_03 AC 129 ms
55,688 KB
testcase_04 AC 134 ms
55,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class redflag{
	private static int Count (String[] A){
		int count = 0;
		for (int i=0; i<A.length; i++){
			for (int j=0; j<A[i].length(); j++){
				if (A[i].charAt(j) == 'W'){count+=1;}
			}
		}

		return count;
	}

	public static void main(String[] args){
		//Read input
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		String A[] = new String[N];

		for(int i=0; i<N; i++){
			A[i] = sc.next();
		}

		System.out.println(Count(A));
	}
}
0