結果

問題 No.627 ランダムウォークの軌跡
コンテスト
ユーザー u
提出日時 2018-02-21 22:20:44
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 366 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 77 ms
コンパイル使用メモリ 14,720 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2026-10-15 01:20:57
合計ジャッジ時間 2,621 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n=int(input())
s=[int(input()) for i in range(n)]

bool_list = []

for i in range(len(s) - 1):
    bool = ((s[i] + 1) == s[i + 1]) or ((s[i] - 1) == s[i + 1])
    bool_list.append(bool)

if len(s) == 1:
    if s[0] == 1:
        print("T")
    else:
        print("F")
else:
    if (len(s)-1) == bool_list.count(True):
        print("T")
    else:
        print("F")
0