結果

問題 No.216 FAC
コンテスト
ユーザー uafr_cs
提出日時 2015-05-29 00:51:55
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
RE  
実行時間 -
コード長 688 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,901 ms
コンパイル使用メモリ 85,000 KB
実行使用メモリ 47,228 KB
最終ジャッジ日時 2026-03-27 22:56:35
合計ジャッジ時間 6,263 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 RE * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		int[] as = new int[N];
		int[] bs = new int[N];
		
		for(int i = 0; i < N; i++){
			final int a = sc.nextInt();
			as[i] = a;
		}
		
		int[] points = new int[100];
		for(int i = 0; i < N; i++){
			final int b = sc.nextInt();
			
			points[b] += as[i];
		}
		
		int max = Integer.MIN_VALUE, max_pos = -1;
		for(int i = 0; i < 100; i++){
			if(max < points[i]){
				max = points[i];
				max_pos = i;
			}
		}
		
		
		System.out.println(max_pos == 0 ? "YES" : "NO");
	}
	
}
0