結果
問題 |
No.927 Second Permutation
|
ユーザー |
|
提出日時 | 2020-01-12 18:45:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 216 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 299,680 KB |
最終ジャッジ日時 | 2024-11-30 00:36:58 |
合計ジャッジ時間 | 67,933 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 2 WA * 3 TLE * 22 |
ソースコード
from itertools import permutations x = input() l = [i for i in x] ans = sorted("".join(p) for p in permutations(x, len(x))) if ans[-2] == x: print(-1) if ans[-2][0] == "0": print(-1) else: print(ans[-2])