結果
問題 |
No.3028 No.9999
|
ユーザー |
|
提出日時 | 2025-02-22 15:32:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 36 ms / 4,000 ms |
コード長 | 552 bytes |
コンパイル時間 | 632 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2025-02-22 15:32:49 |
合計ジャッジ時間 | 2,231 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
import math N = int(input()) def find_divisors(n): divisors = [] for i in range(1, int(n**0.5) + 1): if n % i == 0: divisors.append(i) if i != n // i: # 同じ約数を二重に追加しない divisors.append(n // i) return sorted(divisors) if N == 1: print(1) else: N_factor = find_divisors(N)[1:] totient = N while N_factor: totient = (totient*(N_factor[0]-1))//N_factor[0] N_factor = [k for k in N_factor if k % N_factor[0] != 0] print(min([k for k in find_divisors(totient) if pow(10,k,N) == 1]))