結果
| 問題 |
No.1868 Teleporting Cyanmond
|
| コンテスト | |
| ユーザー |
keisuke6
|
| 提出日時 | 2022-07-10 22:00:37 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 286 bytes |
| コンパイル時間 | 2,693 ms |
| コンパイル使用メモリ | 245,516 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-11 12:47:54 |
| 合計ジャッジ時間 | 4,079 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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-1);
for(int i=0;i<N-1;i++){
cin>>S[i];
S[i]--;
}
int now = 0;
int ans = 0;
while(now != N-1){
ans++;
now = S[now];
}
cout<<ans<<endl;
}
keisuke6