結果

問題 No.84 悪の算盤
ユーザー 綾地寧々綾地寧々
提出日時 2015-06-14 16:18:33
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 735 ms
コンパイル使用メモリ 18,460 KB
実行使用メモリ 19,160 KB
最終ジャッジ日時 2023-09-21 01:30:07
合計ジャッジ時間 2,183 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
19,128 KB
testcase_01 AC 15 ms
19,024 KB
testcase_02 AC 15 ms
18,896 KB
testcase_03 AC 16 ms
18,900 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 16 ms
18,912 KB
testcase_08 AC 15 ms
18,980 KB
testcase_09 AC 16 ms
18,980 KB
testcase_10 AC 16 ms
18,944 KB
testcase_11 AC 16 ms
18,848 KB
testcase_12 AC 15 ms
18,980 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
list($r, $c) = explode(" ",trim(fgets(STDIN)));
$post_add = 0;
if ( $r % 2 ) {
	// 奇数行なら、組み合わせ計算したあとに足す数を計算
	$post_add = intval(ceil($c / 2));
}
$r >>= 1;
echo gmp_strval(gmp_add(gmp_mul(gmp_init($r), gmp_init($c)), gmp_init($post_add-1))).PHP_EOL;
0