結果

問題 No.216 FAC
ユーザー Mcpu3Mcpu3
提出日時 2018-06-22 20:57:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 1,000 ms
コード長 427 bytes
コンパイル時間 1,928 ms
コンパイル使用メモリ 71,428 KB
実行使用メモリ 56,304 KB
最終ジャッジ日時 2023-09-13 08:06:48
合計ジャッジ時間 6,606 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,804 KB
testcase_01 AC 120 ms
55,868 KB
testcase_02 AC 118 ms
55,868 KB
testcase_03 AC 133 ms
55,828 KB
testcase_04 AC 126 ms
56,016 KB
testcase_05 AC 125 ms
56,096 KB
testcase_06 AC 119 ms
55,972 KB
testcase_07 AC 117 ms
55,784 KB
testcase_08 AC 117 ms
56,156 KB
testcase_09 AC 118 ms
56,124 KB
testcase_10 AC 119 ms
56,176 KB
testcase_11 AC 118 ms
56,040 KB
testcase_12 AC 119 ms
56,176 KB
testcase_13 AC 120 ms
55,844 KB
testcase_14 AC 118 ms
56,140 KB
testcase_15 AC 119 ms
56,044 KB
testcase_16 AC 134 ms
56,132 KB
testcase_17 AC 134 ms
54,108 KB
testcase_18 AC 133 ms
56,304 KB
testcase_19 AC 139 ms
56,004 KB
testcase_20 AC 136 ms
56,040 KB
testcase_21 AC 135 ms
55,752 KB
testcase_22 AC 142 ms
56,164 KB
testcase_23 AC 135 ms
53,924 KB
testcase_24 AC 135 ms
55,536 KB
testcase_25 AC 136 ms
55,804 KB
testcase_26 AC 119 ms
55,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no216{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int n,a[]=new int[100],b,c[]=new int[101],i,m=0;
		n=stdIn.nextInt();
		for(i=0;i<n;i++) a[i]=stdIn.nextInt();
		for(i=0;i<n;i++) {
			b=stdIn.nextInt();
			c[b]+=a[i];
		}
		for(i=1;i<101;i++) if(c[i]>m) m=c[i];
		if(m<=c[0]) System.out.print("YES");
		else System.out.print("NO");
	}
}
0