結果
| 問題 |
No.443 GCD of Permutation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-08 19:25:45 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 336 bytes |
| コンパイル時間 | 1,731 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,828 KB |
| 最終ジャッジ日時 | 2024-10-09 08:40:58 |
| 合計ジャッジ時間 | 3,757 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 RE * 1 TLE * 1 -- * 16 |
ソースコード
#!/usr/bin/python3
from math import gcd
import itertools
N_list= list(input())
gcd_total=None
for i in itertools.permutations(N_list):
if not gcd_total:
gcd_total = int("".join(i))
elif gcd_total==1:
print(1)
exit()
else:
i=int("".join(i))
gcd_total=gcd(i,gcd_total)
print(gcd_total)