結果

問題 No.84 悪の算盤
ユーザー nanophoto12nanophoto12
提出日時 2014-12-03 00:14:34
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 62 ms / 5,000 ms
コード長 688 bytes
コンパイル時間 2,025 ms
コンパイル使用メモリ 102,544 KB
実行使用メモリ 24,028 KB
最終ジャッジ日時 2023-08-03 12:00:44
合計ジャッジ時間 3,594 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,836 KB
testcase_01 AC 60 ms
23,880 KB
testcase_02 AC 61 ms
21,924 KB
testcase_03 AC 62 ms
23,816 KB
testcase_04 AC 59 ms
24,028 KB
testcase_05 AC 58 ms
19,764 KB
testcase_06 AC 59 ms
22,004 KB
testcase_07 AC 60 ms
23,864 KB
testcase_08 AC 60 ms
21,776 KB
testcase_09 AC 61 ms
21,828 KB
testcase_10 AC 61 ms
21,892 KB
testcase_11 AC 60 ms
23,920 KB
testcase_12 AC 61 ms
19,844 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

class Program84
{
    public static void Main(string[] args)
    {
        var line = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        if (line[0] != line[1])
        {
            var mul = line[0]*line[1];
            if (mul%2 == 1)
            {
                Console.WriteLine(line[0]*line[1]/2);
                return;
            }
            Console.WriteLine(line[0] * line[1] / 2-1);
            return;
        }
        if (line[0]%2 == 1)
        {
            Console.WriteLine(line[0] * line[1] / 4);
            return;
        }
        Console.WriteLine(line[0] * line[1] / 4-1);
    }
}
0