結果

問題 No.1992 Tendon Walk
コンテスト
ユーザー deepjuggling
提出日時 2023-01-19 07:19:29
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 337 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 232 ms
コンパイル使用メモリ 85,508 KB
実行使用メモリ 54,088 KB
最終ジャッジ日時 2026-03-05 14:56:44
合計ジャッジ時間 1,126 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def mae(du):
    global y
    global ans
    if du == 1:
        y += 2
        ans += 2
    if du == -1:
        y -= 1
        ans += 1
    if y == x:
        print(ans)
        exit()
#    print(y,ans)
x = int(input())
ans = 0
y = 0
for i in range(100):
    mae(1)
    mae(1)
    mae(-1)
    mae(-1)
    mae(1)
    mae(-1)
    mae(-1)
0