結果

問題 No.239 にゃんぱすー
ユーザー r.suzukir.suzuki
提出日時 2015-12-11 18:19:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 229 ms / 2,000 ms
コード長 861 bytes
コンパイル時間 3,482 ms
コンパイル使用メモリ 72,628 KB
実行使用メモリ 60,236 KB
最終ジャッジ日時 2023-10-13 11:13:21
合計ジャッジ時間 11,738 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
56,124 KB
testcase_01 AC 127 ms
55,768 KB
testcase_02 AC 126 ms
55,852 KB
testcase_03 AC 127 ms
55,732 KB
testcase_04 AC 126 ms
56,036 KB
testcase_05 AC 128 ms
55,884 KB
testcase_06 AC 126 ms
55,948 KB
testcase_07 AC 129 ms
54,028 KB
testcase_08 AC 131 ms
55,668 KB
testcase_09 AC 143 ms
55,800 KB
testcase_10 AC 175 ms
56,508 KB
testcase_11 AC 168 ms
56,272 KB
testcase_12 AC 180 ms
56,560 KB
testcase_13 AC 167 ms
56,076 KB
testcase_14 AC 180 ms
56,452 KB
testcase_15 AC 185 ms
56,420 KB
testcase_16 AC 188 ms
56,400 KB
testcase_17 AC 189 ms
58,304 KB
testcase_18 AC 195 ms
58,584 KB
testcase_19 AC 197 ms
58,840 KB
testcase_20 AC 199 ms
58,424 KB
testcase_21 AC 202 ms
59,196 KB
testcase_22 AC 211 ms
58,384 KB
testcase_23 AC 211 ms
58,596 KB
testcase_24 AC 222 ms
59,396 KB
testcase_25 AC 229 ms
60,236 KB
testcase_26 AC 226 ms
59,728 KB
testcase_27 AC 133 ms
55,844 KB
testcase_28 AC 175 ms
56,068 KB
testcase_29 AC 169 ms
56,268 KB
testcase_30 AC 178 ms
56,412 KB
testcase_31 AC 188 ms
56,384 KB
testcase_32 AC 192 ms
58,856 KB
testcase_33 AC 198 ms
58,672 KB
testcase_34 AC 204 ms
58,836 KB
testcase_35 AC 210 ms
59,660 KB
testcase_36 AC 224 ms
59,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No_239 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String[][] greetingList = new String[a][a];

		for (int i = 0; i < greetingList.length; i++) {
			for (int j = 0; j < greetingList.length; j++) {
				greetingList[i][j] = sc.next();
			}
		}

		int sum = 0;
		int renchonNumber = 0;
		boolean renchon = false;
		Loop: for (int i = 0; i < greetingList.length; i++) {
			for (int j = 0; j < greetingList.length; j++) {
				if (i == j) {
					continue;
				}
				if (!greetingList[j][i].equals("nyanpass")) {
					continue Loop;
				}

			}
			sum++;
			renchonNumber = i + 1;
			renchon = true;
			if (sum > 1) {
				renchon = false;
				break;
			}
		}

		if (renchon) {
			System.out.println(renchonNumber);
		} else {
			System.out.println(-1);
		}

	}
}
0