結果

問題 No.239 にゃんぱすー
ユーザー rocoder
提出日時 2017-06-18 09:31:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 446 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 11,776 KB
最終ジャッジ日時 2024-10-01 19:31:43
合計ジャッジ時間 2,595 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 16 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
a=[[i for i in input().split()] for i in range(N)]
R=[0]
i=1
while i <N:
    if a[0][i]=="nyanpass":
        R.append(i)
    i+=1
i=1
while i<N and len(R)>0:
    j=0
    while j<len(R):
        if a[i][R[j]]!="nyanpass" and i!=R[j]:
            R.pop(j)
            j-=1
        j+=1
    i+=1
if len(R)!=1:
    print(-1)
else:
    print(R[0])
0