結果

問題 No.480 合計
ユーザー KuraKura
提出日時 2019-09-22 18:24:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 1,910 bytes
コンパイル時間 905 ms
コンパイル使用メモリ 110,692 KB
実行使用メモリ 24,152 KB
最終ジャッジ日時 2023-10-19 07:21:59
合計ジャッジ時間 3,160 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,144 KB
testcase_01 AC 26 ms
24,152 KB
testcase_02 AC 27 ms
24,152 KB
testcase_03 AC 26 ms
24,152 KB
testcase_04 AC 27 ms
24,144 KB
testcase_05 AC 26 ms
24,144 KB
testcase_06 AC 26 ms
24,152 KB
testcase_07 AC 26 ms
24,144 KB
testcase_08 AC 26 ms
24,152 KB
testcase_09 AC 26 ms
24,152 KB
testcase_10 AC 26 ms
24,144 KB
testcase_11 AC 26 ms
24,144 KB
testcase_12 AC 25 ms
24,144 KB
testcase_13 AC 26 ms
24,152 KB
testcase_14 AC 26 ms
24,152 KB
testcase_15 AC 26 ms
24,144 KB
testcase_16 AC 25 ms
24,152 KB
testcase_17 AC 26 ms
24,144 KB
testcase_18 AC 26 ms
24,144 KB
testcase_19 AC 26 ms
24,152 KB
testcase_20 AC 26 ms
24,152 KB
testcase_21 AC 26 ms
24,144 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.IO;
class Start
{
    static void Main()
    {
        First(1);
        long n;In(out n);
        Out((n + 1) * n / 2 + "\n");
        Last();
    }

    static void First(long n)
    {
        string s="";
        for(int i = 0; i < n; i++){ s += Console.ReadLine() + " "; }
        STR = s.Split(' ');
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
    }
    static void Last() { Console.Out.Flush(); }

    static void In<T>(out T t)
    {
        Type type = typeof(T);
        if (type == LONG) t = (T)(object)long.Parse(STR[INT]);
        else if (type == STRING) t = (T)(object)STR[INT];
        else if (type == CHAR) t = (T)(object)STR[INT][0];
        else t = (T)(object)double.Parse(STR[INT]);
        INT++;
    }
    static void In<T, U>(out T t, out U u) { In(out t); In(out u); }
    static void In<T, U, V>(out T t, out U u, out V v) { In(out t); In(out u); In(out v); }
    static void In<T, U, V, W>(out T t, out U u, out V v, out W w) { In(out t); In(out u); In(out v); In(out w); }
    static void In<T, U, V, W, X>(out T t, out U u, out V v, out W w, out X x) { In(out t); In(out u); In(out v); In(out w); In(out x); }
    static void In<T, U, V, W, X, Y>(out T t, out U u, out V v, out W w, out X x, out Y y) { In(out t); In(out u); In(out v); In(out w); In(out x); In(out y); }
    static void In<T, U, V, W, X, Y, Z>(out T t, out U u, out V v, out W w, out X x, out Y y, out Z z) { In(out t); In(out u); In(out v); In(out w); In(out x); In(out y); In(out z); }
    static string[] STR;
    static int INT;
    static Type LONG = typeof(long);
    static Type STRING = typeof(string);
    static Type CHAR = typeof(char);

    static void Out<T>(T t) { Console.Write(t); }

    static void Swap<T>(ref T a, ref T b) { T c = a; a = b; b = c; }
}
0