結果
| 問題 | No.443 GCD of Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-08 19:25:45 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 336 bytes |
| 記録 | |
| コンパイル時間 | 328 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 21,760 KB |
| 最終ジャッジ日時 | 2026-04-25 11:27:08 |
| 合計ジャッジ時間 | 5,060 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)