結果

問題 No.627 ランダムウォークの軌跡
コンテスト
ユーザー dy
提出日時 2018-01-15 16:29:46
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 25 ms / 2,000 ms
+ 170µs
コード長 601 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 14,592 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2026-10-15 01:18:40
合計ジャッジ時間 2,845 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

input_count = int(input())

current_place = 0
before_place = 0
answer = True

for i in range(input_count):
    input_number = int(input())

    if answer == False:
        continue

    if i == 0 and input_number != 1 and input_number != -1:
        answer = False

    if i == 0:
        before_place = input_number
        continue

    current_place = input_number

    if current_place == before_place + 1 or current_place == before_place - 1:
        answer = True
    else:
        answer = False
        continue

    before_place = current_place

if answer:
    print("T")
else:
    print("F")
0