提出 #76448672
ソースコード 拡げる
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
Integer n=sc.nextInt();
int[] a=new int[101];
int[] b=new int[101];
for(int i=1;i<=n;i++){
a[i]=sc.nextInt();
}
for(int i=1;i<=n;i++){
int bvalue=sc.nextInt();
int val=a[bvalue];
if(val!=i){
System.out.println("No");
return;
}
}
System.out.println("Yes");
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - The Honest Woodcutters |
| ユーザ | renu_ |
| 言語 | Java24 (OpenJDK 24.0.2) |
| 得点 | 200 |
| コード長 | 591 Byte |
| 結果 | AC |
| 実行時間 | 69 ms |
| メモリ | 40864 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 | 69 ms | 40428 KiB |
| 00_sample_02.txt | AC | 65 ms | 40276 KiB |
| 00_sample_03.txt | AC | 58 ms | 40028 KiB |
| 01_01.txt | AC | 61 ms | 40644 KiB |
| 01_02.txt | AC | 63 ms | 40432 KiB |
| 02_01.txt | AC | 58 ms | 39916 KiB |
| 02_02.txt | AC | 66 ms | 40760 KiB |
| 03_01.txt | AC | 62 ms | 40672 KiB |
| 03_02.txt | AC | 67 ms | 40744 KiB |
| 04_01.txt | AC | 61 ms | 40456 KiB |
| 04_02.txt | AC | 55 ms | 39792 KiB |
| 04_03.txt | AC | 64 ms | 40864 KiB |
| 04_04.txt | AC | 62 ms | 40120 KiB |