結果

問題 No.239 にゃんぱすー
ユーザー R NR N
提出日時 2020-10-11 09:38:02
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 472 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-07-20 17:07:42
合計ジャッジ時間 2,423 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2 RE * 2
other WA * 14 RE * 19
権限があれば一括ダウンロードができます

ソースコード

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())]

print(max_k)

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