結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
popketle
|
| 提出日時 | 2020-02-16 11:37:54 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 970 ms / 5,000 ms |
| コード長 | 308 bytes |
| 記録 | |
| コンパイル時間 | 536 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 63,068 KB |
| 最終ジャッジ日時 | 2026-04-22 16:55:50 |
| 合計ジャッジ時間 | 5,019 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
import itertools
N=list(input())
all_pattern=list(itertools.permutations(N))
ans=0
for pattern in all_pattern:
cnt,tmp=0,''
for i in range(len(N)):
if pattern[i]!=N[i]: cnt+=1
if cnt>2:
break
tmp+=pattern[i]
if cnt<=2:
ans=max(ans,int(tmp))
print(ans)
popketle