結果

問題 No.216 FAC
ユーザー uafr_csuafr_cs
提出日時 2015-05-29 00:51:55
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 688 bytes
コンパイル時間 2,073 ms
コンパイル使用メモリ 71,868 KB
実行使用メモリ 57,816 KB
最終ジャッジ日時 2023-09-20 15:07:06
合計ジャッジ時間 6,930 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,880 KB
testcase_01 AC 123 ms
55,792 KB
testcase_02 AC 125 ms
55,564 KB
testcase_03 RE -
testcase_04 AC 134 ms
55,696 KB
testcase_05 RE -
testcase_06 AC 124 ms
55,640 KB
testcase_07 AC 125 ms
55,792 KB
testcase_08 AC 126 ms
55,776 KB
testcase_09 AC 126 ms
55,712 KB
testcase_10 AC 127 ms
55,716 KB
testcase_11 AC 126 ms
55,600 KB
testcase_12 AC 128 ms
55,796 KB
testcase_13 RE -
testcase_14 AC 125 ms
55,960 KB
testcase_15 RE -
testcase_16 AC 142 ms
55,624 KB
testcase_17 RE -
testcase_18 AC 142 ms
55,440 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 142 ms
55,552 KB
testcase_22 RE -
testcase_23 AC 141 ms
55,844 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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