結果

問題 No.84 悪の算盤
コンテスト
ユーザー ry0u_yd
提出日時 2015-04-03 07:49:23
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 513 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 487 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-25 09:47:00
合計ジャッジ時間 1,228 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 5 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
typedef long long ll;

int main()
{
	ll r,c;
	cin >> r >> c;

	ll t,t2;
	if(r == c)
	{
		if(c%2 == 0) t = c/2;
		else t = c/2 + 1;

		if(r%2 == 0) t2 = r/2;
		else t2 = r/2 + 1;

		cout << t*t2-1 << endl;
	}
	else
	{
		t = c;
		
		if(r%2 == 0) t2 = r/2;
		else t2 = r/2 + 1;

		cout << t*t2-1 << endl;
	}
	return 0;
}
0