結果
問題 | No.84 悪の算盤 |
ユーザー |
|
提出日時 | 2018-05-20 12:34:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 337 bytes |
コンパイル時間 | 524 ms |
コンパイル使用メモリ | 64,232 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-28 14:38:23 |
合計ジャッジ時間 | 1,156 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include<iostream>using namespace std;typedef long long ll;int main(){ll r, c, ans;cin >> r >> c;if(r != c){ans = r/2 * c;if(r%2 == 1) ans += (c+1)/2;}else{if(r%2 == 0) ans = r*r/4;else ans = (r*r-1)/4+1;}cout << (ans-1) << endl;return 0;}