結果
| 問題 | No.927 Second Permutation |
| コンテスト | |
| ユーザー |
s_shohei
|
| 提出日時 | 2020-04-13 22:35:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 310 bytes |
| 記録 | |
| コンパイル時間 | 158 ms |
| コンパイル使用メモリ | 82,180 KB |
| 実行使用メモリ | 89,300 KB |
| 最終ジャッジ日時 | 2024-09-25 11:15:47 |
| 合計ジャッジ時間 | 3,292 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 17 |
ソースコード
x=list(input())
if len(set(x))==1: # 999
print(-1)
exit()
flg=True
for i in range(1,len(x)):
if x[i] != "0":
flg=False
if flg:
print(-1)
exit()
x.sort()
for i in range(1,len(x)):
if x[0] != x[i]:
x[0],x[i] = x[i],x[0]
break
x=list(reversed(x))
print(*x,sep="")
s_shohei