結果

問題 No.216 FAC
コンテスト
ユーザー uafr_cs
提出日時 2015-05-29 00:51:55
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
RE  
実行時間 -
コード長 688 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,340 ms
コンパイル使用メモリ 84,172 KB
実行使用メモリ 43,392 KB
最終ジャッジ日時 2026-08-09 12:05:55
合計ジャッジ時間 4,597 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_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