結果

問題 No.239 にゃんぱすー
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-12 22:01:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 222 ms / 2,000 ms
コード長 881 bytes
コンパイル時間 1,928 ms
コンパイル使用メモリ 72,036 KB
実行使用メモリ 59,036 KB
最終ジャッジ日時 2023-08-17 03:59:06
合計ジャッジ時間 9,578 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,604 KB
testcase_01 AC 121 ms
55,360 KB
testcase_02 AC 123 ms
55,508 KB
testcase_03 AC 121 ms
55,988 KB
testcase_04 AC 121 ms
55,548 KB
testcase_05 AC 123 ms
55,620 KB
testcase_06 AC 123 ms
55,672 KB
testcase_07 AC 122 ms
55,944 KB
testcase_08 AC 123 ms
55,628 KB
testcase_09 AC 125 ms
55,780 KB
testcase_10 AC 132 ms
55,672 KB
testcase_11 AC 135 ms
55,680 KB
testcase_12 AC 141 ms
55,612 KB
testcase_13 AC 170 ms
55,684 KB
testcase_14 AC 164 ms
55,696 KB
testcase_15 AC 163 ms
55,752 KB
testcase_16 AC 163 ms
55,804 KB
testcase_17 AC 179 ms
55,872 KB
testcase_18 AC 186 ms
53,772 KB
testcase_19 AC 197 ms
56,424 KB
testcase_20 AC 206 ms
54,788 KB
testcase_21 AC 210 ms
56,468 KB
testcase_22 AC 211 ms
56,924 KB
testcase_23 AC 217 ms
56,600 KB
testcase_24 AC 213 ms
58,608 KB
testcase_25 AC 211 ms
59,036 KB
testcase_26 AC 222 ms
58,956 KB
testcase_27 AC 121 ms
53,896 KB
testcase_28 AC 131 ms
55,932 KB
testcase_29 AC 146 ms
55,692 KB
testcase_30 AC 161 ms
55,392 KB
testcase_31 AC 161 ms
55,348 KB
testcase_32 AC 186 ms
55,692 KB
testcase_33 AC 206 ms
57,140 KB
testcase_34 AC 210 ms
56,236 KB
testcase_35 AC 213 ms
58,564 KB
testcase_36 AC 213 ms
58,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt( sc.nextLine() );
        int [] count = new int [N];
        for(int i=0; i<N; i++){
            String tem = sc.nextLine();
            String [] arr = tem.split(" ");
            for(int j=0; j<N; j++){
                if( "nyanpass".equals(arr[j]) ){
                    count[j]++;
                }
            }
        }
        int f = 0;
        for(int i=0; i<N; i++){
            if(count[i]==N-1){
                f++;
            }
        }
        if(f!=1){
            System.out.println(-1);
        }else{
            for(int i=0; i<N; i++){
                if(count[i]==N-1){
                    System.out.println(i+1);
                    break;
                }
            }
        }
    }
}
0