結果

問題 No.239 にゃんぱすー
ユーザー yun_appyun_app
提出日時 2016-05-12 00:06:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 986 bytes
コンパイル時間 2,249 ms
コンパイル使用メモリ 74,664 KB
実行使用メモリ 52,276 KB
最終ジャッジ日時 2024-04-15 15:15:37
合計ジャッジ時間 6,133 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
49,924 KB
testcase_01 AC 59 ms
52,276 KB
testcase_02 AC 56 ms
50,308 KB
testcase_03 AC 57 ms
50,300 KB
testcase_04 AC 57 ms
50,104 KB
testcase_05 AC 55 ms
50,092 KB
testcase_06 AC 57 ms
49,908 KB
testcase_07 AC 56 ms
50,216 KB
testcase_08 AC 58 ms
50,084 KB
testcase_09 AC 58 ms
49,956 KB
testcase_10 AC 59 ms
50,228 KB
testcase_11 AC 61 ms
50,256 KB
testcase_12 AC 62 ms
50,240 KB
testcase_13 AC 60 ms
49,976 KB
testcase_14 AC 62 ms
50,340 KB
testcase_15 AC 65 ms
50,436 KB
testcase_16 AC 68 ms
50,244 KB
testcase_17 AC 81 ms
50,988 KB
testcase_18 AC 74 ms
51,020 KB
testcase_19 AC 89 ms
51,304 KB
testcase_20 AC 93 ms
51,744 KB
testcase_21 AC 99 ms
51,512 KB
testcase_22 AC 101 ms
51,568 KB
testcase_23 AC 104 ms
51,788 KB
testcase_24 AC 107 ms
51,992 KB
testcase_25 AC 108 ms
51,792 KB
testcase_26 AC 111 ms
51,792 KB
testcase_27 AC 58 ms
50,232 KB
testcase_28 AC 60 ms
49,996 KB
testcase_29 AC 60 ms
50,432 KB
testcase_30 AC 62 ms
50,440 KB
testcase_31 AC 67 ms
50,616 KB
testcase_32 AC 86 ms
51,012 KB
testcase_33 AC 98 ms
51,120 KB
testcase_34 AC 101 ms
51,972 KB
testcase_35 AC 108 ms
51,612 KB
testcase_36 AC 110 ms
51,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.io.*;

class Ideone{
    public static void main(String[] args) throws Exception{
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] ans = new int[n];
        
        for(int i=0;i<n;i++){
            String[] lines = br.readLine().split(" ");
            for(int j=0;j<n;j++){
                if(i!=j){
                    String word = lines[j];
                    if(!word.equals("nyanpass")){
                        ans[j]++;
                    }
                }
            }
        }
        
        int answer = -1;
        for(int i=0;i<n;i++){
            if(ans[i] == 0){
                if(answer != -1){
                    answer = -1;
                    break;
                }
                answer = i+1;
            }
        }
        
        System.out.println(answer);
    }
}
0