結果

問題 No.239 にゃんぱすー
ユーザー hikari2004hikari2004
提出日時 2016-04-21 16:44:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 206 ms / 2,000 ms
コード長 637 bytes
コンパイル時間 3,497 ms
コンパイル使用メモリ 75,128 KB
実行使用メモリ 58,408 KB
最終ジャッジ日時 2024-04-15 03:56:42
合計ジャッジ時間 9,988 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
54,296 KB
testcase_01 AC 108 ms
52,948 KB
testcase_02 AC 120 ms
53,844 KB
testcase_03 AC 120 ms
53,964 KB
testcase_04 AC 121 ms
53,936 KB
testcase_05 AC 120 ms
52,712 KB
testcase_06 AC 121 ms
54,416 KB
testcase_07 AC 123 ms
54,120 KB
testcase_08 AC 124 ms
54,360 KB
testcase_09 AC 136 ms
54,136 KB
testcase_10 AC 153 ms
54,284 KB
testcase_11 AC 154 ms
54,064 KB
testcase_12 AC 158 ms
54,332 KB
testcase_13 AC 162 ms
54,468 KB
testcase_14 AC 163 ms
54,480 KB
testcase_15 AC 155 ms
54,312 KB
testcase_16 AC 172 ms
54,268 KB
testcase_17 AC 173 ms
54,620 KB
testcase_18 AC 175 ms
56,728 KB
testcase_19 AC 180 ms
56,516 KB
testcase_20 AC 179 ms
56,856 KB
testcase_21 AC 191 ms
56,908 KB
testcase_22 AC 190 ms
57,236 KB
testcase_23 AC 192 ms
56,988 KB
testcase_24 AC 200 ms
57,660 KB
testcase_25 AC 201 ms
57,688 KB
testcase_26 AC 205 ms
58,244 KB
testcase_27 AC 124 ms
54,100 KB
testcase_28 AC 143 ms
54,460 KB
testcase_29 AC 160 ms
53,996 KB
testcase_30 AC 163 ms
54,444 KB
testcase_31 AC 171 ms
54,556 KB
testcase_32 AC 163 ms
56,724 KB
testcase_33 AC 184 ms
56,660 KB
testcase_34 AC 189 ms
57,100 KB
testcase_35 AC 202 ms
58,408 KB
testcase_36 AC 206 ms
58,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicorder;

import java.util.Scanner;

public class No239 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[][] murabito = new String[n][n];
		int count = 0;
		int ans = -1;

		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				murabito[i][j] = sc.next();
			}
		}

		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				if(i==j||murabito[j][i].equals("nyanpass")){
					if(j==n-1){
						ans=i+1;
						count++;
					}
					continue;
				}else{
					break;
				}
			}
		}
		if(count > 1){
			ans = -1;
		}
		System.out.println(ans);

	}
}
0