結果

問題 No.216 FAC
ユーザー 37zigen37zigen
提出日時 2016-03-30 14:23:21
言語 Java19
(openjdk 21)
結果
AC  
実行時間 145 ms / 1,000 ms
コード長 496 bytes
コンパイル時間 4,109 ms
コンパイル使用メモリ 71,868 KB
実行使用メモリ 56,504 KB
最終ジャッジ日時 2023-08-05 03:11:21
合計ジャッジ時間 7,039 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,644 KB
testcase_01 AC 119 ms
55,252 KB
testcase_02 AC 120 ms
55,552 KB
testcase_03 AC 135 ms
55,424 KB
testcase_04 AC 129 ms
55,372 KB
testcase_05 AC 126 ms
55,856 KB
testcase_06 AC 120 ms
55,308 KB
testcase_07 AC 119 ms
55,828 KB
testcase_08 AC 120 ms
55,368 KB
testcase_09 AC 120 ms
56,184 KB
testcase_10 AC 120 ms
55,340 KB
testcase_11 AC 127 ms
55,420 KB
testcase_12 AC 130 ms
55,580 KB
testcase_13 AC 128 ms
55,588 KB
testcase_14 AC 121 ms
55,248 KB
testcase_15 AC 120 ms
55,552 KB
testcase_16 AC 136 ms
55,460 KB
testcase_17 AC 136 ms
56,384 KB
testcase_18 AC 135 ms
55,844 KB
testcase_19 AC 134 ms
56,504 KB
testcase_20 AC 139 ms
55,176 KB
testcase_21 AC 136 ms
55,460 KB
testcase_22 AC 145 ms
55,836 KB
testcase_23 AC 135 ms
55,432 KB
testcase_24 AC 133 ms
55,320 KB
testcase_25 AC 145 ms
55,440 KB
testcase_26 AC 118 ms
56,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder216;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		int[] b=new int[n];
		int[] p=new int[101];
		for(int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			b[i]=sc.nextInt();
			p[b[i]]+=a[i];
		}
		int pp=p[0];
		for(int i=1;i<101;i++){
			if(pp<p[i]){
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
}
0