結果

問題 No.712 赤旗
ユーザー GrenacheGrenache
提出日時 2018-09-16 17:45:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 895 bytes
コンパイル時間 3,869 ms
コンパイル使用メモリ 72,684 KB
実行使用メモリ 55,928 KB
最終ジャッジ日時 2023-09-25 09:03:24
合計ジャッジ時間 5,581 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
55,676 KB
testcase_01 AC 134 ms
55,484 KB
testcase_02 AC 134 ms
55,836 KB
testcase_03 AC 140 ms
55,708 KB
testcase_04 AC 142 ms
55,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder712 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		
		char[][] a = new char[n][];
		for (int i = 0; i < n; i++) {
			a[i] = sc.next().toCharArray();
		}

		int ans = 0;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (a[i][j] == 'W') {
					ans++;
				}
			}
		}
		
		pr.println(ans);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
0