結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー Salvia0911Salvia0911
提出日時 2023-11-05 13:46:11
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 1,803 bytes
コンパイル時間 19,951 ms
コンパイル使用メモリ 158,964 KB
実行使用メモリ 175,412 KB
最終ジャッジ日時 2023-11-05 13:46:36
合計ジャッジ時間 24,724 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
30,860 KB
testcase_01 AC 58 ms
30,860 KB
testcase_02 AC 55 ms
30,864 KB
testcase_03 AC 56 ms
30,860 KB
testcase_04 AC 56 ms
30,864 KB
testcase_05 AC 56 ms
30,880 KB
testcase_06 AC 59 ms
31,256 KB
testcase_07 AC 66 ms
33,000 KB
testcase_08 AC 72 ms
38,420 KB
testcase_09 AC 75 ms
39,284 KB
testcase_10 AC 105 ms
54,836 KB
testcase_11 AC 101 ms
54,884 KB
testcase_12 AC 102 ms
55,388 KB
testcase_13 AC 106 ms
55,908 KB
testcase_14 AC 104 ms
56,404 KB
testcase_15 AC 105 ms
56,924 KB
testcase_16 AC 109 ms
59,460 KB
testcase_17 AC 57 ms
30,888 KB
testcase_18 AC 57 ms
175,412 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (99 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;
using System.Collections.Generic;

public class InputStrorage
{
    public long N;
    public long[] Array;
}

public static class InputHandler
{
    public static void ReadInput(InputStrorage input)
    {
        string[] str = Console.ReadLine().Split();
        input.N = int.Parse(str[0]);
        input.Array = new long[input.N];
        
        str = Console.ReadLine().Split();
        for (int i = 0; i < input.N; i++)
        {
            input.Array[i] = long.Parse(str[i]);
        }
     }
}

namespace GeneralLibs
{
    public class Compare
    {
        public static long ReturnMax(long a, long b)
        {
            if (a > b) return a;
            else return b;
        }

        public static long ReturnMax(long[] a)
        {
            long max = long.MinValue;
            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] > max) max = a[i];
            }
            return max;
        }
    }

    public class ShowValues
    {
        public static void ShowArray1D(long[] a, string str = "default")
        {
            Console.WriteLine(str);
            for (int i = 0; i < a.Length; i++)
            {
                Console.Write("{0} ", a[i]);
            }
            Console.WriteLine();
            Console.WriteLine(str);
        }

        public static void ShowValue(long a, string str = "default")
        {
            Console.WriteLine("{0} : {1}", a, str);
        }

    }
}

public class SpecificLibs
{

}

static class No9008
{
    static void Main()
    {
        InputStrorage input = new InputStrorage();
        InputHandler.ReadInput(input);

        long ans = 0;
        for(int i = 0; i < input.N; i++)
        {
            ans += input.Array[i];
        }

        Console.WriteLine(ans);

    }
}
0