結果

問題 No.239 にゃんぱすー
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 17:52:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 229 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 2,830 ms
コンパイル使用メモリ 72,724 KB
実行使用メモリ 60,212 KB
最終ジャッジ日時 2023-10-11 12:43:21
合計ジャッジ時間 10,177 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,852 KB
testcase_01 AC 127 ms
55,516 KB
testcase_02 AC 125 ms
55,956 KB
testcase_03 AC 125 ms
55,664 KB
testcase_04 AC 124 ms
55,940 KB
testcase_05 AC 125 ms
56,096 KB
testcase_06 AC 122 ms
56,140 KB
testcase_07 AC 127 ms
54,024 KB
testcase_08 AC 133 ms
55,924 KB
testcase_09 AC 139 ms
56,112 KB
testcase_10 AC 164 ms
56,624 KB
testcase_11 AC 177 ms
56,492 KB
testcase_12 AC 176 ms
56,416 KB
testcase_13 AC 178 ms
56,184 KB
testcase_14 AC 181 ms
56,764 KB
testcase_15 AC 184 ms
56,452 KB
testcase_16 AC 184 ms
56,124 KB
testcase_17 AC 192 ms
58,236 KB
testcase_18 AC 195 ms
58,532 KB
testcase_19 AC 198 ms
58,716 KB
testcase_20 AC 198 ms
58,884 KB
testcase_21 AC 200 ms
59,136 KB
testcase_22 AC 207 ms
59,268 KB
testcase_23 AC 214 ms
59,244 KB
testcase_24 AC 213 ms
59,552 KB
testcase_25 AC 222 ms
59,280 KB
testcase_26 AC 229 ms
60,212 KB
testcase_27 AC 131 ms
57,920 KB
testcase_28 AC 167 ms
56,132 KB
testcase_29 AC 173 ms
56,296 KB
testcase_30 AC 182 ms
56,512 KB
testcase_31 AC 178 ms
56,468 KB
testcase_32 AC 177 ms
57,792 KB
testcase_33 AC 195 ms
58,516 KB
testcase_34 AC 204 ms
57,276 KB
testcase_35 AC 210 ms
59,320 KB
testcase_36 AC 221 ms
59,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int n = sc.nextInt();
		int[] sonmin = new int[n];
		for (int i=0; i<n; i++) {
			for (int j=0; j<n; j++) {
				String temp = sc.next();
				if (temp.equals("nyanpass") || temp.equals("-")) {
					sonmin[j]++;
				}
			}
		}
		
		int ans = -1;
		int num = 0;
		for (int i=0; i<n; i++) {
			if (sonmin[i] == n) {
				ans = i;
				num++;
			}
		}
		System.out.println(num>=2?-1:ans==-1?-1:ans+1);
		
	}
}
0