結果

問題 No.216 FAC
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-03 03:08:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 47 ms / 1,000 ms
コード長 1,094 bytes
コンパイル時間 4,768 ms
コンパイル使用メモリ 74,308 KB
実行使用メモリ 49,684 KB
最終ジャッジ日時 2023-08-10 00:21:55
合計ジャッジ時間 6,279 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
49,260 KB
testcase_01 AC 46 ms
49,620 KB
testcase_02 AC 45 ms
49,236 KB
testcase_03 AC 46 ms
49,248 KB
testcase_04 AC 46 ms
49,324 KB
testcase_05 AC 45 ms
47,816 KB
testcase_06 AC 44 ms
49,200 KB
testcase_07 AC 45 ms
49,684 KB
testcase_08 AC 45 ms
49,352 KB
testcase_09 AC 45 ms
47,248 KB
testcase_10 AC 45 ms
49,448 KB
testcase_11 AC 44 ms
49,480 KB
testcase_12 AC 45 ms
49,352 KB
testcase_13 AC 45 ms
49,324 KB
testcase_14 AC 45 ms
49,676 KB
testcase_15 AC 46 ms
49,360 KB
testcase_16 AC 47 ms
47,328 KB
testcase_17 AC 47 ms
49,348 KB
testcase_18 AC 46 ms
47,396 KB
testcase_19 AC 47 ms
49,536 KB
testcase_20 AC 46 ms
49,532 KB
testcase_21 AC 45 ms
49,240 KB
testcase_22 AC 46 ms
49,360 KB
testcase_23 AC 47 ms
49,184 KB
testcase_24 AC 46 ms
49,220 KB
testcase_25 AC 45 ms
49,140 KB
testcase_26 AC 46 ms
49,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No216 {
	public static void main(String[] args) {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int N = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			String[] str2 = br.readLine().split(" ");
			int[] player = new int[101];
			sakusei(N,player,str,str2);
			Hantei(player);
			
		}catch(IOException e){
			e.getStackTrace();
		}catch(NumberFormatException e){
			e.getStackTrace();
		}
	}
	
	
	public static void sakusei(int N,int[] x, String[] a, String[] b){
		int[] score= new int[N];
		int[] ansP = new int[N];
		for(int i=0; i < N; i++){
			score[i] = Integer.parseInt(a[i]);
			ansP[i] = Integer.parseInt(b[i]);
			x[ansP[i]] += score[i];
		}
	}
	
	public static int getMax(int[] x){
		int max = 0;
		for(int i=0; i< x.length; i++)
			if(x[i] > max) max = x[i];
		return max;
	}
	
	public static void Hantei(int[] x){
		if(x[0] >= getMax(x)) System.out.println("YES");
		else System.out.println("NO");
	}
}
0