結果

問題 No.239 にゃんぱすー
ユーザー R NR N
提出日時 2020-10-11 09:46:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 501 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 9,376 KB
最終ジャッジ日時 2023-09-27 22:48:09
合計ジャッジ時間 2,436 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,592 KB
testcase_01 AC 19 ms
8,612 KB
testcase_02 AC 20 ms
8,576 KB
testcase_03 AC 19 ms
8,464 KB
testcase_04 AC 19 ms
8,604 KB
testcase_05 AC 19 ms
8,480 KB
testcase_06 AC 19 ms
8,472 KB
testcase_07 AC 18 ms
8,476 KB
testcase_08 AC 19 ms
8,472 KB
testcase_09 AC 20 ms
8,568 KB
testcase_10 AC 19 ms
8,528 KB
testcase_11 AC 19 ms
8,692 KB
testcase_12 AC 20 ms
8,680 KB
testcase_13 AC 20 ms
8,600 KB
testcase_14 AC 20 ms
8,588 KB
testcase_15 AC 20 ms
8,632 KB
testcase_16 AC 20 ms
8,684 KB
testcase_17 AC 21 ms
8,712 KB
testcase_18 AC 20 ms
8,748 KB
testcase_19 AC 21 ms
8,976 KB
testcase_20 AC 22 ms
8,844 KB
testcase_21 AC 22 ms
9,032 KB
testcase_22 AC 22 ms
8,976 KB
testcase_23 AC 23 ms
9,040 KB
testcase_24 AC 22 ms
9,120 KB
testcase_25 AC 23 ms
9,168 KB
testcase_26 AC 24 ms
9,304 KB
testcase_27 AC 19 ms
8,556 KB
testcase_28 AC 19 ms
8,656 KB
testcase_29 AC 20 ms
8,652 KB
testcase_30 AC 19 ms
8,608 KB
testcase_31 AC 20 ms
8,704 KB
testcase_32 AC 20 ms
8,760 KB
testcase_33 AC 21 ms
8,980 KB
testcase_34 AC 22 ms
9,040 KB
testcase_35 AC 23 ms
9,272 KB
testcase_36 AC 24 ms
9,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding=utf-8:
import collections

n = int(input())
persons = dict([(i, 0) for i in range(n)])
greeting = list()

for i in range(n):
    greeting.append(list(map(str, input().split())))

for j in range(n):
    for k in range(n):
        if greeting[j][k] == "nyanpass":
            persons[k] += 1

max_k = [k for k, v in persons.items() if v == max(persons.values())]

if len(max_k) == 1:
    if persons.get(*max_k) == n - 1:
        print(max_k[0]+1)
    else:
        print(-1)
else:
    print(-1)
0