提出 #76447520
ソースコード 拡げる
//競プロ C++テンプレ
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(),x.end()
#define ll long long
#define pb push_back
int main() {
int N;
cin >> N;
bool isok = true;
vector<pair<int,int>> vp(N);
for(int i = 0; i < N;i++){
cin >> vp.at(i).first;
}
for(int i = 0; i < N;i++){
cin >> vp.at(i).second;
}
for(int i = 0; i < N;i++){
int kk = vp.at(i).second - 1;
if(vp.at(kk).first - 1 != i){
isok = false;
break;
}
}
if(isok){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - The Honest Woodcutters |
| ユーザ | gumi11ta |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 200 |
| コード長 | 655 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3600 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 | 3600 KiB |
| 00_sample_02.txt | AC | 1 ms | 3560 KiB |
| 00_sample_03.txt | AC | 1 ms | 3524 KiB |
| 01_01.txt | AC | 1 ms | 3588 KiB |
| 01_02.txt | AC | 1 ms | 3452 KiB |
| 02_01.txt | AC | 1 ms | 3532 KiB |
| 02_02.txt | AC | 1 ms | 3560 KiB |
| 03_01.txt | AC | 1 ms | 3560 KiB |
| 03_02.txt | AC | 1 ms | 3524 KiB |
| 04_01.txt | AC | 1 ms | 3436 KiB |
| 04_02.txt | AC | 1 ms | 3524 KiB |
| 04_03.txt | AC | 1 ms | 3500 KiB |
| 04_04.txt | AC | 1 ms | 3600 KiB |