結果

問題 No.239 にゃんぱすー
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-14 13:13:45
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 619 bytes
コンパイル時間 5,000 ms
コンパイル使用メモリ 74,380 KB
実行使用メモリ 58,048 KB
最終ジャッジ日時 2024-04-28 19:21:53
合計ジャッジ時間 10,778 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
54,084 KB
testcase_01 AC 133 ms
53,912 KB
testcase_02 WA -
testcase_03 AC 139 ms
53,732 KB
testcase_04 AC 133 ms
53,948 KB
testcase_05 AC 132 ms
54,148 KB
testcase_06 AC 137 ms
53,996 KB
testcase_07 AC 136 ms
53,960 KB
testcase_08 AC 145 ms
54,160 KB
testcase_09 AC 140 ms
53,776 KB
testcase_10 AC 176 ms
53,868 KB
testcase_11 AC 182 ms
54,112 KB
testcase_12 AC 180 ms
54,164 KB
testcase_13 AC 187 ms
54,288 KB
testcase_14 AC 182 ms
54,056 KB
testcase_15 AC 188 ms
54,536 KB
testcase_16 AC 179 ms
54,424 KB
testcase_17 AC 190 ms
54,444 KB
testcase_18 AC 200 ms
56,340 KB
testcase_19 AC 202 ms
56,500 KB
testcase_20 AC 208 ms
56,244 KB
testcase_21 AC 235 ms
57,388 KB
testcase_22 AC 210 ms
56,868 KB
testcase_23 AC 216 ms
56,860 KB
testcase_24 AC 220 ms
57,544 KB
testcase_25 AC 234 ms
58,048 KB
testcase_26 AC 231 ms
57,908 KB
testcase_27 AC 140 ms
54,136 KB
testcase_28 AC 172 ms
54,252 KB
testcase_29 AC 183 ms
54,248 KB
testcase_30 AC 181 ms
54,320 KB
testcase_31 AC 186 ms
54,332 KB
testcase_32 AC 208 ms
56,080 KB
testcase_33 AC 203 ms
56,756 KB
testcase_34 AC 209 ms
56,796 KB
testcase_35 AC 228 ms
57,676 KB
testcase_36 AC 237 ms
57,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[][] a = new String[n][n];
		for(int i = 0 ; i < n ; i++) {
			for(int j = 0 ; j < n ; j++) {
				a[i][j] = sc.next();
			}
		}
		int ret = 0; int cnt1 = 0;
		for(int i = 0 ; i < n ; i++) {
			int cnt = 0;
			for(int j = 0 ; j < n ; j++) {
				if(a[j][i].equals("nyanpass")) {
					cnt++;
				}
				if(cnt == n - 1) {
					cnt1++;
					ret = i + 1;
				}
			}
		}
		if(cnt1 == 1) {
			System.out.println(ret);
		} else {
			System.out.println(-1);
		}
 	}
}
0