結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2018-02-10 22:42:55 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 635 bytes |
コンパイル時間 | 2,421 ms |
コンパイル使用メモリ | 75,136 KB |
実行使用メモリ | 47,960 KB |
最終ジャッジ日時 | 2024-11-06 13:22:32 |
合計ジャッジ時間 | 7,586 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 18 WA * 6 |
ソースコード
import java.util.*;public class Main {static Scanner sc = new Scanner(System.in);public static void main(String[] args) {int n = sc.nextInt();int[] score = new int[n];for (int i=0; i<n; i++) {score[i] = sc.nextInt();}int[] num = new int[n];int[] got_score = new int[101];for (int i=0; i<n; i++) {num[i] = sc.nextInt();got_score[num[i]] += score[i];}int myscore = got_score[0]; //主人公のスコアを避難させるgot_score[0] = 0; //主人公のスコアを消して……Arrays.sort(got_score); //ソート。System.out.println(myscore>=got_score[n-1]?"YES":"NO");}}