結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー くれちーくれちー
提出日時 2017-07-18 21:31:03
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 201 ms / 2,000 ms
コード長 1,993 bytes
コンパイル時間 2,683 ms
コンパイル使用メモリ 108,160 KB
実行使用メモリ 56,640 KB
最終ジャッジ日時 2024-04-17 02:01:00
合計ジャッジ時間 4,065 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
19,200 KB
testcase_01 AC 31 ms
19,328 KB
testcase_02 AC 31 ms
19,072 KB
testcase_03 AC 32 ms
19,328 KB
testcase_04 AC 32 ms
19,200 KB
testcase_05 AC 31 ms
19,200 KB
testcase_06 AC 39 ms
19,712 KB
testcase_07 AC 44 ms
21,376 KB
testcase_08 AC 69 ms
26,624 KB
testcase_09 AC 75 ms
28,544 KB
testcase_10 AC 170 ms
49,928 KB
testcase_11 AC 173 ms
50,860 KB
testcase_12 AC 177 ms
51,512 KB
testcase_13 AC 180 ms
51,928 KB
testcase_14 AC 182 ms
52,464 KB
testcase_15 AC 184 ms
53,160 KB
testcase_16 AC 201 ms
56,640 KB
testcase_17 AC 32 ms
19,328 KB
testcase_18 AC 32 ms
19,200 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.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using static System.Convert;
using static System.Math;
using static Extentions;

class IO
{
    int idx;
    string[] input;

    public IO(TextReader reader)
    {
        input = reader.ReadToEnd().Split(new[] { " ", Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
    }

    public string S => input[idx++];
    public char C => char.Parse(input[idx++]);
    public int I => int.Parse(input[idx++]);
    public long L => long.Parse(input[idx++]);
    public double F => double.Parse(input[idx++]);
    public decimal D => decimal.Parse(input[idx++]);
    public BigInteger B => BigInteger.Parse(input[idx++]);

    public string[] Ss(int n) => input.Skip((idx += n) - n).Take(n).ToArray();
    public char[] Cs(int n) => input.Skip((idx += n) - n).Take(n).Select(char.Parse).ToArray();
    public int[] Is(int n) => input.Skip((idx += n) - n).Take(n).Select(int.Parse).ToArray();
    public long[] Ls(int n) => input.Skip((idx += n) - n).Take(n).Select(long.Parse).ToArray();
    public double[] Fs(int n) => input.Skip((idx += n) - n).Take(n).Select(double.Parse).ToArray();
    public decimal[] Ds(int n) => input.Skip((idx += n) - n).Take(n).Select(decimal.Parse).ToArray();
    public BigInteger[] Bs(int n) => input.Skip((idx += n) - n).Take(n).Select(BigInteger.Parse).ToArray();

    public void Write<T>(params T[] xs) => Console.WriteLine(string.Join(" ", xs));
    public void Write(params object[] xs) => Console.WriteLine(string.Join(" ", xs));
}

static class Extentions
{
}

class Program
{
    public static void Main()
    {
#if !DEBUG
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
#endif
        Solve(new IO(Console.In));
        Console.Out.Flush();
    }

    public static void Solve(IO io)
    {
        var n = io.I;
        var a = io.Ls(n);

        io.Write(a.Sum());
    }
}
0