結果
問題 | No.927 Second Permutation |
ユーザー |
👑 |
提出日時 | 2020-08-24 17:28:58 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 307 bytes |
コンパイル時間 | 90 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-11-06 10:29:19 |
合計ジャッジ時間 | 2,575 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 RE * 15 |
ソースコード
x = input()lst = [i for i in x]lst.sort(reverse = True)if lst[0] == lst[-1] or lst[1] == "0":print(-1)exit()l = len(lst)for i in range(l - 1, 0, -1):if lst[i] == lst[i - 1]:continueelse:lst[i], lst[i - 1] = lst[i - 1], lst[i]breakprint(int("".join(lst)))