提出 #76436984
ソースコード 拡げる
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
int main() {
int N;
cin >> N;
vector<int> A(N,-1),B(N,-1);
REP(i,N) {
cin >> A[i];
}
REP(i,N) {
int idx;
cin >> idx;
idx--;
B[idx] = i + 1;
}
bool flag = true;
REP(i,N) {
if(A[i] != B[i])flag = false;
}
if(flag)cout << "Yes" << endl;
else cout << "No" << endl;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - The Honest Woodcutters |
| ユーザ | knr_imtr |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 200 |
| コード長 | 625 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3596 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 | 3532 KiB |
| 00_sample_02.txt | AC | 1 ms | 3412 KiB |
| 00_sample_03.txt | AC | 1 ms | 3400 KiB |
| 01_01.txt | AC | 1 ms | 3424 KiB |
| 01_02.txt | AC | 1 ms | 3520 KiB |
| 02_01.txt | AC | 1 ms | 3596 KiB |
| 02_02.txt | AC | 1 ms | 3584 KiB |
| 03_01.txt | AC | 1 ms | 3532 KiB |
| 03_02.txt | AC | 1 ms | 3468 KiB |
| 04_01.txt | AC | 1 ms | 3584 KiB |
| 04_02.txt | AC | 1 ms | 3448 KiB |
| 04_03.txt | AC | 1 ms | 3476 KiB |
| 04_04.txt | AC | 1 ms | 3476 KiB |