結果

問題 No.239 にゃんぱすー
ユーザー jimanojimano
提出日時 2018-01-20 18:05:51
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 754 bytes
コンパイル時間 3,283 ms
コンパイル使用メモリ 72,536 KB
実行使用メモリ 52,020 KB
最終ジャッジ日時 2023-08-26 09:12:29
合計ジャッジ時間 6,121 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
49,512 KB
testcase_01 AC 39 ms
49,328 KB
testcase_02 AC 42 ms
49,452 KB
testcase_03 WA -
testcase_04 AC 41 ms
49,332 KB
testcase_05 WA -
testcase_06 AC 40 ms
49,384 KB
testcase_07 AC 40 ms
49,344 KB
testcase_08 AC 41 ms
49,276 KB
testcase_09 WA -
testcase_10 AC 41 ms
49,308 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 48 ms
49,612 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 65 ms
50,464 KB
testcase_21 WA -
testcase_22 AC 75 ms
51,476 KB
testcase_23 AC 71 ms
51,396 KB
testcase_24 AC 85 ms
51,880 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 41 ms
49,480 KB
testcase_28 AC 42 ms
49,152 KB
testcase_29 WA -
testcase_30 AC 49 ms
50,464 KB
testcase_31 AC 54 ms
50,300 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 67 ms
49,576 KB
testcase_35 WA -
testcase_36 AC 76 ms
52,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class No0239 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			int N = Integer.parseInt(br.readLine());
			int[] greet = new int[N];
			int ans = -1;
			int cnt = 0;

			for (int i = 0; i < N; i++) {
				String[] str = br.readLine().split(" ");
				for (int j = 0; j < N; j++) {
					if (str[j].equals("nyanpass")) {
						greet[j]++;
					}
				}
			}

			for (int g : greet) {
				if (g == N - 1) {
					ans = g + 1;
					cnt++;
				}
			}
			System.out.println(cnt == 1 ? ans : -1);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0