結果

問題 No.239 にゃんぱすー
ユーザー yun_appyun_app
提出日時 2016-05-12 00:06:57
言語 Java19
(openjdk 21)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 986 bytes
コンパイル時間 2,033 ms
コンパイル使用メモリ 71,872 KB
実行使用メモリ 52,468 KB
最終ジャッジ日時 2023-07-28 05:43:56
合計ジャッジ時間 6,083 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,252 KB
testcase_01 AC 44 ms
49,228 KB
testcase_02 AC 44 ms
49,532 KB
testcase_03 AC 44 ms
49,432 KB
testcase_04 AC 44 ms
49,284 KB
testcase_05 AC 44 ms
49,208 KB
testcase_06 AC 44 ms
49,256 KB
testcase_07 AC 43 ms
49,632 KB
testcase_08 AC 44 ms
49,396 KB
testcase_09 AC 45 ms
49,176 KB
testcase_10 AC 46 ms
49,372 KB
testcase_11 AC 48 ms
49,280 KB
testcase_12 AC 50 ms
49,420 KB
testcase_13 AC 52 ms
49,472 KB
testcase_14 AC 53 ms
49,912 KB
testcase_15 AC 55 ms
49,624 KB
testcase_16 AC 57 ms
49,420 KB
testcase_17 AC 58 ms
50,504 KB
testcase_18 AC 60 ms
49,592 KB
testcase_19 AC 68 ms
51,916 KB
testcase_20 AC 71 ms
51,388 KB
testcase_21 AC 74 ms
51,340 KB
testcase_22 AC 75 ms
50,908 KB
testcase_23 AC 91 ms
51,228 KB
testcase_24 AC 93 ms
51,332 KB
testcase_25 AC 93 ms
52,468 KB
testcase_26 AC 97 ms
52,348 KB
testcase_27 AC 45 ms
49,328 KB
testcase_28 AC 46 ms
49,360 KB
testcase_29 AC 51 ms
49,440 KB
testcase_30 AC 54 ms
49,548 KB
testcase_31 AC 56 ms
49,612 KB
testcase_32 AC 63 ms
50,484 KB
testcase_33 AC 71 ms
50,988 KB
testcase_34 AC 76 ms
51,096 KB
testcase_35 AC 92 ms
51,164 KB
testcase_36 AC 84 ms
51,316 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