結果
| 問題 | No.927 Second Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-04 10:11:34 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 319 ms / 2,000 ms |
| + 296µs | |
| コード長 | 259 bytes |
| 記録 | |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 80,896 KB |
| 実行使用メモリ | 110,008 KB |
| 最終ジャッジ日時 | 2026-07-18 20:32:44 |
| 合計ジャッジ時間 | 6,475 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#yuki927 import sys x=[c for c in raw_input()] x=sorted(x,reverse=True) if x[0]==x[-1] or x[1]=='0': print -1 sys.exit() for i in range(len(x)-1,0,-1): if x[i]!=x[i-1]: x[i],x[i-1]=x[i-1],x[i] break res='' for i in range(len(x)): res+=x[i] print res