結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-27 22:17:10 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 986 bytes |
| コンパイル時間 | 2,613 ms |
| コンパイル使用メモリ | 80,616 KB |
| 実行使用メモリ | 56,168 KB |
| 最終ジャッジ日時 | 2024-06-25 12:55:33 |
| 合計ジャッジ時間 | 7,947 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 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");
}
}
}