結果

問題 No.1339 循環小数
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-02-12 11:33:16
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 311 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 538,416 KB
最終ジャッジ日時 2023-09-26 11:02:44
合計ジャッジ時間 7,581 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
76,040 KB
testcase_01 AC 76 ms
75,908 KB
testcase_02 AC 80 ms
76,224 KB
testcase_03 AC 77 ms
75,736 KB
testcase_04 AC 78 ms
75,788 KB
testcase_05 AC 76 ms
75,908 KB
testcase_06 AC 77 ms
75,796 KB
testcase_07 AC 77 ms
75,688 KB
testcase_08 AC 78 ms
75,684 KB
testcase_09 AC 78 ms
75,624 KB
testcase_10 AC 76 ms
75,908 KB
testcase_11 AC 174 ms
115,352 KB
testcase_12 AC 179 ms
110,872 KB
testcase_13 AC 159 ms
120,464 KB
testcase_14 AC 162 ms
106,084 KB
testcase_15 AC 163 ms
100,444 KB
testcase_16 AC 152 ms
99,140 KB
testcase_17 AC 194 ms
122,444 KB
testcase_18 AC 133 ms
91,988 KB
testcase_19 AC 137 ms
93,260 KB
testcase_20 AC 133 ms
94,140 KB
testcase_21 MLE -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main(n):
  now=1
  while now<n:now*=10
  d={}
  cnt=1
  while True:
    now%=n
    if now==0:return 1
    if now in d:return cnt-d[now]
    d[now]=cnt
    now*=10
    cnt+=1

if __name__=='__main__':
  t=int(input())
  cases=[int(input()) for _ in range(t)]
  for n in cases:
    ret=main(n)
    print(ret)
0