結果

問題 No.73 helloworld
ユーザー mbanmban
提出日時 2017-01-05 17:56:41
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 1,575 bytes
コンパイル時間 4,083 ms
コンパイル使用メモリ 108,224 KB
実行使用メモリ 22,752 KB
最終ジャッジ日時 2023-09-12 09:33:28
合計ジャッジ時間 3,830 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
20,776 KB
testcase_01 AC 54 ms
20,724 KB
testcase_02 AC 55 ms
22,692 KB
testcase_03 AC 55 ms
20,696 KB
testcase_04 AC 56 ms
20,596 KB
testcase_05 AC 56 ms
22,676 KB
testcase_06 AC 55 ms
20,652 KB
testcase_07 AC 56 ms
22,700 KB
testcase_08 AC 55 ms
20,728 KB
testcase_09 AC 55 ms
20,656 KB
testcase_10 AC 55 ms
20,708 KB
testcase_11 AC 56 ms
20,724 KB
testcase_12 AC 55 ms
20,708 KB
testcase_13 AC 55 ms
22,752 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 void Main()
    {
        long ans = 1;
    for(int i = 1; i <= 26; i++)
        {
            switch (i)
            {
                case 4:
                case 5:
                case 8:
                case 18:
                case 23:
                    ans *= int.Parse(Console.ReadLine());
                    break;
                case 15:
                    int o = int.Parse(Console.ReadLine());
                    ans *= ((o / 2) * ((o + 1) / 2));
                    break;
                case 12:
                    int l = int.Parse(Console.ReadLine());
                    if (l < 3)
                    {
                        ans = 0;
                    }
                    else
                    {
                        ans *= lcnt(l);
                    }
                    break;
                default:
                    Console.ReadLine();
                    break;
            }
        }
        Console.WriteLine(ans);
    }
    static int kaijou(int n)
    {
        if (n == 1)
        {
            return 1;
        }
        return n + kaijou(n - 1);
    }
    static int lcnt(int l)
    {
        int max = 0;
        for(int i = 2; i < l; i++)
        {
            int r = l - i;
            int cnt = ((i - 1) * i / 2) * r;
            max = Math.Max(max, cnt);
        }
        return max;
    }
}
0