結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
41,104 KB
testcase_01 AC 105 ms
40,356 KB
testcase_02 AC 124 ms
41,232 KB
testcase_03 AC 144 ms
41,636 KB
testcase_04 AC 126 ms
41,480 KB
testcase_05 AC 121 ms
41,228 KB
testcase_06 AC 116 ms
41,532 KB
testcase_07 AC 114 ms
40,976 KB
testcase_08 AC 113 ms
41,260 KB
testcase_09 AC 105 ms
40,168 KB
testcase_10 AC 113 ms
40,340 KB
testcase_11 AC 119 ms
41,288 KB
testcase_12 AC 120 ms
41,552 KB
testcase_13 AC 113 ms
41,372 KB
testcase_14 AC 123 ms
40,312 KB
testcase_15 AC 111 ms
40,332 KB
testcase_16 AC 135 ms
41,484 KB
testcase_17 AC 140 ms
41,776 KB
testcase_18 AC 143 ms
41,720 KB
testcase_19 AC 130 ms
41,432 KB
testcase_20 AC 126 ms
41,488 KB
testcase_21 AC 129 ms
41,468 KB
testcase_22 AC 125 ms
41,764 KB
testcase_23 AC 132 ms
41,596 KB
testcase_24 AC 143 ms
41,832 KB
testcase_25 AC 142 ms
41,612 KB
testcase_26 AC 117 ms
41,376 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[100]?"YES":"NO");
	}
}
0