提出 #76433129
ソースコード 拡げる
// Date: 2026-06-06
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
bool debug_mode = 1;
#else
bool debug_mode = 0;
#endif
using ll = long long;
#define cerr if(debug_mode) cerr
int main() {
cin.tie(0) -> sync_with_stdio(0);
int n; cin >> n;
vector<int> a(n), b(n);
for (auto &i : a) cin >> i;
for (auto &i : b) cin >> i;
bool valid = 1;
for (int i = 0; i < n; i++)
{
if (b[a[i] - 1] - 1 != i)
{
valid = 0;
break;
}
}
cout << (valid ? "Yes" : "No");
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - The Honest Woodcutters |
| ユーザ | Emmetthor |
| 言語 | C++ IOI-Style(GNU++20) (GCC 14.2.0) |
| 得点 | 200 |
| コード長 | 600 Byte |
| 結果 | AC |
| 実行時間 | 0 ms |
| メモリ | 1620 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 | 0 ms | 1580 KiB |
| 00_sample_02.txt | AC | 0 ms | 1620 KiB |
| 00_sample_03.txt | AC | 0 ms | 1580 KiB |
| 01_01.txt | AC | 0 ms | 1580 KiB |
| 01_02.txt | AC | 0 ms | 1580 KiB |
| 02_01.txt | AC | 0 ms | 1580 KiB |
| 02_02.txt | AC | 0 ms | 1580 KiB |
| 03_01.txt | AC | 0 ms | 1580 KiB |
| 03_02.txt | AC | 0 ms | 1580 KiB |
| 04_01.txt | AC | 0 ms | 1580 KiB |
| 04_02.txt | AC | 0 ms | 1580 KiB |
| 04_03.txt | AC | 0 ms | 1580 KiB |
| 04_04.txt | AC | 0 ms | 1580 KiB |