結果
問題 |
No.216 FAC
|
ユーザー |
![]() |
提出日時 | 2015-05-29 00:51:55 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 688 bytes |
コンパイル時間 | 2,065 ms |
コンパイル使用メモリ | 74,300 KB |
実行使用メモリ | 41,896 KB |
最終ジャッジ日時 | 2024-07-06 10:15:22 |
合計ジャッジ時間 | 5,744 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 RE * 11 |
ソースコード
import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); int[] as = new int[N]; int[] bs = new int[N]; for(int i = 0; i < N; i++){ final int a = sc.nextInt(); as[i] = a; } int[] points = new int[100]; for(int i = 0; i < N; i++){ final int b = sc.nextInt(); points[b] += as[i]; } int max = Integer.MIN_VALUE, max_pos = -1; for(int i = 0; i < 100; i++){ if(max < points[i]){ max = points[i]; max_pos = i; } } System.out.println(max_pos == 0 ? "YES" : "NO"); } }