Submission #76442224
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 105;
int a[MAXN], b[MAXN], n;
signed main(){
cin >> n;
for (int i=1; i<=n; i++) cin >> a[i];
for (int i=1; i<=n; i++) cin >> b[i];
for (int i=1; i<=n; i++)
{
if (b[a[i]]!=i)
{
cout << "No";
return 0;
}
}
cout << "Yes";
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - The Honest Woodcutters |
| User | nxzwcry |
| Language | C++23 (GCC 15.2.0) |
| Score | 200 |
| Code Size | 362 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3600 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 | 3556 KiB |
| 00_sample_02.txt | AC | 1 ms | 3488 KiB |
| 00_sample_03.txt | AC | 1 ms | 3600 KiB |
| 01_01.txt | AC | 1 ms | 3452 KiB |
| 01_02.txt | AC | 1 ms | 3376 KiB |
| 02_01.txt | AC | 1 ms | 3364 KiB |
| 02_02.txt | AC | 1 ms | 3372 KiB |
| 03_01.txt | AC | 1 ms | 3320 KiB |
| 03_02.txt | AC | 1 ms | 3456 KiB |
| 04_01.txt | AC | 1 ms | 3456 KiB |
| 04_02.txt | AC | 1 ms | 3372 KiB |
| 04_03.txt | AC | 1 ms | 3528 KiB |
| 04_04.txt | AC | 1 ms | 3572 KiB |