結果
| 問題 | 
                            No.84 悪の算盤
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-01-19 22:11:13 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 41 ms / 5,000 ms | 
| コード長 | 306 bytes | 
| コンパイル時間 | 170 ms | 
| コンパイル使用メモリ | 82,228 KB | 
| 実行使用メモリ | 52,096 KB | 
| 最終ジャッジ日時 | 2024-11-23 14:06:33 | 
| 合計ジャッジ時間 | 1,356 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 10 | 
ソースコード
r,c = map(int,input().split())
if r == c:
    if r%2:
        print((r+1)//2*(c+1)//2-1-r//2)
    else:
        print(r//2*c//2-1)
else:
    if r%2 == 0 and c %2 == 0:
        print(r*c//2-1)
    elif r%2 and c%2:
        print(max((r+1)//2*c-c//2-1,(c+1)//2*r-r//2-1))
    else:
        print(r*c//2-1)