結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー aketijyuuzou
提出日時 2025-02-22 08:27:54
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,542 bytes
コンパイル時間 2,889 ms
コンパイル使用メモリ 120,072 KB
実行使用メモリ 34,936 KB
最終ジャッジ日時 2025-02-22 08:28:00
合計ジャッジ時間 4,524 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 1 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

// https://yukicoder.me/problems/no/2562
class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("3");
            WillReturn.Add("7");
            WillReturn.Add("1 0 0 1 0 0 0 0 0");
            WillReturn.Add("1");
            WillReturn.Add("0 0 0 0 0 0 0 0 9");
            WillReturn.Add("998244353");
            WillReturn.Add("0 1 2 2 1 0 0 1 2");
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();

        for (int I = 1; I <= InputList.Count - 1; I += 2) {
            decimal M = decimal.Parse(InputList[I]);
            decimal[] DArr = InputList[I + 1].Split(' ').Select(pX => decimal.Parse(pX)).ToArray();
            decimal Answer = Solve(M, DArr);
            Console.WriteLine(Answer);
        }
    }

    static decimal Solve(decimal pM, decimal[] pDArr)
    {
        decimal Answer = 0;
        decimal Omomi = 1;
        for (int I = 0; I <= pDArr.GetUpperBound(0); I++) {
            for (int J = 1; J <= pDArr[I]; J++) {
                Answer += Omomi * (I + 1);
                Omomi *= 10;
            }
        }
        Answer += 1000000000 * pM;
        return Answer;
    }
}
0