結果
| 問題 |
No.927 Second Permutation
|
| コンテスト | |
| ユーザー |
numatanumanuma
|
| 提出日時 | 2020-03-10 06:14:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 282 bytes |
| コンパイル時間 | 91 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-11-15 23:04:28 |
| 合計ジャッジ時間 | 2,000 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 2 |
| other | AC * 2 WA * 1 RE * 24 |
ソースコード
X = int(input())
if X % 10 == 0 or len(set(X)) == 1:
print(-1)
else:
X = list(X)
X.sort()
p = X[0]
n = len(X)
for i in range(1, n):
if p != X[i]:
tmp = X[i]
X[i] = p
X[0] = tmp
print(''.join(X[::-1]))
numatanumanuma