結果

問題 No.84 悪の算盤
ユーザー 綾地寧々綾地寧々
提出日時 2015-06-14 16:18:33
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 2,211 ms
コンパイル使用メモリ 32,012 KB
実行使用メモリ 32,660 KB
最終ジャッジ日時 2024-07-06 20:14:25
合計ジャッジ時間 3,226 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
32,532 KB
testcase_01 AC 34 ms
32,404 KB
testcase_02 AC 32 ms
32,400 KB
testcase_03 AC 34 ms
32,404 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 34 ms
32,400 KB
testcase_08 AC 34 ms
32,656 KB
testcase_09 AC 33 ms
32,344 KB
testcase_10 AC 33 ms
32,396 KB
testcase_11 AC 33 ms
32,660 KB
testcase_12 AC 34 ms
32,404 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