結果
| 問題 |
No.927 Second Permutation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-28 23:16:37 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 347 bytes |
| コンパイル時間 | 81 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 13,100 KB |
| 最終ジャッジ日時 | 2024-10-12 18:40:33 |
| 合計ジャッジ時間 | 2,201 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 17 |
ソースコード
x = list(input())
if len(set(x)) == 1:
print(-1)
else:
l = sorted(x)
for i in range(1,len(l)):
if l[0] != l[i]:
l[0],l[i]=l[i],l[0]
r=''.join(list(reversed(l)))
if r[0] == '0':
print(-1)
else:
print(r)
break
else:
print(-1)