結果
問題 |
No.927 Second Permutation
|
ユーザー |
![]() |
提出日時 | 2020-04-01 15:50:13 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 409 bytes |
コンパイル時間 | 580 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 65,664 KB |
最終ジャッジ日時 | 2024-06-26 22:26:51 |
合計ジャッジ時間 | 2,809 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 WA * 1 RE * 21 |
ソースコード
x = int(input()) s = list(str(x)) if len(set(s)) == 1: print(-1) exit() s = [int(i) for i in s] s.sort(reverse=True) if len(s) == 2: ans = str(s[1])+str(s[0]) if s[1] == 0: print(-1) exit() else: print(ans) exit() ans = str(s[0])+str(s[2]) for i in range(len(s)): if i == 0 or i == 2: continue else: ans += str(s[i]) print(ans)