結果

問題 No.45 回転寿司
ユーザー _matumo__matumo_
提出日時 2018-06-04 13:39:39
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 5,000 ms
コード長 896 bytes
コンパイル時間 2,151 ms
コンパイル使用メモリ 105,100 KB
実行使用メモリ 23,952 KB
最終ジャッジ日時 2023-08-27 16:25:30
合計ジャッジ時間 5,500 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
19,936 KB
testcase_01 AC 60 ms
21,864 KB
testcase_02 AC 60 ms
21,876 KB
testcase_03 AC 60 ms
21,852 KB
testcase_04 AC 61 ms
23,924 KB
testcase_05 AC 54 ms
21,692 KB
testcase_06 AC 60 ms
21,792 KB
testcase_07 AC 60 ms
21,824 KB
testcase_08 AC 60 ms
21,852 KB
testcase_09 AC 61 ms
21,812 KB
testcase_10 AC 63 ms
23,828 KB
testcase_11 AC 61 ms
23,828 KB
testcase_12 AC 62 ms
21,880 KB
testcase_13 AC 55 ms
21,772 KB
testcase_14 AC 54 ms
21,812 KB
testcase_15 AC 60 ms
23,924 KB
testcase_16 AC 61 ms
21,788 KB
testcase_17 AC 60 ms
21,848 KB
testcase_18 AC 60 ms
21,724 KB
testcase_19 AC 62 ms
23,856 KB
testcase_20 AC 54 ms
23,684 KB
testcase_21 AC 54 ms
21,628 KB
testcase_22 AC 54 ms
23,756 KB
testcase_23 AC 54 ms
21,844 KB
testcase_24 AC 56 ms
23,836 KB
testcase_25 AC 53 ms
23,732 KB
testcase_26 AC 61 ms
21,840 KB
testcase_27 AC 62 ms
23,952 KB
testcase_28 AC 62 ms
23,892 KB
testcase_29 AC 61 ms
21,804 KB
testcase_30 AC 61 ms
21,964 KB
testcase_31 AC 53 ms
21,808 KB
testcase_32 AC 54 ms
21,844 KB
testcase_33 AC 61 ms
21,828 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.Generic;
using System.Linq;
using System.Text;

namespace YukiCoder
{
    class Program
    {
        static int nMax;
        static int[] pvi;
        static int[] pvo;

        static int zzz(int ni)
        {
            if (ni >= nMax) return 0;
            int nn = pvo[ni];
            if (nn > 0) return nn;

            int na = zzz(ni + 1);
            int nb = zzz(ni + 2) + pvi[ni];

            return pvo[ni] = na > nb ? na : nb;
        }
        //--------------------------------------------------------------//
        static void Main(string[] args)
        {
            nMax = int.Parse(Console.ReadLine());
            pvi = Console.ReadLine().Split().Select(int.Parse).ToArray();
            pvo = new Int32[nMax + 1];

            int n = zzz(0);

            Console.WriteLine(n);
            Console.ReadLine();
        }
    }
}

0