結果

問題 No.84 悪の算盤
ユーザー mbanmban
提出日時 2017-01-01 16:49:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 951 bytes
コンパイル時間 813 ms
コンパイル使用メモリ 109,876 KB
実行使用メモリ 26,004 KB
最終ジャッジ日時 2024-04-21 10:12:26
合計ジャッジ時間 1,734 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
23,704 KB
testcase_01 AC 25 ms
23,900 KB
testcase_02 AC 26 ms
25,940 KB
testcase_03 AC 26 ms
23,692 KB
testcase_04 AC 27 ms
23,904 KB
testcase_05 AC 26 ms
25,940 KB
testcase_06 AC 25 ms
23,780 KB
testcase_07 AC 26 ms
26,004 KB
testcase_08 AC 26 ms
23,908 KB
testcase_09 AC 26 ms
24,096 KB
testcase_10 AC 26 ms
23,900 KB
testcase_11 AC 26 ms
25,816 KB
testcase_12 AC 26 ms
23,896 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