結果

問題 No.712 赤旗
ユーザー yukiyuki
提出日時 2020-08-20 16:12:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 591 bytes
コンパイル時間 2,232 ms
コンパイル使用メモリ 74,900 KB
実行使用メモリ 41,300 KB
最終ジャッジ日時 2024-04-21 13:52:21
合計ジャッジ時間 3,378 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,192 KB
testcase_01 AC 116 ms
40,120 KB
testcase_02 AC 129 ms
41,160 KB
testcase_03 AC 128 ms
41,140 KB
testcase_04 AC 135 ms
41,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

// yukicoder No.712 赤旗
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        final int total = N * M;
        int count = 0;

        for(int i=0; i<N; i++){
            String L = in.next();
            char[] arr = L.toCharArray();
            
            for(char c : arr){
                if(c == 'W') {
                    count++;
                }
            }

        }
        System.out.println(count);

    }
}
0