結果

問題 No.216 FAC
ユーザー uafr_csuafr_cs
提出日時 2015-05-29 00:43:01
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 2,019 ms
コンパイル使用メモリ 72,296 KB
実行使用メモリ 57,976 KB
最終ジャッジ日時 2023-09-20 15:06:34
合計ジャッジ時間 6,674 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,872 KB
testcase_01 AC 123 ms
55,648 KB
testcase_02 AC 123 ms
56,052 KB
testcase_03 AC 140 ms
55,768 KB
testcase_04 AC 130 ms
55,704 KB
testcase_05 AC 129 ms
55,968 KB
testcase_06 AC 123 ms
55,528 KB
testcase_07 AC 122 ms
56,032 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 121 ms
55,660 KB
testcase_12 WA -
testcase_13 AC 125 ms
55,708 KB
testcase_14 WA -
testcase_15 AC 125 ms
53,876 KB
testcase_16 AC 141 ms
55,832 KB
testcase_17 AC 141 ms
55,528 KB
testcase_18 WA -
testcase_19 AC 139 ms
55,708 KB
testcase_20 WA -
testcase_21 AC 138 ms
55,560 KB
testcase_22 AC 138 ms
55,376 KB
testcase_23 AC 136 ms
55,624 KB
testcase_24 WA -
testcase_25 AC 137 ms
55,604 KB
testcase_26 AC 119 ms
56,012 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;
		}
		
		for(int i = 0; i < N; i++){
			final int b = sc.nextInt();
			bs[i] = b;
		}
		
		int solved = 0, unsolved = 0;
		for(int i = 0; i < N; i++){
			if(bs[i] == 0){
				unsolved += as[i];
			}else{
				solved += as[i];
			}
		}
		
		System.out.println(solved <= unsolved ? "YES" : "NO");
	}
	
}
0