結果

問題 No.239 にゃんぱすー
ユーザー knt3110knt3110
提出日時 2018-05-19 11:08:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-06-28 14:20:31
合計ジャッジ時間 2,303 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=[[str(i) for i in input().split()] for i in range(n)]

count=[0 for i in range(n)]
for i in range(n):
    for j in range(n):
        if i!=j and a[i][j]!='nyanpass':
            count[j]+=1
judge=0
ans=-1
for i in range(n):
    if count[i]==0:
        judge+=1
        ans=i
if judge==1:
    print(ans+1)
else:
    print(-1)
0