結果

問題 No.239 にゃんぱすー
ユーザー jimanojimano
提出日時 2018-01-20 17:57:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 759 bytes
コンパイル時間 3,239 ms
コンパイル使用メモリ 71,704 KB
実行使用メモリ 51,788 KB
最終ジャッジ日時 2023-08-26 09:11:57
合計ジャッジ時間 6,046 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
49,692 KB
testcase_01 AC 39 ms
47,452 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 40 ms
49,576 KB
testcase_05 WA -
testcase_06 AC 39 ms
49,312 KB
testcase_07 AC 38 ms
49,328 KB
testcase_08 AC 40 ms
49,272 KB
testcase_09 WA -
testcase_10 AC 43 ms
51,404 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 47 ms
49,860 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 63 ms
51,272 KB
testcase_21 WA -
testcase_22 AC 71 ms
51,692 KB
testcase_23 AC 83 ms
51,268 KB
testcase_24 AC 83 ms
50,932 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 41 ms
49,564 KB
testcase_28 AC 43 ms
49,216 KB
testcase_29 WA -
testcase_30 AC 49 ms
49,584 KB
testcase_31 AC 51 ms
49,704 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 72 ms
51,348 KB
testcase_35 WA -
testcase_36 AC 86 ms
51,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class No0239 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			int N = Integer.parseInt(br.readLine());
			int[] greet = new int[N];
			int ans = -1;
			int cnt = 0;

			for (int i = 0; i < N; i++) {

				String[] str = br.readLine().split(" ");
				for (int j = 0; j < N; j++) {
					greet[j] = str[j].equals("nyanpass") ? greet[j]++ : greet[j];
				}
			}

			for (int g : greet) {
				if (g == N - 1) {
					ans = g + 1;
					cnt++;
				}
			}
			System.out.println(cnt == 1 ? ans : -1);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0