結果
問題 |
No.927 Second Permutation
|
ユーザー |
![]() |
提出日時 | 2021-04-12 14:21:26 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 318 bytes |
コンパイル時間 | 306 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 14,016 KB |
最終ジャッジ日時 | 2024-06-28 12:04:18 |
合計ジャッジ時間 | 2,948 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 16 |
ソースコード
n=sorted(input())[::-1] if len(set(n))==1: print(-1) elif len(n)==2: if int(n[1])==0: print(-1) else: print(n[1],n[0],sep='') else: for i in range(2,len(n)): if n[1]>n[i]: n[1],n[i]=n[i],n[1] print(*n,sep='') break else: print(-1)