結果

問題 No.149 碁石の移動
ユーザー togaerrortogaerror
提出日時 2015-03-13 23:10:21
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 300 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 5,180 KB
最終ジャッジ日時 2023-09-11 08:17:23
合計ジャッジ時間 1,234 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 5 ms
5,140 KB
testcase_03 AC 5 ms
5,008 KB
testcase_04 AC 5 ms
4,964 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 5 ms
5,084 KB
testcase_08 AC 5 ms
4,932 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 5 ms
5,092 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 5 ms
4,916 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/perl

use strict;
use warnings;

my ($a_w, $a_b) = split / /, <>;
my ($b_w, $b_b) = split / /, <>;
my ($c, $d) = split / /, <>;

if($c <  $a_w) {
	$b_w += $c;
	$a_w -= $c;
} else {
	$b_w += $a_w;
	$a_w = 0;
}

if($d < $b_w) {
	$a_w += $d;
} else {
	$a_w += $b_w;
}

print "$a_w\n";

exit;
0