結果

問題 No.1339 循環小数
ユーザー keymoonkeymoon
提出日時 2021-01-15 21:54:58
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 938 bytes
コンパイル時間 699 ms
コンパイル使用メモリ 103,808 KB
実行使用メモリ 28,988 KB
最終ジャッジ日時 2024-05-04 23:35:02
合計ジャッジ時間 5,063 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
28,988 KB
testcase_01 AC 22 ms
23,520 KB
testcase_02 AC 23 ms
23,260 KB
testcase_03 AC 21 ms
25,664 KB
testcase_04 AC 19 ms
17,536 KB
testcase_05 AC 20 ms
17,792 KB
testcase_06 AC 20 ms
17,536 KB
testcase_07 AC 21 ms
17,792 KB
testcase_08 AC 21 ms
17,792 KB
testcase_09 AC 20 ms
17,920 KB
testcase_10 AC 19 ms
17,664 KB
testcase_11 AC 45 ms
17,536 KB
testcase_12 AC 47 ms
17,664 KB
testcase_13 AC 42 ms
17,536 KB
testcase_14 AC 44 ms
17,664 KB
testcase_15 AC 42 ms
17,664 KB
testcase_16 AC 41 ms
17,792 KB
testcase_17 AC 48 ms
17,664 KB
testcase_18 AC 38 ms
17,920 KB
testcase_19 AC 37 ms
17,536 KB
testcase_20 AC 36 ms
17,664 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        int t = int.Parse(Console.ReadLine());
        for (int i = 0; i < t; i++)
        {
            long n = int.Parse(Console.ReadLine());
            while (n % 2 == 0) n /= 2;
            while (n % 5 == 0) n /= 5;
            long[] table = new long[10];
            for (int j = 0; j < 10; j++) table[9 - (n * j) % 10] = n * j;
            int len = 0;
            long val = 0;
            do
            {
                val += table[val % 10];
                val /= 10;
                len++;
            }
            while (val != 0);
            Console.WriteLine(len);
        }
    }
}
0