結果
| 問題 |
No.1339 循環小数
|
| コンテスト | |
| ユーザー |
GER_chen
|
| 提出日時 | 2021-01-22 15:00:18 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 736 bytes |
| コンパイル時間 | 457 ms |
| コンパイル使用メモリ | 12,288 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-12-26 15:02:05 |
| 合計ジャッジ時間 | 11,707 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 36 |
ソースコード
#yuki-1339
T = int(input())
for _ in range(T):
N = int(input())
while not N%2:
N //= 2
while not N%5:
N //= 5
i, ans, M = 3, N, N
while i**2 <= N:
if not N%i:
ans -= ans//i
while not N%i:
N //= i
i += 2
if N > 1:
ans -= ans//N
if ans < 2:
print(1)
else:
fw, bw = [], []
j = 1
while j**2 <= ans:
if not ans%j:
fw.append(j)
bw.append(ans//j)
j += 2
d = fw+bw[::-1]
flag = 0
i = 0
while not flag:
if pow(10, d[i], M) == 1:
print(d[i])
flag = 1
i += 1
GER_chen