結果

問題 No.239 にゃんぱすー
ユーザー mitsuomitsuo
提出日時 2016-05-05 12:12:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 271 ms / 2,000 ms
コード長 865 bytes
コンパイル時間 2,917 ms
コンパイル使用メモリ 78,664 KB
実行使用メモリ 54,188 KB
最終ジャッジ日時 2024-04-15 13:10:06
合計ジャッジ時間 11,955 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
53,808 KB
testcase_01 AC 152 ms
54,152 KB
testcase_02 AC 155 ms
54,188 KB
testcase_03 AC 156 ms
41,556 KB
testcase_04 AC 150 ms
41,092 KB
testcase_05 AC 153 ms
41,848 KB
testcase_06 AC 149 ms
41,548 KB
testcase_07 AC 154 ms
41,936 KB
testcase_08 AC 156 ms
41,336 KB
testcase_09 AC 163 ms
41,144 KB
testcase_10 AC 167 ms
41,800 KB
testcase_11 AC 174 ms
41,440 KB
testcase_12 AC 178 ms
41,508 KB
testcase_13 AC 204 ms
41,832 KB
testcase_14 AC 209 ms
41,976 KB
testcase_15 AC 201 ms
41,804 KB
testcase_16 AC 207 ms
41,884 KB
testcase_17 AC 218 ms
42,148 KB
testcase_18 AC 233 ms
42,604 KB
testcase_19 AC 244 ms
42,772 KB
testcase_20 AC 256 ms
43,144 KB
testcase_21 AC 269 ms
42,664 KB
testcase_22 AC 262 ms
42,844 KB
testcase_23 AC 266 ms
43,604 KB
testcase_24 AC 266 ms
44,008 KB
testcase_25 AC 271 ms
44,176 KB
testcase_26 AC 269 ms
44,248 KB
testcase_27 AC 156 ms
41,392 KB
testcase_28 AC 168 ms
41,580 KB
testcase_29 AC 179 ms
41,772 KB
testcase_30 AC 200 ms
41,512 KB
testcase_31 AC 200 ms
42,288 KB
testcase_32 AC 221 ms
42,232 KB
testcase_33 AC 238 ms
43,216 KB
testcase_34 AC 260 ms
43,104 KB
testcase_35 AC 268 ms
43,852 KB
testcase_36 AC 263 ms
44,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> input = new ArrayList<>();
		while (sc.hasNext()) {
			input.add(sc.nextLine());
		}

		System.out.println(solve(input));

		sc.close();
	}

	public static int solve(List<String> in) {
		int N = Integer.valueOf(in.get(0));
		in.remove(0);
		List<String> cand = new ArrayList<>();
		for (int i = 0; i < N; i++) {
			cand.add(String.valueOf(i));
		}

		for (int i = 0; i < N; i++) {
			String[] s = in.get(i).split(" ");
			for (int j = 0; j < N; j++) {
				if (!s[j].equals("nyanpass") && !s[j].equals("-")) {
					cand.remove(String.valueOf(j));
				}

			}
		}

		if (cand.size() == 1) {
			return Integer.valueOf(cand.get(0)) + 1;
		} else {
			return -1;
		}

	}

}
0