結果

問題 No.239 にゃんぱすー
ユーザー mitsuomitsuo
提出日時 2016-05-05 12:09:12
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 963 bytes
コンパイル時間 2,361 ms
コンパイル使用メモリ 78,920 KB
実行使用メモリ 58,820 KB
最終ジャッジ日時 2024-04-15 13:06:48
合計ジャッジ時間 10,364 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
53,900 KB
testcase_01 AC 133 ms
54,224 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 136 ms
54,184 KB
testcase_05 WA -
testcase_06 AC 137 ms
54,156 KB
testcase_07 AC 139 ms
54,176 KB
testcase_08 AC 139 ms
54,228 KB
testcase_09 WA -
testcase_10 AC 147 ms
54,084 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 186 ms
54,300 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 223 ms
54,812 KB
testcase_21 WA -
testcase_22 AC 231 ms
56,592 KB
testcase_23 AC 234 ms
56,256 KB
testcase_24 AC 236 ms
57,384 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 138 ms
54,280 KB
testcase_28 AC 147 ms
54,292 KB
testcase_29 WA -
testcase_30 AC 188 ms
54,440 KB
testcase_31 AC 184 ms
54,408 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 227 ms
56,464 KB
testcase_35 WA -
testcase_36 AC 236 ms
56,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package jp.fedom.challange.yuki.q239;

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

public class Main {

	final static String d = System.getProperty("line.separator");

	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));
		} else {
			return -1;
		}

	}

}
0