結果

問題 No.239 にゃんぱすー
ユーザー 練習生練習生
提出日時 2015-08-22 12:36:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 665 bytes
コンパイル時間 5,066 ms
コンパイル使用メモリ 72,716 KB
実行使用メモリ 59,844 KB
最終ジャッジ日時 2023-09-25 16:06:43
合計ジャッジ時間 13,289 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
56,012 KB
testcase_01 AC 125 ms
55,816 KB
testcase_02 AC 126 ms
55,980 KB
testcase_03 AC 127 ms
55,684 KB
testcase_04 AC 126 ms
55,960 KB
testcase_05 AC 126 ms
55,936 KB
testcase_06 AC 126 ms
55,828 KB
testcase_07 AC 129 ms
55,516 KB
testcase_08 AC 132 ms
55,436 KB
testcase_09 AC 138 ms
55,952 KB
testcase_10 AC 173 ms
56,704 KB
testcase_11 AC 176 ms
56,744 KB
testcase_12 AC 177 ms
56,420 KB
testcase_13 AC 166 ms
56,312 KB
testcase_14 AC 178 ms
56,384 KB
testcase_15 AC 183 ms
56,272 KB
testcase_16 AC 184 ms
56,164 KB
testcase_17 AC 178 ms
58,472 KB
testcase_18 AC 192 ms
58,640 KB
testcase_19 AC 195 ms
58,344 KB
testcase_20 AC 198 ms
59,300 KB
testcase_21 AC 201 ms
58,844 KB
testcase_22 AC 207 ms
59,144 KB
testcase_23 AC 211 ms
59,104 KB
testcase_24 AC 215 ms
59,236 KB
testcase_25 AC 217 ms
59,568 KB
testcase_26 AC 220 ms
59,844 KB
testcase_27 AC 132 ms
55,656 KB
testcase_28 AC 170 ms
56,508 KB
testcase_29 AC 176 ms
56,588 KB
testcase_30 AC 181 ms
56,352 KB
testcase_31 AC 184 ms
56,128 KB
testcase_32 AC 193 ms
58,336 KB
testcase_33 AC 200 ms
58,400 KB
testcase_34 AC 207 ms
58,772 KB
testcase_35 AC 216 ms
59,832 KB
testcase_36 AC 224 ms
57,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No239 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		boolean notNyanpass[] = new boolean[n];
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				String aisatu = sc.next();
				if(!(aisatu.equals("-")) && !(aisatu.equals("nyanpass"))){
					notNyanpass[j] = true;
				}
			}
		}
		sc.close();
		int renchonCount = 0;
		int renchon = 0;
		for(int i = 0; i < n; i++){
			if(notNyanpass[i] == false){
				renchonCount++;
				renchon = i + 1;
			}
		}
		if(renchonCount == 1){
			System.out.println(renchon);
		}else{
			System.out.println(-1);			
		}
	}
}
0