結果
| 問題 | No.443 GCD of Permutation | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-11-11 22:50:52 | 
| 言語 | Python2 (2.7.18) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 349 bytes | 
| コンパイル時間 | 306 ms | 
| コンパイル使用メモリ | 6,948 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-11-25 09:05:42 | 
| 合計ジャッジ時間 | 1,665 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 13 WA * 15 | 
ソースコード
from itertools import combinations
N = raw_input()
if all(d==N[0] for d in N):
    print N
    exit()
ans = 1
S = set(N)
if all(int(d1+d2)%4==0 for d1, d2 in combinations(S, 2)):
    ans *= 4
elif all(int(d)%2==0 for d in S):
    ans *= 2
if sum(int(d) for d in N)%9 == 0:
    ans *= 9
elif sum(int(d) for d in N)%3 == 0:
    ans *= 3
print ans
            
            
            
        