結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー maimai
提出日時 2017-08-17 00:46:00
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 2,101 bytes
コンパイル時間 1,291 ms
コンパイル使用メモリ 107,136 KB
実行使用メモリ 48,128 KB
最終ジャッジ日時 2024-04-21 14:31:50
合計ジャッジ時間 3,500 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 25 ms
18,944 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 148 ms
46,464 KB
testcase_13 WA -
testcase_14 AC 153 ms
47,488 KB
testcase_15 WA -
testcase_16 AC 170 ms
46,848 KB
testcase_17 AC 26 ms
18,688 KB
testcase_18 AC 25 ms
18,816 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.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SandboxCSharp
{
    class Solver
    {

        void Solve()
        {
            int n = io.ScanInt();

            long z = 0;
            for (int i = 0; i < n; ++i)
            {
                z += io.ScanLong();
            }
            io.Write(z);
        }


        // =================================================
        // =================================================

        Stdio io;
        static void Main()
        {
            new Solver();
        }
        Solver(Stdio _io = null)
        {
            io = _io == null ? new Stdio() : io;
            Solve();
        }
    }
    class Stdio
    {
        protected string[] stack = new string[0];
        protected int stackptr = 0;

        public virtual int ScanInt()
        {
            return Check() ? int.Parse(stack[stackptr++]) : 0;
        }
        public virtual long ScanLong()
        {
            return Check() ? long.Parse(stack[stackptr++]) : 0;
        }
        public virtual string ScanString()
        {
            return Check() ? stack[stackptr++] : string.Empty;
        }
        public virtual double ScanDouble()
        {
            return Check() ? double.Parse(stack[stackptr++]) : 0;
        }
        protected virtual bool Check()
        {
            if (stackptr < stack.Length) return true;
            var l = Console.ReadLine();
            if (l == null) return false;
            stack = l.Split(' ').ToArray();
            return Check();
        }
        public Stdio Write(long v)
        {
            Console.Write($"{v}");
            return this;
        }
        public Stdio WriteLn(long v)
        {
            Console.WriteLine($"{v}");
            return this;
        }
        public Stdio Write(string str)
        {
            Console.Write(str);
            return this;
        }
        public Stdio WriteLn(string str = "")
        {
            Console.WriteLine(str);
            return this;
        }
    }
}
0