結果

問題 No.45 回転寿司
ユーザー boya978boya978
提出日時 2021-01-13 22:07:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 72 ms / 5,000 ms
コード長 494 bytes
コンパイル時間 4,541 ms
コンパイル使用メモリ 104,856 KB
実行使用メモリ 23,880 KB
最終ジャッジ日時 2023-08-14 18:45:32
合計ジャッジ時間 8,487 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
21,744 KB
testcase_01 AC 70 ms
19,708 KB
testcase_02 AC 71 ms
23,600 KB
testcase_03 AC 71 ms
19,668 KB
testcase_04 AC 72 ms
23,584 KB
testcase_05 AC 62 ms
21,708 KB
testcase_06 AC 71 ms
23,636 KB
testcase_07 AC 71 ms
23,836 KB
testcase_08 AC 70 ms
21,744 KB
testcase_09 AC 72 ms
21,932 KB
testcase_10 AC 72 ms
21,704 KB
testcase_11 AC 69 ms
21,736 KB
testcase_12 AC 71 ms
21,732 KB
testcase_13 AC 62 ms
19,600 KB
testcase_14 AC 63 ms
21,696 KB
testcase_15 AC 70 ms
21,604 KB
testcase_16 AC 70 ms
21,704 KB
testcase_17 AC 71 ms
21,548 KB
testcase_18 AC 71 ms
21,744 KB
testcase_19 AC 71 ms
21,736 KB
testcase_20 AC 64 ms
23,708 KB
testcase_21 AC 62 ms
19,664 KB
testcase_22 AC 63 ms
23,620 KB
testcase_23 AC 63 ms
21,696 KB
testcase_24 AC 63 ms
21,660 KB
testcase_25 AC 62 ms
21,568 KB
testcase_26 AC 71 ms
23,856 KB
testcase_27 AC 71 ms
23,880 KB
testcase_28 AC 70 ms
21,600 KB
testcase_29 AC 70 ms
21,944 KB
testcase_30 AC 71 ms
21,660 KB
testcase_31 AC 63 ms
23,640 KB
testcase_32 AC 63 ms
21,416 KB
testcase_33 AC 70 ms
21,668 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