結果

問題 No.161 制限ジャンケン
ユーザー tailstails
提出日時 2015-03-05 23:27:20
言語 Perl
(5.38.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 296 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 5,296 KB
実行使用メモリ 4,848 KB
最終ジャッジ日時 2023-08-20 04:20:11
合計ジャッジ時間 1,157 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,744 KB
testcase_01 AC 3 ms
4,684 KB
testcase_02 AC 3 ms
4,828 KB
testcase_03 AC 3 ms
4,780 KB
testcase_04 AC 3 ms
4,528 KB
testcase_05 AC 2 ms
4,600 KB
testcase_06 AC 2 ms
4,628 KB
testcase_07 AC 2 ms
4,752 KB
testcase_08 AC 3 ms
4,740 KB
testcase_09 AC 3 ms
4,848 KB
testcase_10 AC 2 ms
4,688 KB
testcase_11 AC 3 ms
4,512 KB
testcase_12 AC 2 ms
4,544 KB
testcase_13 AC 3 ms
4,680 KB
testcase_14 AC 2 ms
4,804 KB
testcase_15 AC 3 ms
4,676 KB
testcase_16 AC 3 ms
4,676 KB
testcase_17 AC 3 ms
4,780 KB
testcase_18 AC 3 ms
4,664 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

sub max{$_[0]>$_[1]?$_[0]:$_[1]}
sub min{$_[0]<$_[1]?$_[0]:$_[1]}
($g,$c,$p)=<>=~/\d+/g;
$_=<>;
$G=y/G//;
$C=y/C//;
$P=y/P//;
$x=min($p,$G);
$s+=$x*3;
$p-=$x;
$G-=$x;
$x=min($g,$C);
$s+=$x*3;
$g-=$x;
$C-=$x;
$x=min($c,$P);
$s+=$x*3;
$c-=$x;
$P-=$x;
$s+=min($g,$G)+min($c,$C)+min($p,$P);
print$s;
0