結果

問題 No.216 FAC
ユーザー uafr_csuafr_cs
提出日時 2015-05-29 00:52:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 1,000 ms
コード長 688 bytes
コンパイル時間 2,760 ms
コンパイル使用メモリ 71,716 KB
実行使用メモリ 56,404 KB
最終ジャッジ日時 2023-08-05 02:47:48
合計ジャッジ時間 7,674 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,848 KB
testcase_01 AC 118 ms
55,816 KB
testcase_02 AC 119 ms
55,676 KB
testcase_03 AC 134 ms
55,744 KB
testcase_04 AC 127 ms
55,856 KB
testcase_05 AC 124 ms
56,008 KB
testcase_06 AC 119 ms
56,092 KB
testcase_07 AC 117 ms
55,996 KB
testcase_08 AC 118 ms
56,148 KB
testcase_09 AC 119 ms
56,096 KB
testcase_10 AC 120 ms
55,876 KB
testcase_11 AC 121 ms
56,244 KB
testcase_12 AC 119 ms
55,804 KB
testcase_13 AC 118 ms
55,988 KB
testcase_14 AC 120 ms
55,996 KB
testcase_15 AC 121 ms
56,404 KB
testcase_16 AC 136 ms
56,140 KB
testcase_17 AC 139 ms
56,208 KB
testcase_18 AC 138 ms
55,668 KB
testcase_19 AC 135 ms
55,920 KB
testcase_20 AC 135 ms
55,848 KB
testcase_21 AC 138 ms
56,092 KB
testcase_22 AC 137 ms
55,836 KB
testcase_23 AC 133 ms
55,964 KB
testcase_24 AC 134 ms
55,872 KB
testcase_25 AC 137 ms
55,880 KB
testcase_26 AC 120 ms
55,856 KB
権限があれば一括ダウンロードができます

ソースコード

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[101];
		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 < 101; i++){
			if(max < points[i]){
				max = points[i];
				max_pos = i;
			}
		}
		
		
		System.out.println(max_pos == 0 ? "YES" : "NO");
	}
	
}
0