| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1336907 | iq500 | Post Office (JOI25_ho_t5) | C++20 | 1 ms | 412 KiB |
#include<bits/stdc++.h>
#define int long long
#define pb push_back
#define fir first
#define sec second
using namespace std;
signed main(){
int n; cin>>n;
int p[n+1];
for(int i=1; i<=n; i++){
cin>>p[i];
}
int a, b, t=0; cin>>a>>b;
int loc=a;
while(loc!=b){
if(t>n){
t=-1;
break;
}
t++;
loc=p[loc];
}
cout<<t;
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
