結果

問題 No.239 にゃんぱすー
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-08-10 21:41:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 223 ms / 2,000 ms
コード長 1,015 bytes
コンパイル時間 3,318 ms
コンパイル使用メモリ 75,948 KB
実行使用メモリ 60,128 KB
最終ジャッジ日時 2023-09-25 07:58:39
合計ジャッジ時間 11,145 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,196 KB
testcase_01 AC 120 ms
55,624 KB
testcase_02 AC 118 ms
55,592 KB
testcase_03 AC 118 ms
55,912 KB
testcase_04 AC 119 ms
56,200 KB
testcase_05 AC 119 ms
55,864 KB
testcase_06 AC 115 ms
55,904 KB
testcase_07 AC 118 ms
56,240 KB
testcase_08 AC 124 ms
56,196 KB
testcase_09 AC 130 ms
56,612 KB
testcase_10 AC 155 ms
56,732 KB
testcase_11 AC 169 ms
56,224 KB
testcase_12 AC 167 ms
56,600 KB
testcase_13 AC 168 ms
56,604 KB
testcase_14 AC 170 ms
56,700 KB
testcase_15 AC 175 ms
56,364 KB
testcase_16 AC 179 ms
56,760 KB
testcase_17 AC 183 ms
58,536 KB
testcase_18 AC 181 ms
58,648 KB
testcase_19 AC 184 ms
59,324 KB
testcase_20 AC 187 ms
56,312 KB
testcase_21 AC 191 ms
59,236 KB
testcase_22 AC 196 ms
57,252 KB
testcase_23 AC 196 ms
58,836 KB
testcase_24 AC 204 ms
59,204 KB
testcase_25 AC 206 ms
59,684 KB
testcase_26 AC 213 ms
60,128 KB
testcase_27 AC 125 ms
55,932 KB
testcase_28 AC 161 ms
56,432 KB
testcase_29 AC 165 ms
56,844 KB
testcase_30 AC 168 ms
56,632 KB
testcase_31 AC 179 ms
56,492 KB
testcase_32 AC 188 ms
58,920 KB
testcase_33 AC 194 ms
59,100 KB
testcase_34 AC 201 ms
59,360 KB
testcase_35 AC 211 ms
59,564 KB
testcase_36 AC 223 ms
59,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class No0239 {
	
	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);

	static void solve() {
		int n = in.nextInt();
		String[][] a = new String[n][n];
		for (int i=0; i<n; i++) {
			for (int j=0; j<n; j++) {
				a[i][j] = in.next();
			}
		}

		int ans = -2;

		for (int i=0; i<n; i++) {
			boolean f = true;
			for (int j=0; j<n; j++) {
				if (!a[j][i].equals("-") && !a[j][i].equals("nyanpass")) {
					f = false;
				}
			}

			if (f) {
				if (ans == -2) {
					ans = i+1;
				}else {
					ans = -1;
				}
			}
		}

		out.println(ans < 0 ? "-1" : ans);
	}

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		solve();
		out.flush();

		long end = System.currentTimeMillis();
		//trace(end-start + "ms");
		in.close();
		out.close();
	}

	static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}
0