結果

問題 No.39 桁の数字を入れ替え
ユーザー 双六双六
提出日時 2020-07-22 10:10:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 114 ms / 5,000 ms
コード長 496 bytes
コンパイル時間 911 ms
コンパイル使用メモリ 87,016 KB
実行使用メモリ 72,964 KB
最終ジャッジ日時 2023-09-01 21:31:38
合計ジャッジ時間 3,850 ms
ジャッジサーバーID
(参考情報)
judge12 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
72,868 KB
testcase_01 AC 111 ms
72,700 KB
testcase_02 AC 113 ms
72,652 KB
testcase_03 AC 112 ms
72,792 KB
testcase_04 AC 111 ms
72,788 KB
testcase_05 AC 110 ms
72,800 KB
testcase_06 AC 111 ms
72,620 KB
testcase_07 AC 110 ms
72,720 KB
testcase_08 AC 112 ms
72,640 KB
testcase_09 AC 112 ms
72,596 KB
testcase_10 AC 111 ms
72,812 KB
testcase_11 AC 112 ms
72,652 KB
testcase_12 AC 113 ms
72,484 KB
testcase_13 AC 113 ms
72,876 KB
testcase_14 AC 111 ms
72,964 KB
testcase_15 AC 114 ms
72,808 KB
testcase_16 AC 111 ms
72,624 KB
testcase_17 AC 112 ms
72,696 KB
testcase_18 AC 113 ms
72,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys; input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")
import copy

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	S = list(input())
	N = len(S)
	L = [int("".join(S))]
	for i in range(N):
		for j in range(N):
			ll = copy.copy(S)
			ll[i], ll[j] = ll[j], ll[i]
			s = int("".join(ll))
			L.append(s)

	L.sort()
	print(L[-1])



if __name__ == '__main__':
	main()
0