結果

問題 No.1868 Teleporting Cyanmond
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-03-11 21:44:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 92,792 KB
最終ジャッジ日時 2023-10-14 06:45:37
合計ジャッジ時間 4,336 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,376 KB
testcase_01 AC 75 ms
71,420 KB
testcase_02 AC 76 ms
71,452 KB
testcase_03 AC 99 ms
90,392 KB
testcase_04 AC 91 ms
85,508 KB
testcase_05 AC 82 ms
76,348 KB
testcase_06 AC 83 ms
76,444 KB
testcase_07 AC 88 ms
82,148 KB
testcase_08 AC 83 ms
79,012 KB
testcase_09 AC 88 ms
81,064 KB
testcase_10 AC 94 ms
88,508 KB
testcase_11 AC 81 ms
76,212 KB
testcase_12 AC 84 ms
77,724 KB
testcase_13 AC 92 ms
81,928 KB
testcase_14 AC 100 ms
90,768 KB
testcase_15 AC 94 ms
85,256 KB
testcase_16 AC 82 ms
76,272 KB
testcase_17 AC 86 ms
77,520 KB
testcase_18 AC 105 ms
92,508 KB
testcase_19 AC 105 ms
92,508 KB
testcase_20 AC 103 ms
92,696 KB
testcase_21 AC 105 ms
92,792 KB
testcase_22 AC 103 ms
92,524 KB
testcase_23 AC 106 ms
92,732 KB
testcase_24 AC 103 ms
92,696 KB
testcase_25 AC 104 ms
92,696 KB
testcase_26 AC 103 ms
92,496 KB
testcase_27 AC 107 ms
92,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
R = [0]+list(map(int,input().split()))+[n]

ans = 0
now = 1

while now < n:
    m = 0
    nex = R[now]

    nind = 0
    for i in range(now,nex+1):
        if m <= R[i]:
            m = R[i]
            nind = i
    ans += 1
    now = nind
print(ans)
0