提出 #76445285
ソースコード 拡げる
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] A = new int[n];
int[] B = new int[n];
for(int i = 0; i<n; i++){
A[i] = sc.nextInt();
}
for(int i = 0; i<n; i++){
B[i] = sc.nextInt();
}
for(int i = 0; i<n; i++){
if(B[A[i]-1] != i+1){
System.out.println("No");
return;
}
}
System.out.println("Yes");
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - The Honest Woodcutters |
| ユーザ | jayeshsolanki |
| 言語 | Java24 (OpenJDK 24.0.2) |
| 得点 | 200 |
| コード長 | 536 Byte |
| 結果 | AC |
| 実行時間 | 70 ms |
| メモリ | 40664 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 | 70 ms | 39988 KiB |
| 00_sample_02.txt | AC | 62 ms | 40564 KiB |
| 00_sample_03.txt | AC | 62 ms | 40664 KiB |
| 01_01.txt | AC | 63 ms | 39988 KiB |
| 01_02.txt | AC | 68 ms | 40380 KiB |
| 02_01.txt | AC | 61 ms | 40272 KiB |
| 02_02.txt | AC | 70 ms | 40584 KiB |
| 03_01.txt | AC | 68 ms | 40632 KiB |
| 03_02.txt | AC | 68 ms | 40580 KiB |
| 04_01.txt | AC | 61 ms | 40392 KiB |
| 04_02.txt | AC | 64 ms | 39936 KiB |
| 04_03.txt | AC | 70 ms | 40244 KiB |
| 04_04.txt | AC | 69 ms | 40632 KiB |