結果

問題 No.239 にゃんぱすー
ユーザー kano_townkano_town
提出日時 2015-07-13 16:09:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 216 ms / 2,000 ms
コード長 676 bytes
コンパイル時間 5,450 ms
コンパイル使用メモリ 72,676 KB
実行使用メモリ 59,920 KB
最終ジャッジ日時 2023-09-22 15:26:46
合計ジャッジ時間 13,208 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,268 KB
testcase_01 AC 123 ms
55,696 KB
testcase_02 AC 124 ms
55,596 KB
testcase_03 AC 124 ms
55,800 KB
testcase_04 AC 120 ms
55,404 KB
testcase_05 AC 120 ms
55,548 KB
testcase_06 AC 123 ms
56,012 KB
testcase_07 AC 125 ms
56,084 KB
testcase_08 AC 128 ms
55,708 KB
testcase_09 AC 133 ms
56,128 KB
testcase_10 AC 168 ms
56,340 KB
testcase_11 AC 164 ms
56,696 KB
testcase_12 AC 160 ms
56,156 KB
testcase_13 AC 163 ms
56,944 KB
testcase_14 AC 170 ms
56,192 KB
testcase_15 AC 174 ms
56,468 KB
testcase_16 AC 178 ms
56,424 KB
testcase_17 AC 180 ms
58,044 KB
testcase_18 AC 188 ms
58,512 KB
testcase_19 AC 185 ms
58,788 KB
testcase_20 AC 189 ms
58,764 KB
testcase_21 AC 195 ms
58,672 KB
testcase_22 AC 201 ms
59,112 KB
testcase_23 AC 206 ms
59,224 KB
testcase_24 AC 211 ms
59,532 KB
testcase_25 AC 210 ms
59,388 KB
testcase_26 AC 213 ms
59,920 KB
testcase_27 AC 129 ms
55,828 KB
testcase_28 AC 145 ms
55,836 KB
testcase_29 AC 165 ms
54,760 KB
testcase_30 AC 174 ms
56,416 KB
testcase_31 AC 176 ms
56,476 KB
testcase_32 AC 185 ms
58,752 KB
testcase_33 AC 189 ms
58,284 KB
testcase_34 AC 197 ms
58,788 KB
testcase_35 AC 204 ms
58,900 KB
testcase_36 AC 216 ms
59,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Yukicoder239 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), res = -1;
        int cnt[] = new int[n];
        for (int i = 0; i < n; i++) 
            for (int j = 0; j < n; j++) 
                if (sc.next().equals("nyanpass")) 
                    cnt[j]++;
        for (int j = 0; j < n; j++) {
            if (cnt[j] == n-1) {
                if (res == -1) {
                    res = j + 1;
                } else {
                    res = -1;
                    break;
                }
            }
        }
        System.out.println(res);
    }
}
0