結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー くれちーくれちー
提出日時 2017-07-18 21:31:36
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 209 ms / 3,000 ms
コード長 1,993 bytes
コンパイル時間 3,836 ms
コンパイル使用メモリ 112,124 KB
実行使用メモリ 60,996 KB
最終ジャッジ日時 2023-08-26 17:14:37
合計ジャッジ時間 6,122 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,976 KB
testcase_01 AC 61 ms
21,980 KB
testcase_02 AC 61 ms
24,020 KB
testcase_03 AC 61 ms
21,920 KB
testcase_04 AC 60 ms
21,892 KB
testcase_05 AC 60 ms
21,936 KB
testcase_06 AC 69 ms
24,256 KB
testcase_07 AC 70 ms
23,332 KB
testcase_08 AC 93 ms
29,004 KB
testcase_09 AC 117 ms
38,560 KB
testcase_10 AC 197 ms
56,520 KB
testcase_11 AC 193 ms
57,188 KB
testcase_12 AC 195 ms
57,948 KB
testcase_13 AC 202 ms
58,576 KB
testcase_14 AC 202 ms
55,624 KB
testcase_15 AC 201 ms
58,228 KB
testcase_16 AC 209 ms
60,996 KB
testcase_17 AC 59 ms
21,984 KB
testcase_18 AC 60 ms
22,004 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