結果

問題 No.45 回転寿司
ユーザー YoiTakaYoiTaka
提出日時 2017-02-23 13:46:29
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 66 ms / 5,000 ms
コード長 551 bytes
コンパイル時間 3,061 ms
コンパイル使用メモリ 97,400 KB
実行使用メモリ 22,984 KB
最終ジャッジ日時 2023-08-27 15:21:24
合計ジャッジ時間 6,151 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
20,860 KB
testcase_01 AC 66 ms
20,776 KB
testcase_02 AC 65 ms
20,916 KB
testcase_03 AC 64 ms
20,840 KB
testcase_04 AC 66 ms
20,848 KB
testcase_05 AC 57 ms
18,612 KB
testcase_06 AC 65 ms
20,764 KB
testcase_07 AC 65 ms
20,912 KB
testcase_08 AC 64 ms
20,776 KB
testcase_09 AC 65 ms
18,732 KB
testcase_10 AC 66 ms
22,812 KB
testcase_11 AC 64 ms
18,820 KB
testcase_12 AC 66 ms
20,872 KB
testcase_13 AC 58 ms
20,664 KB
testcase_14 AC 58 ms
20,836 KB
testcase_15 AC 65 ms
20,844 KB
testcase_16 AC 64 ms
20,772 KB
testcase_17 AC 64 ms
20,772 KB
testcase_18 AC 64 ms
22,984 KB
testcase_19 AC 65 ms
20,776 KB
testcase_20 AC 57 ms
20,852 KB
testcase_21 AC 58 ms
20,668 KB
testcase_22 AC 57 ms
22,768 KB
testcase_23 AC 58 ms
22,644 KB
testcase_24 AC 57 ms
20,748 KB
testcase_25 AC 57 ms
22,680 KB
testcase_26 AC 65 ms
20,824 KB
testcase_27 AC 66 ms
22,888 KB
testcase_28 AC 64 ms
20,940 KB
testcase_29 AC 65 ms
22,808 KB
testcase_30 AC 64 ms
20,844 KB
testcase_31 AC 57 ms
22,796 KB
testcase_32 AC 58 ms
20,672 KB
testcase_33 AC 65 ms
20,772 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Hello
{
    public static void Main()
    {

        string line = System.Console.ReadLine().Trim();
        int N = int.Parse(line);

        line = System.Console.ReadLine().Trim();

        string[] Data = line.Split(' ');

        int t = 0;
        int p = 0;
        int q = 0;

        for (int i = 0; i < N; i++)
        {
            int vi =   int.Parse(Data[i]);

            t = q + vi;

            q = p > q ? p : q;

            p = t;            
        }
        System.Console.WriteLine(p>q?p:q);
    }
}
0