結果

問題 No.239 にゃんぱすー
ユーザー kou6839kou6839
提出日時 2015-07-16 16:12:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 2,087 ms
コンパイル使用メモリ 71,936 KB
実行使用メモリ 59,520 KB
最終ジャッジ日時 2023-09-22 16:44:25
合計ジャッジ時間 9,596 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,592 KB
testcase_01 AC 120 ms
55,956 KB
testcase_02 AC 120 ms
55,788 KB
testcase_03 AC 121 ms
53,876 KB
testcase_04 AC 119 ms
55,616 KB
testcase_05 AC 120 ms
55,840 KB
testcase_06 AC 119 ms
55,900 KB
testcase_07 AC 123 ms
56,148 KB
testcase_08 AC 126 ms
55,852 KB
testcase_09 AC 133 ms
57,820 KB
testcase_10 AC 168 ms
54,360 KB
testcase_11 AC 166 ms
56,760 KB
testcase_12 AC 164 ms
56,060 KB
testcase_13 AC 158 ms
56,364 KB
testcase_14 AC 171 ms
55,940 KB
testcase_15 AC 176 ms
55,984 KB
testcase_16 AC 179 ms
56,444 KB
testcase_17 AC 178 ms
58,588 KB
testcase_18 AC 181 ms
58,180 KB
testcase_19 AC 181 ms
58,420 KB
testcase_20 AC 187 ms
58,404 KB
testcase_21 AC 193 ms
58,760 KB
testcase_22 AC 194 ms
56,504 KB
testcase_23 AC 200 ms
59,404 KB
testcase_24 AC 204 ms
59,424 KB
testcase_25 AC 211 ms
59,352 KB
testcase_26 AC 211 ms
59,440 KB
testcase_27 AC 125 ms
56,052 KB
testcase_28 AC 138 ms
56,640 KB
testcase_29 AC 165 ms
56,064 KB
testcase_30 AC 160 ms
56,544 KB
testcase_31 AC 177 ms
56,132 KB
testcase_32 AC 180 ms
58,380 KB
testcase_33 AC 189 ms
59,080 KB
testcase_34 AC 192 ms
59,400 KB
testcase_35 AC 203 ms
59,068 KB
testcase_36 AC 211 ms
59,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.awt.Frame;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[][] table = new String[N][N];
		for(int i=0;i<N;i++){
			for(int j=0;j<N;j++){
				table[i][j]=sc.next();
			}
		}
		int ans = -1;
		t:for(int i=0;i<N;i++){
			for(int j=0;j<N;j++){
				if(i==j) continue;
				if(!table[j][i].equals("nyanpass")){
					continue t;
				}
			}
			if(ans==-1){
				ans = i+1;
			}else{
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans);
	}
}
0