結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
spacia
|
| 提出日時 | 2016-01-02 08:18:11 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 1,000 ms |
| コード長 | 750 bytes |
| コンパイル時間 | 2,269 ms |
| コンパイル使用メモリ | 74,224 KB |
| 実行使用メモリ | 36,928 KB |
| 最終ジャッジ日時 | 2024-10-15 00:44:51 |
| 合計ジャッジ時間 | 3,927 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
import java.io.*;
import java.util.*;
class Main216 {
public static void out (Object o) {
System.out.println(o);
}
public static void main (String[] args) throws IOException {
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int max = 100;
int[] score = new int[max + 1];
String[] line1 = br.readLine().split(" ");
String[] line2 = br.readLine().split(" ");
for (int i = 0; i < n; i++) {
int s = Integer.parseInt(line1[i]);
int w = Integer.parseInt(line2[i]);
score[w] += s;
}
int maxScore = -1;
for (int i = 1; i <= max; i++) {
maxScore = Math.max(maxScore , score[i]);
}
out(score[0] >= maxScore ? "YES" : "NO");
}
}
spacia