結果

問題 No.216 FAC
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-10 22:41:19
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 632 bytes
コンパイル時間 1,910 ms
コンパイル使用メモリ 75,348 KB
実行使用メモリ 41,832 KB
最終ジャッジ日時 2024-04-24 06:12:07
合計ジャッジ時間 6,237 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
41,324 KB
testcase_01 AC 102 ms
40,192 KB
testcase_02 WA -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 121 ms
41,432 KB
testcase_08 WA -
testcase_09 AC 110 ms
41,384 KB
testcase_10 AC 110 ms
41,400 KB
testcase_11 AC 104 ms
40,136 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 126 ms
41,444 KB
testcase_17 RE -
testcase_18 AC 123 ms
41,492 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 130 ms
41,432 KB
testcase_22 RE -
testcase_23 AC 138 ms
41,760 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

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