結果

問題 No.239 にゃんぱすー
ユーザー YOSHIYOSHI
提出日時 2021-03-07 22:12:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 729 bytes
コンパイル時間 4,013 ms
コンパイル使用メモリ 74,380 KB
実行使用メモリ 52,140 KB
最終ジャッジ日時 2024-04-17 11:54:55
合計ジャッジ時間 7,191 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
50,384 KB
testcase_01 AC 52 ms
50,004 KB
testcase_02 AC 53 ms
50,288 KB
testcase_03 AC 53 ms
50,028 KB
testcase_04 AC 53 ms
50,268 KB
testcase_05 AC 53 ms
50,048 KB
testcase_06 AC 53 ms
50,284 KB
testcase_07 AC 53 ms
50,368 KB
testcase_08 AC 53 ms
50,296 KB
testcase_09 AC 54 ms
49,780 KB
testcase_10 AC 54 ms
49,912 KB
testcase_11 AC 55 ms
50,200 KB
testcase_12 AC 57 ms
50,300 KB
testcase_13 AC 57 ms
50,288 KB
testcase_14 AC 58 ms
50,344 KB
testcase_15 AC 60 ms
50,300 KB
testcase_16 AC 64 ms
50,532 KB
testcase_17 AC 77 ms
50,976 KB
testcase_18 AC 72 ms
50,808 KB
testcase_19 AC 77 ms
51,604 KB
testcase_20 AC 80 ms
51,320 KB
testcase_21 AC 96 ms
51,792 KB
testcase_22 AC 98 ms
51,700 KB
testcase_23 AC 92 ms
51,704 KB
testcase_24 AC 105 ms
51,736 KB
testcase_25 AC 104 ms
51,992 KB
testcase_26 AC 109 ms
51,756 KB
testcase_27 AC 53 ms
50,060 KB
testcase_28 AC 54 ms
49,932 KB
testcase_29 AC 56 ms
50,408 KB
testcase_30 AC 59 ms
50,224 KB
testcase_31 AC 74 ms
50,316 KB
testcase_32 AC 80 ms
51,032 KB
testcase_33 AC 91 ms
51,748 KB
testcase_34 AC 98 ms
51,504 KB
testcase_35 AC 103 ms
51,888 KB
testcase_36 AC 108 ms
52,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No00000239_Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int[] cntArr = new int[n];
		for(int i = 0; i < n; i++) {
			String[] greetings = br.readLine().split(" ");
			for(int j = 0; j < n; j++) {
				if("nyanpass".equals(greetings[j])) cntArr[j] += 1;
			}
		}
		int result = -1;
		for(int k = 0; k < n; k++) {
			if(cntArr[k] == n - 1) {
				if(result == -1) {
					result = k + 1;
				} else {
					result = -1;
					break;
				}
			}
		}
		System.out.println(result);
	}
}
0