結果
問題 |
No.927 Second Permutation
|
ユーザー |
![]() |
提出日時 | 2020-03-29 14:51:25 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 293 bytes |
コンパイル時間 | 372 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 11,520 KB |
最終ジャッジ日時 | 2025-01-02 13:26:55 |
合計ジャッジ時間 | 2,512 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 17 |
ソースコード
from collections import Counter x = list(input().strip()) c = Counter(x) if len(c.keys()) == 1: print(-1) elif c['0'] == len(x) - 1: print(-1) else: v = sorted(c.keys())[1] c[v] -= 1 for i in sorted(c.keys(), reverse=True): print(i * c[i], end='') print(v)