結果
問題 |
No.1868 Teleporting Cyanmond
|
ユーザー |
![]() |
提出日時 | 2022-07-10 21:59:48 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 283 bytes |
コンパイル時間 | 3,223 ms |
コンパイル使用メモリ | 245,412 KB |
実行使用メモリ | 6,940 KB |
最終ジャッジ日時 | 2024-06-11 12:46:41 |
合計ジャッジ時間 | 4,209 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | WA * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int N; cin>>N; vector<int> S(N); for(int i=0;i<N;i++){ cin>>S[i]; S[i]--; } int now = 0; int ans = 0; while(now != N-1){ ans++; now = S[now]; } cout<<ans<<endl; }