結果

問題 No.45 回転寿司
ユーザー boya978boya978
提出日時 2021-01-13 22:07:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 35 ms / 5,000 ms
コード長 494 bytes
コンパイル時間 1,643 ms
コンパイル使用メモリ 110,116 KB
実行使用メモリ 27,720 KB
最終ジャッジ日時 2024-05-02 06:48:15
合計ジャッジ時間 3,729 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
25,760 KB
testcase_01 AC 35 ms
27,348 KB
testcase_02 AC 34 ms
25,776 KB
testcase_03 AC 34 ms
25,624 KB
testcase_04 AC 35 ms
25,628 KB
testcase_05 AC 30 ms
25,376 KB
testcase_06 AC 34 ms
25,628 KB
testcase_07 AC 34 ms
25,908 KB
testcase_08 AC 35 ms
25,704 KB
testcase_09 AC 35 ms
27,712 KB
testcase_10 AC 34 ms
25,368 KB
testcase_11 AC 35 ms
27,224 KB
testcase_12 AC 34 ms
25,312 KB
testcase_13 AC 30 ms
24,996 KB
testcase_14 AC 30 ms
25,120 KB
testcase_15 AC 34 ms
25,372 KB
testcase_16 AC 33 ms
25,440 KB
testcase_17 AC 33 ms
25,644 KB
testcase_18 AC 33 ms
25,396 KB
testcase_19 AC 35 ms
27,720 KB
testcase_20 AC 29 ms
24,988 KB
testcase_21 AC 29 ms
27,156 KB
testcase_22 AC 29 ms
25,360 KB
testcase_23 AC 29 ms
25,124 KB
testcase_24 AC 29 ms
27,416 KB
testcase_25 AC 29 ms
27,032 KB
testcase_26 AC 34 ms
27,356 KB
testcase_27 AC 34 ms
27,536 KB
testcase_28 AC 34 ms
27,356 KB
testcase_29 AC 34 ms
27,612 KB
testcase_30 AC 34 ms
25,436 KB
testcase_31 AC 29 ms
22,964 KB
testcase_32 AC 30 ms
27,028 KB
testcase_33 AC 35 ms
27,496 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.Linq;
public class Hello{
    public static void Main(){
        
        int n=int.Parse(Console.ReadLine());
        var V = Console.ReadLine().Split().Select(int.Parse).ToArray();
        
        var dp = new int[2];
        
        for(int i=0;i<n;i++)
        {
            var dp2 = new int[2];
            dp2[0] = dp.Max();
            dp2[1] = dp[0] + V[i];
            Array.Copy(dp2,dp,2);
        }
        
        Console.WriteLine(dp.Max());
    }
}
0