結果

問題 No.1992 Tendon Walk
ユーザー 👑 rin204rin204
提出日時 2022-07-01 21:22:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-05-04 15:20:15
合計ジャッジ時間 907 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,224 KB
testcase_01 AC 32 ms
51,712 KB
testcase_02 AC 33 ms
52,224 KB
testcase_03 AC 32 ms
51,712 KB
testcase_04 AC 31 ms
51,712 KB
testcase_05 AC 31 ms
51,840 KB
testcase_06 AC 31 ms
51,840 KB
testcase_07 AC 33 ms
51,840 KB
testcase_08 AC 31 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())
ans = [-1] * 15
pos = 0
t = 0
cnt = 0
lst = [2, 2, -1, -1, 2, -1, -1]
while 1:
    try:
        if ans[pos] == -1:
            ans[pos] = cnt
    except:
        break
    cnt += abs(lst[t])
    pos += lst[t]
    t += 1
    if t == 7:
        t = 0

print(ans[x])
0