結果

問題 No.1992 Tendon Walk
コンテスト
ユーザー ryusuke
提出日時 2022-07-01 21:40:15
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 25 ms / 2,000 ms
+ 105µs
コード長 264 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 62 ms
コンパイル使用メモリ 81,908 KB
実行使用メモリ 55,488 KB
最終ジャッジ日時 2026-09-30 04:36:06
合計ジャッジ時間 1,510 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())

pattern = 'AABBABB'

now = 0
d = 0
i = 0
while True:
    c = pattern[i % 7]
    
    if c == 'A':
        now += 2
        d += 2
    elif c == 'B':
        now -= 1
        d += 1
    
    if now == n:
        print(d)
        exit()

    i += 1
0