結果

問題 No.216 FAC
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-08-15 15:56:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 831 bytes
コンパイル時間 4,014 ms
コンパイル使用メモリ 80,076 KB
実行使用メモリ 54,756 KB
最終ジャッジ日時 2024-04-23 01:26:52
合計ジャッジ時間 7,523 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
53,000 KB
testcase_01 AC 121 ms
54,088 KB
testcase_02 AC 122 ms
54,256 KB
testcase_03 AC 128 ms
54,224 KB
testcase_04 AC 135 ms
54,548 KB
testcase_05 AC 113 ms
52,972 KB
testcase_06 AC 106 ms
52,856 KB
testcase_07 AC 125 ms
54,144 KB
testcase_08 AC 111 ms
53,544 KB
testcase_09 AC 120 ms
54,376 KB
testcase_10 AC 112 ms
53,372 KB
testcase_11 AC 112 ms
54,276 KB
testcase_12 AC 120 ms
54,200 KB
testcase_13 AC 108 ms
53,096 KB
testcase_14 AC 125 ms
54,136 KB
testcase_15 AC 122 ms
54,020 KB
testcase_16 AC 132 ms
54,216 KB
testcase_17 AC 130 ms
54,756 KB
testcase_18 AC 124 ms
53,920 KB
testcase_19 AC 130 ms
54,304 KB
testcase_20 AC 132 ms
54,280 KB
testcase_21 AC 130 ms
54,376 KB
testcase_22 AC 136 ms
54,560 KB
testcase_23 AC 129 ms
54,620 KB
testcase_24 AC 130 ms
54,528 KB
testcase_25 AC 126 ms
54,640 KB
testcase_26 AC 107 ms
54,260 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