結果

問題 No.239 にゃんぱすー
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 17:51:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 517 bytes
コンパイル時間 1,908 ms
コンパイル使用メモリ 71,880 KB
実行使用メモリ 60,132 KB
最終ジャッジ日時 2023-10-11 12:43:07
合計ジャッジ時間 10,135 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 120 ms
55,772 KB
testcase_03 AC 122 ms
55,736 KB
testcase_04 AC 122 ms
55,492 KB
testcase_05 AC 124 ms
55,940 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 127 ms
55,920 KB
testcase_09 AC 132 ms
55,664 KB
testcase_10 AC 165 ms
56,552 KB
testcase_11 AC 155 ms
56,404 KB
testcase_12 AC 173 ms
56,296 KB
testcase_13 AC 162 ms
56,148 KB
testcase_14 AC 172 ms
55,952 KB
testcase_15 AC 179 ms
56,248 KB
testcase_16 AC 181 ms
56,516 KB
testcase_17 AC 188 ms
58,656 KB
testcase_18 AC 191 ms
58,692 KB
testcase_19 AC 192 ms
58,896 KB
testcase_20 AC 195 ms
58,956 KB
testcase_21 AC 197 ms
59,664 KB
testcase_22 AC 198 ms
57,424 KB
testcase_23 AC 200 ms
58,760 KB
testcase_24 AC 211 ms
57,748 KB
testcase_25 AC 211 ms
59,828 KB
testcase_26 AC 218 ms
59,960 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 171 ms
56,308 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 186 ms
58,540 KB
testcase_33 AC 193 ms
58,936 KB
testcase_34 WA -
testcase_35 AC 199 ms
59,112 KB
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

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);
		
	}
}
0