結果

問題 No.239 にゃんぱすー
ユーザー koukonkokoukonko
提出日時 2015-12-19 17:34:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 772 bytes
コンパイル時間 3,492 ms
コンパイル使用メモリ 71,740 KB
実行使用メモリ 36,496 KB
最終ジャッジ日時 2023-10-14 22:31:01
合計ジャッジ時間 5,846 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
33,508 KB
testcase_01 AC 38 ms
33,344 KB
testcase_02 AC 39 ms
33,408 KB
testcase_03 AC 39 ms
33,416 KB
testcase_04 AC 38 ms
33,424 KB
testcase_05 AC 38 ms
33,428 KB
testcase_06 AC 38 ms
33,344 KB
testcase_07 AC 37 ms
33,468 KB
testcase_08 AC 37 ms
33,428 KB
testcase_09 AC 39 ms
33,412 KB
testcase_10 AC 38 ms
33,432 KB
testcase_11 AC 42 ms
33,860 KB
testcase_12 AC 44 ms
33,972 KB
testcase_13 AC 47 ms
34,044 KB
testcase_14 AC 47 ms
34,068 KB
testcase_15 AC 49 ms
33,936 KB
testcase_16 AC 48 ms
33,980 KB
testcase_17 AC 51 ms
34,068 KB
testcase_18 AC 56 ms
34,804 KB
testcase_19 AC 58 ms
35,088 KB
testcase_20 AC 62 ms
35,000 KB
testcase_21 AC 68 ms
35,680 KB
testcase_22 AC 68 ms
35,536 KB
testcase_23 AC 73 ms
36,084 KB
testcase_24 AC 81 ms
36,020 KB
testcase_25 AC 84 ms
36,496 KB
testcase_26 AC 76 ms
36,024 KB
testcase_27 AC 38 ms
33,628 KB
testcase_28 AC 39 ms
33,812 KB
testcase_29 AC 45 ms
33,688 KB
testcase_30 AC 49 ms
33,844 KB
testcase_31 AC 48 ms
34,004 KB
testcase_32 AC 55 ms
34,820 KB
testcase_33 AC 60 ms
35,420 KB
testcase_34 AC 69 ms
35,268 KB
testcase_35 AC 83 ms
36,100 KB
testcase_36 AC 79 ms
36,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));

		try {
			int N = Integer.parseInt(read.readLine());
			int[] count = new int[N];

			for (int i = 0; i < N; ++i) {
				String[] box = read.readLine().split(" ");

				for (int j = 0; j < N; ++j) {
					if (box[j].equals("nyanpass")) {
						count[j]++;
					}
				}
			}

			int ans = -1;
			for (int i = 0; i < N; ++i) {
				if (count[i] == N - 1) {
					if (ans == -1) {
						ans = i + 1;
					} else {
						ans = -1;
						break;
					}
				}
			}

			System.out.println(ans);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
0