結果
問題 |
No.443 GCD of Permutation
|
ユーザー |
|
提出日時 | 2017-06-23 13:45:19 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 374 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-03 04:09:50 |
合計ジャッジ時間 | 1,769 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 WA * 9 |
ソースコード
num = input() digits = list(map(int, list(num))) ans = 1 if all(d%8 == 0 for d in digits): ans *= 4 elif all(d%4 == 0 for d in digits): ans *= 4 elif all(d%2 == 0 for d in digits): ans *= 2 if sum(digits)%9 == 0: ans *= 9 elif sum(digits)%3 == 0: ans *= 3 if all(d%5 == 0 for d in digits): ans *= 5 if len(set(digits)) == 1: print(num) else: print(ans)