結果

問題 No.84 悪の算盤
ユーザー mbanmban
提出日時 2017-01-01 16:49:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 951 bytes
コンパイル時間 2,334 ms
コンパイル使用メモリ 101,748 KB
実行使用メモリ 22,892 KB
最終ジャッジ日時 2023-08-03 12:16:46
合計ジャッジ時間 4,024 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
20,768 KB
testcase_01 AC 58 ms
18,748 KB
testcase_02 AC 60 ms
20,848 KB
testcase_03 AC 60 ms
22,652 KB
testcase_04 AC 60 ms
20,600 KB
testcase_05 AC 59 ms
20,668 KB
testcase_06 AC 57 ms
20,812 KB
testcase_07 AC 59 ms
22,892 KB
testcase_08 AC 57 ms
20,736 KB
testcase_09 AC 58 ms
20,692 KB
testcase_10 AC 59 ms
22,740 KB
testcase_11 AC 58 ms
20,776 KB
testcase_12 AC 60 ms
20,812 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.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;


class Magatro
{
    static long R, C;
    static void Main()
    {
        string[] s = Console.ReadLine().Split(' ');
        R = int.Parse(s[0]);
        C = int.Parse(s[1]);
        if (R == C)
        {
            if (R % 2 == 0)
            {
                Console.WriteLine(R * C / 4-1);
                return;
            }
            else
            {
                Console.WriteLine(R * C / 4 );
                return;
            }
        }
        else
        {
            if (R % 2 == 0 || C % 2 == 0)
            {
                Console.WriteLine(R * C / 2-1);
                return;
            }
            else
            {
                Console.WriteLine(R * C / 2 );
                return;
            }
        }
    }
}

0