結果

問題 No.239 にゃんぱすー
ユーザー cande398cande398
提出日時 2017-10-16 00:31:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 219 ms / 2,000 ms
コード長 814 bytes
コンパイル時間 2,615 ms
コンパイル使用メモリ 73,672 KB
実行使用メモリ 59,600 KB
最終ジャッジ日時 2023-08-11 05:21:53
合計ジャッジ時間 10,418 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,532 KB
testcase_01 AC 122 ms
55,440 KB
testcase_02 AC 122 ms
55,332 KB
testcase_03 AC 122 ms
55,552 KB
testcase_04 AC 121 ms
55,356 KB
testcase_05 AC 122 ms
56,232 KB
testcase_06 AC 119 ms
55,400 KB
testcase_07 AC 125 ms
53,308 KB
testcase_08 AC 127 ms
55,520 KB
testcase_09 AC 133 ms
55,452 KB
testcase_10 AC 167 ms
56,488 KB
testcase_11 AC 169 ms
56,096 KB
testcase_12 AC 170 ms
56,264 KB
testcase_13 AC 161 ms
56,008 KB
testcase_14 AC 178 ms
56,048 KB
testcase_15 AC 179 ms
55,948 KB
testcase_16 AC 178 ms
55,724 KB
testcase_17 AC 181 ms
58,036 KB
testcase_18 AC 191 ms
58,048 KB
testcase_19 AC 192 ms
58,356 KB
testcase_20 AC 197 ms
58,564 KB
testcase_21 AC 194 ms
58,748 KB
testcase_22 AC 199 ms
58,312 KB
testcase_23 AC 208 ms
59,032 KB
testcase_24 AC 211 ms
59,192 KB
testcase_25 AC 216 ms
59,476 KB
testcase_26 AC 219 ms
59,304 KB
testcase_27 AC 128 ms
55,444 KB
testcase_28 AC 143 ms
55,400 KB
testcase_29 AC 168 ms
56,196 KB
testcase_30 AC 171 ms
56,080 KB
testcase_31 AC 175 ms
56,000 KB
testcase_32 AC 198 ms
57,996 KB
testcase_33 AC 195 ms
58,540 KB
testcase_34 AC 201 ms
58,928 KB
testcase_35 AC 206 ms
58,400 KB
testcase_36 AC 219 ms
59,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
    public static void main(String[] args){
        int i,j,poi = 0;
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] count = new int[num];
        String[][] line = new String[num][num];
        for(i=0;i<num;i++){
            for(j=0;j<num;j++){
                line[i][j] = sc.next();
            }
        }
        for(j=0;j<num;j++){
            for(i=0;i<num;i++){
                if(i==j && line[i][j].equals("-"))count[j]++;
                else if(line[i][j].equals("nyanpass"))count[j]++;
            }
            if(count[j] == num)poi++;
        }
        if(poi == 1){
            for(i=0;i<num;i++)
                if(count[i] == num)System.out.println(i+1);
        }
        else System.out.println("-1"); 
    }
}
0