結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー mbanmban
提出日時 2018-01-31 07:44:21
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 1,000 ms
コード長 1,511 bytes
コンパイル時間 3,863 ms
コンパイル使用メモリ 104,992 KB
実行使用メモリ 23,940 KB
最終ジャッジ日時 2023-09-11 04:23:56
合計ジャッジ時間 5,812 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
23,884 KB
testcase_01 AC 62 ms
21,828 KB
testcase_02 AC 62 ms
19,952 KB
testcase_03 AC 62 ms
21,820 KB
testcase_04 AC 63 ms
23,812 KB
testcase_05 AC 63 ms
21,816 KB
testcase_06 AC 63 ms
23,788 KB
testcase_07 AC 63 ms
19,772 KB
testcase_08 AC 63 ms
23,880 KB
testcase_09 AC 63 ms
21,756 KB
testcase_10 AC 63 ms
21,968 KB
testcase_11 AC 63 ms
23,940 KB
testcase_12 AC 62 ms
23,936 KB
testcase_13 AC 63 ms
23,788 KB
testcase_14 AC 62 ms
21,892 KB
testcase_15 AC 63 ms
21,828 KB
testcase_16 AC 63 ms
21,952 KB
testcase_17 AC 63 ms
21,752 KB
testcase_18 AC 63 ms
21,944 KB
testcase_19 AC 63 ms
21,816 KB
testcase_20 AC 63 ms
21,844 KB
testcase_21 AC 63 ms
23,836 KB
testcase_22 AC 63 ms
21,888 KB
testcase_23 AC 63 ms
21,940 KB
testcase_24 AC 63 ms
21,884 KB
testcase_25 AC 64 ms
21,804 KB
testcase_26 AC 64 ms
21,840 KB
testcase_27 AC 63 ms
21,828 KB
testcase_28 AC 63 ms
21,812 KB
testcase_29 AC 63 ms
21,836 KB
testcase_30 AC 63 ms
23,828 KB
testcase_31 AC 63 ms
23,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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
using System.Diagnostics;

class Scanner
{
    private readonly char Separator = ' ';
    private int Index = 0;
    private string[] Line = new string[0];
    public string Next()
    {
        if (Index >= Line.Length)
        {
            Line = Console.ReadLine().Split(Separator);
            Index = 0;
        }
        var ret = Line[Index];
        Index++;
        return ret;
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }
}

class Program
{

    public void Solve()
    {
        var a = Console.ReadLine().Split(' ');
        var fizzbuzz = a.Select(s =>
        {
            int i = int.Parse(s);
            if (i % 15 == 0)
            {
                return "FizzBuzz";
            }
            else if (i % 3 == 0)
            {
                return "Fizz";
            }
            else if (i % 5 == 0)
            {
                return "Buzz";
            }
            else
            {
                return s;
            }
        }).ToArray();
        Console.WriteLine(fizzbuzz.Sum(s => s.Length));

    }

    private bool TwoPow(long n)
    {
        return (n & (n - 1)) == 0;
    }

    static public void Main()
    {
        new Program().Solve();
    }
}
0