結果

問題 No.216 FAC
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-08-15 15:56:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 1,000 ms
コード長 831 bytes
コンパイル時間 3,562 ms
コンパイル使用メモリ 75,708 KB
実行使用メモリ 56,616 KB
最終ジャッジ日時 2023-08-05 02:52:22
合計ジャッジ時間 8,305 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,304 KB
testcase_01 AC 118 ms
56,568 KB
testcase_02 AC 125 ms
56,252 KB
testcase_03 AC 138 ms
56,520 KB
testcase_04 AC 128 ms
55,840 KB
testcase_05 AC 127 ms
55,932 KB
testcase_06 AC 120 ms
56,468 KB
testcase_07 AC 120 ms
55,604 KB
testcase_08 AC 122 ms
55,716 KB
testcase_09 AC 123 ms
56,340 KB
testcase_10 AC 127 ms
56,480 KB
testcase_11 AC 121 ms
55,756 KB
testcase_12 AC 124 ms
55,960 KB
testcase_13 AC 121 ms
55,928 KB
testcase_14 AC 120 ms
55,792 KB
testcase_15 AC 120 ms
55,940 KB
testcase_16 AC 139 ms
54,360 KB
testcase_17 AC 139 ms
56,416 KB
testcase_18 AC 140 ms
56,364 KB
testcase_19 AC 138 ms
56,320 KB
testcase_20 AC 141 ms
56,156 KB
testcase_21 AC 139 ms
56,616 KB
testcase_22 AC 139 ms
56,368 KB
testcase_23 AC 136 ms
56,340 KB
testcase_24 AC 138 ms
56,200 KB
testcase_25 AC 137 ms
56,304 KB
testcase_26 AC 122 ms
55,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class No0216 {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);

	static void solve() {
		int n = in.nextInt();
		int[] a = new int[n];

		int[] s = new int[101];
		for (int i=0; i<n; i++) {
			a[i] = in.nextInt();
		}
		for (int i=0; i<n; i++) {
			int b = in.nextInt();
			s[b] += a[i];
		}

		int x = s[0];
		Arrays.sort(s);
		out.println(x >= s[100] ? "YES" : "NO");
	}

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		solve();
		out.flush();

		long end = System.currentTimeMillis();
		//trace(end-start + "ms");
		in.close();
		out.close();
	}

	static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}
0