結果
問題 |
No.927 Second Permutation
|
ユーザー |
|
提出日時 | 2022-05-17 11:04:21 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 104 ms / 2,000 ms |
コード長 | 290 bytes |
コンパイル時間 | 473 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 84,992 KB |
最終ジャッジ日時 | 2024-09-15 05:06:42 |
合計ジャッジ時間 | 3,711 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
X = input() l = list(map(int,list(X))) s = set(l) N = len(l) import sys if len(s) == 1: print(-1) exit() l.sort(reverse = True) u = N - 1 while l[u] == l[-1]: u -= 1 l[u],l[u + 1] = l[u + 1],l[u] if l[0] == 0: print(-1) exit() for i in l: print(i,end = "") print()