結果

問題 No.216 FAC
ユーザー togaerrortogaerror
提出日時 2015-05-27 22:47:53
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 5,084 KB
最終ジャッジ日時 2023-09-20 16:50:01
合計ジャッジ時間 1,316 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,848 KB
testcase_01 AC 5 ms
4,772 KB
testcase_02 AC 5 ms
5,000 KB
testcase_03 AC 4 ms
4,988 KB
testcase_04 AC 5 ms
4,940 KB
testcase_05 AC 5 ms
4,928 KB
testcase_06 AC 5 ms
4,768 KB
testcase_07 AC 5 ms
4,764 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 4 ms
4,824 KB
testcase_12 WA -
testcase_13 AC 5 ms
4,924 KB
testcase_14 WA -
testcase_15 AC 5 ms
4,984 KB
testcase_16 AC 4 ms
4,932 KB
testcase_17 AC 4 ms
5,036 KB
testcase_18 WA -
testcase_19 AC 5 ms
4,784 KB
testcase_20 WA -
testcase_21 AC 5 ms
4,884 KB
testcase_22 AC 5 ms
4,824 KB
testcase_23 AC 5 ms
4,880 KB
testcase_24 WA -
testcase_25 AC 5 ms
4,928 KB
testcase_26 AC 5 ms
4,880 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use warnings;

my $n = <>;
my @ai;
my @bi;
my $aarray = <>;
my $barray = <>;
chomp $aarray;
chomp $barray;
@ai = split / /, $aarray;
@bi = split / /, $barray;
my $sum = 0;
my $total = 0;

for(my $i = 0; $i < $n; $i++) {
	$total += $ai[$i];
	if($bi[$i] == 0) {
		$sum += $ai[$i];
	}
}

if($total - $sum <= $sum) {
	print "YES\n";
} else {
	print "NO\n";
}

exit;
0