結果

問題 No.216 FAC
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-03 03:08:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 51 ms / 1,000 ms
コード長 1,094 bytes
コンパイル時間 2,742 ms
コンパイル使用メモリ 77,504 KB
実行使用メモリ 50,304 KB
最終ジャッジ日時 2024-04-27 18:24:39
合計ジャッジ時間 4,859 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
50,188 KB
testcase_01 AC 50 ms
50,008 KB
testcase_02 AC 51 ms
50,248 KB
testcase_03 AC 50 ms
50,304 KB
testcase_04 AC 46 ms
49,940 KB
testcase_05 AC 46 ms
50,132 KB
testcase_06 AC 46 ms
49,744 KB
testcase_07 AC 45 ms
49,980 KB
testcase_08 AC 45 ms
50,192 KB
testcase_09 AC 51 ms
50,096 KB
testcase_10 AC 48 ms
50,184 KB
testcase_11 AC 46 ms
50,104 KB
testcase_12 AC 45 ms
50,260 KB
testcase_13 AC 46 ms
50,008 KB
testcase_14 AC 47 ms
49,824 KB
testcase_15 AC 47 ms
50,144 KB
testcase_16 AC 49 ms
50,164 KB
testcase_17 AC 51 ms
49,760 KB
testcase_18 AC 51 ms
50,180 KB
testcase_19 AC 49 ms
49,960 KB
testcase_20 AC 47 ms
50,236 KB
testcase_21 AC 47 ms
50,016 KB
testcase_22 AC 51 ms
50,040 KB
testcase_23 AC 50 ms
50,268 KB
testcase_24 AC 49 ms
50,004 KB
testcase_25 AC 49 ms
50,272 KB
testcase_26 AC 47 ms
50,172 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