結果

問題 No.216 FAC
ユーザー uafr_csuafr_cs
提出日時 2015-05-29 00:52:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 158 ms / 1,000 ms
コード長 688 bytes
コンパイル時間 2,668 ms
コンパイル使用メモリ 75,392 KB
実行使用メモリ 41,980 KB
最終ジャッジ日時 2024-04-23 01:23:11
合計ジャッジ時間 6,983 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
40,348 KB
testcase_01 AC 134 ms
41,628 KB
testcase_02 AC 135 ms
41,572 KB
testcase_03 AC 150 ms
41,760 KB
testcase_04 AC 145 ms
41,648 KB
testcase_05 AC 147 ms
41,632 KB
testcase_06 AC 134 ms
41,344 KB
testcase_07 AC 119 ms
40,328 KB
testcase_08 AC 134 ms
41,608 KB
testcase_09 AC 133 ms
41,288 KB
testcase_10 AC 136 ms
41,552 KB
testcase_11 AC 141 ms
41,524 KB
testcase_12 AC 137 ms
41,596 KB
testcase_13 AC 130 ms
41,492 KB
testcase_14 AC 137 ms
41,584 KB
testcase_15 AC 138 ms
41,096 KB
testcase_16 AC 151 ms
41,828 KB
testcase_17 AC 151 ms
41,428 KB
testcase_18 AC 155 ms
41,884 KB
testcase_19 AC 152 ms
41,980 KB
testcase_20 AC 145 ms
41,584 KB
testcase_21 AC 154 ms
41,636 KB
testcase_22 AC 158 ms
41,832 KB
testcase_23 AC 150 ms
41,456 KB
testcase_24 AC 154 ms
41,776 KB
testcase_25 AC 150 ms
41,728 KB
testcase_26 AC 133 ms
41,648 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