結果

問題 No.712 赤旗
ユーザー a1k2y7m2
提出日時 2018-07-29 13:15:20
言語 Java
(openjdk 23)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 4,214 ms
コンパイル使用メモリ 74,816 KB
実行使用メモリ 54,176 KB
最終ジャッジ日時 2024-07-16 03:10:48
合計ジャッジ時間 4,459 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

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