結果

問題 No.428 小数から逃げる夢
ユーザー mban
提出日時 2016-10-12 02:42:47
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 1,161 bytes
コンパイル時間 937 ms
コンパイル使用メモリ 106,624 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-11-22 02:04:54
合計ジャッジ時間 5,994 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;

class Magatro
{
    static int[] ans = new int[200];
    static string w = "00000000001234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991";
    static int N = int.Parse(Console.ReadLine());
    static void Main()
    {
        var a = w.Reverse();
        string ss = string.Join("", a);
        for(int i = 0; i < 199; i++)
        {
            ans[i] += int.Parse(ss[i].ToString()) * N;
            int nex = ans[i] / 10;
            ans[i] %= 10;
            ans[i + 1] += nex;
        }
        string s = "";
        bool sta = false;
        for(int i = 0; i < 200; i++)
        {
            if ((!sta && ans[199-i] != 0)||i==9)
            {
                sta = true;
            }
            if (sta)
            {
                s += ans[199 - i];
            }
            if (i == 9)
            {
                s += ".";
            }
        }
        Console.WriteLine(s);
    }
}


0