結果

問題 No.216 FAC
ユーザー Mcpu3Mcpu3
提出日時 2018-06-22 20:57:41
言語 Java
(openjdk 23)
結果
AC  
実行時間 149 ms / 1,000 ms
コード長 427 bytes
コンパイル時間 2,065 ms
コンパイル使用メモリ 75,012 KB
実行使用メモリ 54,352 KB
最終ジャッジ日時 2024-06-30 18:06:05
合計ジャッジ時間 6,695 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

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