結果

問題 No.239 にゃんぱすー
ユーザー dazydazy
提出日時 2017-03-08 02:04:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 834 bytes
コンパイル時間 3,267 ms
コンパイル使用メモリ 72,152 KB
実行使用メモリ 60,356 KB
最終ジャッジ日時 2023-09-05 22:39:14
合計ジャッジ時間 11,498 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,976 KB
testcase_01 AC 121 ms
56,060 KB
testcase_02 AC 121 ms
55,976 KB
testcase_03 AC 123 ms
55,812 KB
testcase_04 AC 122 ms
56,112 KB
testcase_05 AC 120 ms
56,164 KB
testcase_06 AC 123 ms
56,144 KB
testcase_07 AC 124 ms
56,136 KB
testcase_08 AC 126 ms
56,264 KB
testcase_09 AC 134 ms
56,104 KB
testcase_10 AC 164 ms
56,704 KB
testcase_11 AC 163 ms
56,700 KB
testcase_12 AC 172 ms
56,268 KB
testcase_13 AC 169 ms
56,496 KB
testcase_14 AC 170 ms
56,964 KB
testcase_15 AC 170 ms
56,388 KB
testcase_16 AC 175 ms
56,440 KB
testcase_17 AC 184 ms
58,744 KB
testcase_18 AC 190 ms
58,148 KB
testcase_19 AC 191 ms
58,812 KB
testcase_20 AC 192 ms
59,052 KB
testcase_21 AC 197 ms
60,356 KB
testcase_22 AC 201 ms
59,500 KB
testcase_23 AC 204 ms
58,916 KB
testcase_24 AC 211 ms
59,048 KB
testcase_25 AC 215 ms
58,164 KB
testcase_26 AC 214 ms
59,760 KB
testcase_27 AC 129 ms
55,744 KB
testcase_28 AC 168 ms
56,268 KB
testcase_29 AC 166 ms
56,312 KB
testcase_30 AC 158 ms
56,228 KB
testcase_31 AC 173 ms
56,288 KB
testcase_32 AC 185 ms
58,616 KB
testcase_33 AC 190 ms
59,252 KB
testcase_34 AC 194 ms
59,044 KB
testcase_35 AC 201 ms
59,592 KB
testcase_36 AC 205 ms
59,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        int ans = -1;

        int N = scan.nextInt();
        String A;
        boolean b [] = new boolean[N];
        int flag = 0;

        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                A = scan.next();
                if (i==j) continue;
                if (!b[j]) {
                    if (!A.equals("nyanpass")) {
                        b[j] = true;
                    }
                }
            }
        }

        for (int i = 0; i < N; i++) {
            if (!b[i]) {
                if (flag!=0) break;
                flag = i+1;
            }
            if (i==N-1 && flag!=0) ans = flag;
        }

       System.out.println(ans);
    }
}
0