結果
問題 |
No.1868 Teleporting Cyanmond
|
ユーザー |
|
提出日時 | 2022-03-12 12:30:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 356 bytes |
コンパイル時間 | 723 ms |
コンパイル使用メモリ | 63,864 KB |
実行使用メモリ | 13,884 KB |
最終ジャッジ日時 | 2024-09-16 18:24:26 |
合計ジャッジ時間 | 7,449 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 RE * 1 |
other | TLE * 1 -- * 24 |
ソースコード
#include<iostream> using namespace std; int main() { int n; cin >> n; int R[n]; for(int i=0; i<n;i++)cin >>R[i]; int p=0; int ans = 0; while (R[p] != n) { int to = 0; for(int i=p; i<R[p];i++) { if (to < R[i]) to = R[i]; } ++ans; p = to; } cout << ans << endl; }