結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
Tsukasa_Type
|
| 提出日時 | 2018-02-10 22:41:53 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 633 bytes |
| コンパイル時間 | 3,567 ms |
| コンパイル使用メモリ | 75,092 KB |
| 実行使用メモリ | 55,904 KB |
| 最終ジャッジ日時 | 2024-11-06 13:19:33 |
| 合計ジャッジ時間 | 8,810 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 RE * 15 |
ソースコード
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[n];
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");
}
}
Tsukasa_Type