提出 #76432508
ソースコード 拡げる
#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;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - The Honest Woodcutters |
| ユーザ | Axiom_ |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 200 |
| コード長 | 348 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3536 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 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 |