結果

問題 No.1868 Teleporting Cyanmond
コンテスト
ユーザー kept1994
提出日時 2022-03-19 03:44:47
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 584 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 567 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 95,744 KB
最終ジャッジ日時 2026-04-19 18:44:12
合計ジャッジ時間 3,941 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python3

def main():
    N = int(input())
    R = list(map(lambda i: int(i) - 1, input().split())) + [N - 1]
    now = 0
    next = 0
    temp = 0
    for i in range(R[0] + 1):
        if R[i] >= temp:
            next = i
            temp = R[i]
    ans = 0
    while now < N - 1:
        checked = now
        now = next
        temp = 0
        for i in range(checked + 1, R[next] + 1):
            if R[i] >= temp:
                next = i
                temp = R[i]
        ans += 1
        print(now, next)
    print(ans)



if __name__ == '__main__':
    main()
0