結果

問題 No.84 悪の算盤
ユーザー masa
提出日時 2015-02-22 16:27:05
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 289 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 56,020 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 08:46:39
合計ジャッジ時間 982 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int main() {
	long long r, c, ans;

	cin >> r >> c;
	if (r != c) {
		ans = (r * c + 1) / 2 - 1;
	} else {
		if (r % 2 == 0) {
			ans = r * c / 4 - 1;
		} else {
			ans = ((r + 1) / 2) * (c / 2) + 1 - 1;
		}
	}

	cout << ans << endl;
	return 0;
}
0