結果

問題 No.216 FAC
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-10 22:42:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 635 bytes
コンパイル時間 2,345 ms
コンパイル使用メモリ 75,060 KB
実行使用メモリ 56,480 KB
最終ジャッジ日時 2024-04-24 06:16:07
合計ジャッジ時間 5,743 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 108 ms
41,488 KB
testcase_02 AC 114 ms
41,320 KB
testcase_03 AC 127 ms
41,780 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 108 ms
41,188 KB
testcase_08 AC 103 ms
40,408 KB
testcase_09 AC 100 ms
40,480 KB
testcase_10 AC 108 ms
41,340 KB
testcase_11 WA -
testcase_12 AC 95 ms
40,012 KB
testcase_13 WA -
testcase_14 AC 100 ms
40,748 KB
testcase_15 WA -
testcase_16 AC 124 ms
42,072 KB
testcase_17 AC 118 ms
41,656 KB
testcase_18 AC 125 ms
41,540 KB
testcase_19 AC 145 ms
41,600 KB
testcase_20 AC 123 ms
41,468 KB
testcase_21 AC 122 ms
41,120 KB
testcase_22 AC 120 ms
41,612 KB
testcase_23 AC 123 ms
42,032 KB
testcase_24 AC 117 ms
41,336 KB
testcase_25 AC 122 ms
41,624 KB
testcase_26 AC 107 ms
40,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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");
	}
}
0