結果
問題 |
No.216 FAC
|
ユーザー |
![]() |
提出日時 | 2020-11-11 08:40:27 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 148 ms / 1,000 ms |
コード長 | 642 bytes |
コンパイル時間 | 2,475 ms |
コンパイル使用メモリ | 74,800 KB |
実行使用メモリ | 41,856 KB |
最終ジャッジ日時 | 2024-07-22 18:18:48 |
合計ジャッジ時間 | 7,843 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] points = new int[n]; for (int i = 0; i < n; i++) { points[i] = sc.nextInt(); } int[] persons = new int[101]; for (int i = 0; i < n; i++) { persons[sc.nextInt()] += points[i]; } for (int i = 1; i < persons.length; i++) { if (persons[0] < persons[i]) { System.out.println("NO"); return; } } System.out.println("YES"); } }