結果

問題 No.239 にゃんぱすー
ユーザー gorugo30
提出日時 2021-02-22 23:29:17
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-09-21 18:53:22
合計ジャッジ時間 2,840 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

nyan = "nyanpass"
N = int(input())
gre = [list(input().split()) for i in range(N)]
renchon = set()
for j in range(N):
    cnt = 0
    for i in range(N):
        if i == j:
            continue
        if gre[i][j] == nyan:
            cnt += 1
    if cnt == N - 1:
        renchon.add(j + 1)
if len(renchon) == 1:
    for ans in renchon:
        print(ans)
else:
    print(-1)
0