結果

問題 No.239 にゃんぱすー
コンテスト
ユーザー rocoder
提出日時 2017-06-18 09:50:39
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 359 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 374 ms
コンパイル使用メモリ 20,704 KB
実行使用メモリ 15,484 KB
最終ジャッジ日時 2026-04-18 01:52:03
合計ジャッジ時間 5,144 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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]+1)
0