結果
| 問題 | No.216 FAC |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-27 22:21:10 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 1,000 ms |
| コード長 | 986 bytes |
| 記録 | |
| コンパイル時間 | 2,889 ms |
| コンパイル使用メモリ | 86,308 KB |
| 実行使用メモリ | 47,292 KB |
| 最終ジャッジ日時 | 2026-03-11 21:31:19 |
| 合計ジャッジ時間 | 4,337 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
package net.ipipip0129.yukicoder.no216;
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Stream;
// 課題 Stream API を使う
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int cnt = Integer.parseInt(scan.nextLine());
int[] point_list = Stream.of(scan.nextLine().split(" "))
.mapToInt(Integer::parseInt)
.toArray();
int[] answers = Stream.of(scan.nextLine().split(" "))
.mapToInt(Integer::parseInt)
.toArray();
int[] get_points = new int[Arrays.stream(answers).max().getAsInt() + 1];
for (int i = 0; i < point_list.length; i++) get_points[answers[i]] += point_list[i];
if (get_points[0] == Arrays.stream(get_points).max().getAsInt()) {
System.out.println("YES");
}else {
System.out.println("NO");
}
}
}