結果

問題 No.3043 yukicoderへようこそ!
ユーザー AreTrashAreTrash
提出日時 2019-04-01 23:20:37
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 3,326 bytes
コンパイル時間 2,271 ms
コンパイル使用メモリ 109,184 KB
実行使用メモリ 25,800 KB
最終ジャッジ日時 2024-05-05 09:03:25
合計ジャッジ時間 2,842 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Collections.Generic;
using System.Linq;

namespace No3043
{
    public partial class Program
    {
        void Solve()
        {
            //---------------------------------
            No9000();
            No480();
            No9001();
            No9002();
            No9008();
            No9009();
            //---------------------------------
        }

        void No9000()
        {
            //var S = ss.Next();
            sw.WriteLine("Hello World!");
        }

        void No480()
        {
            var N = ss.Next(int.Parse);
            sw.WriteLine(N * (N + 1) / 2);
        }

        void No9001()
        {
            var A = ss.Next(int.Parse);
            var B = ss.Next(int.Parse);
            var S = ss.Next();
            sw.WriteLine($"{A + B} {S}");
        }

        void No9002()
        {
            var N = ss.Next(int.Parse);
            for (var i = 1; i <= N; i++)
            {
                if (i % 15 == 0) sw.WriteLine("FizzBuzz");
                else if (i % 3 == 0) sw.WriteLine("Fizz");
                else if (i % 5 == 0) sw.WriteLine("Buzz");
                else sw.WriteLine(i);
            }
        }

        void No9008()
        {
            var N = ss.Next(int.Parse);
            var A = ss.Next(long.Parse, N);
            sw.WriteLine(A.Sum());
        }

        void No9009()
        {
            var N = ss.Next(int.Parse);
            var A = ss.Next(long.Parse, N);
            sw.WriteLine(A.Sum());
        }
    }

    public class StreamScanner
    {
        static readonly char[] Separator = { ' ' };
        readonly StreamReader streamReader;

        string[] line = new string[0];
        int index = 0;

        public StreamScanner(Stream stream)
        {
            this.streamReader = new StreamReader(stream);
        }

        public string Next()
        {
            return Next(s => s);
        }

        public string[] Next(int x)
        {
            return Next(s => s, x);
        }

        public string[][] Next(int x, int y)
        {
            return Next(s => s, x, y);
        }

        public T Next<T>(Func<string, T> parser)
        {
            if (index < line.Length) return parser(line[index++]);
            index = 0;
            line = streamReader.ReadLine()?.Split(Separator, StringSplitOptions.RemoveEmptyEntries);
            return Next(parser);
        }

        public T[] Next<T>(Func<string, T> parser, int x)
        {
            var ret = new T[x];
            for (var i = 0; i < x; ++i) ret[i] = Next(parser);
            return ret;
        }

        public T[][] Next<T>(Func<string, T> parser, int x, int y)
        {
            var ret = new T[y][];
            for (var i = 0; i < y; ++i) ret[i] = Next(parser, x);
            return ret;
        }
    }

    public partial class Program
    {
        static StreamScanner ss;
        static StreamWriter sw;

        static void Main()
        {
            Excute(Console.OpenStandardInput(), Console.OpenStandardOutput());
        }

        public static void Excute(Stream input, Stream output)
        {
            ss = new StreamScanner(input);
            sw = new StreamWriter(output);
            new Program().Solve();
            sw.Flush();
        }
    }
}
0