結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー kmtrc130kmtrc130
提出日時 2019-03-15 13:07:35
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 66 ms / 1,000 ms
コード長 810 bytes
コンパイル時間 4,441 ms
コンパイル使用メモリ 105,436 KB
実行使用メモリ 25,920 KB
最終ジャッジ日時 2023-09-11 04:30:45
合計ジャッジ時間 5,857 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
23,920 KB
testcase_01 AC 64 ms
21,712 KB
testcase_02 AC 65 ms
23,848 KB
testcase_03 AC 65 ms
21,632 KB
testcase_04 AC 64 ms
21,816 KB
testcase_05 AC 65 ms
21,700 KB
testcase_06 AC 64 ms
21,784 KB
testcase_07 AC 65 ms
23,876 KB
testcase_08 AC 64 ms
21,820 KB
testcase_09 AC 63 ms
21,704 KB
testcase_10 AC 66 ms
23,892 KB
testcase_11 AC 65 ms
23,992 KB
testcase_12 AC 64 ms
21,704 KB
testcase_13 AC 64 ms
21,880 KB
testcase_14 AC 64 ms
23,840 KB
testcase_15 AC 63 ms
21,816 KB
testcase_16 AC 63 ms
21,800 KB
testcase_17 AC 64 ms
21,708 KB
testcase_18 AC 64 ms
21,644 KB
testcase_19 AC 64 ms
21,912 KB
testcase_20 AC 62 ms
19,760 KB
testcase_21 AC 64 ms
21,728 KB
testcase_22 AC 63 ms
19,768 KB
testcase_23 AC 64 ms
21,712 KB
testcase_24 AC 63 ms
21,940 KB
testcase_25 AC 63 ms
21,700 KB
testcase_26 AC 62 ms
23,748 KB
testcase_27 AC 64 ms
25,920 KB
testcase_28 AC 63 ms
23,824 KB
testcase_29 AC 64 ms
23,828 KB
testcase_30 AC 64 ms
19,824 KB
testcase_31 AC 64 ms
23,828 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;

class Program
{
    public void Solve()
    {
        List<int> a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
        int count = 0;
        foreach (var N in a)
        {
            if (N % 15 == 0)
            {
                count += "FizzBuzz".Count();
            }
            else if (N % 3 == 0)
            {
                count += "Fizz".Count();
            }
            else if (N % 5 == 0)
            {
                count += "Buzz".Count();
            }
            else
            {
                count += N.ToString().Count();
            }
        }
        Console.WriteLine(count);
    }

    static void Main()
    {
        var solver = new Program();
        solver.Solve();
    }
}
0