Submission #76432508
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
const int N=110;
int n,a[N],x;
bool f=1;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
for(int i=1;i<=n;i++){
cin>>x;
if(a[x]==i)continue;
else {
f=0;break;
}
}
if(f)cout<<"Yes";
else cout<<"No";
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - The Honest Woodcutters |
| User | Axiom_ |
| Language | C++23 (GCC 15.2.0) |
| Score | 200 |
| Code Size | 348 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3536 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_01.txt, 01_02.txt, 02_01.txt, 02_02.txt, 03_01.txt, 03_02.txt, 04_01.txt, 04_02.txt, 04_03.txt, 04_04.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3352 KiB |
| 00_sample_02.txt | AC | 1 ms | 3400 KiB |
| 00_sample_03.txt | AC | 1 ms | 3464 KiB |
| 01_01.txt | AC | 1 ms | 3380 KiB |
| 01_02.txt | AC | 1 ms | 3480 KiB |
| 02_01.txt | AC | 1 ms | 3448 KiB |
| 02_02.txt | AC | 1 ms | 3384 KiB |
| 03_01.txt | AC | 1 ms | 3536 KiB |
| 03_02.txt | AC | 1 ms | 3512 KiB |
| 04_01.txt | AC | 1 ms | 3460 KiB |
| 04_02.txt | AC | 1 ms | 3464 KiB |
| 04_03.txt | AC | 1 ms | 3520 KiB |
| 04_04.txt | AC | 1 ms | 3388 KiB |