結果
問題 | No.84 悪の算盤 |
ユーザー |
![]() |
提出日時 | 2015-11-24 21:54:59 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 23 ms / 5,000 ms |
コード長 | 507 bytes |
コンパイル時間 | 970 ms |
コンパイル使用メモリ | 103,296 KB |
実行使用メモリ | 17,792 KB |
最終ジャッジ日時 | 2024-10-13 08:56:43 |
合計ジャッジ時間 | 1,844 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;class Program{static void Main(){var tmp = Console.ReadLine().Split();long r = long.Parse(tmp[0]);long c = long.Parse(tmp[1]);long ans = 0;if (r == c){if (r % 2 == 0) ans = r * r / 4;else ans = (r * r + 3) / 4;}else{if (r * c % 2 == 0) ans = r * c / 2;else ans = (r * c + 1) / 2;}ans--;Console.WriteLine(ans);}}