結果

問題 No.73 helloworld
ユーザー mbanmban
提出日時 2017-01-05 17:56:41
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 23 ms / 5,000 ms
コード長 1,575 bytes
コンパイル時間 2,162 ms
コンパイル使用メモリ 106,752 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-06-29 22:16:37
合計ジャッジ時間 3,166 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
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