結果
問題 | No.84 悪の算盤 |
ユーザー |
|
提出日時 | 2020-02-13 10:45:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 377 bytes |
コンパイル時間 | 1,747 ms |
コンパイル使用メモリ | 167,080 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-05 08:16:34 |
合計ジャッジ時間 | 2,233 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 3 |
ソースコード
#include<bits/stdc++.h>using namespace std;typedef long long ll;int main(){ll r,c;cin >> r >> c;if(r%2==0&&c%2==0){cout << (r/2)*(c/2)*2-1 << endl;}else if(r%2==1&&c%2==1){cout << 1+r/2+c/2+(r/2)*(c/2)*2-1 << endl;}else{if(r%2==1){swap(r,c);}cout << r/2+(r/2)*(c/2)*2-1 << endl;}}