結果
問題 |
No.443 GCD of Permutation
|
ユーザー |
![]() |
提出日時 | 2025-06-12 21:32:30 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 328 bytes |
コンパイル時間 | 180 ms |
コンパイル使用メモリ | 82,548 KB |
実行使用メモリ | 60,084 KB |
最終ジャッジ日時 | 2025-06-12 21:33:49 |
合計ジャッジ時間 | 2,311 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 WA * 14 |
ソースコード
n = input().strip() # Check if all digits are the same all_same = True first = n[0] for c in n: if c != first: all_same = False break if all_same: print(n) else: s = sum(int(c) for c in n) if s % 9 == 0: print(s) else: import math g = math.gcd(s, 9) print(g)