結果
| 問題 | No.927 Second Permutation |
| コンテスト | |
| ユーザー |
liny_tail
|
| 提出日時 | 2023-01-03 17:44:46 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 342 bytes |
| 記録 | |
| コンパイル時間 | 406 ms |
| コンパイル使用メモリ | 20,832 KB |
| 実行使用メモリ | 24,568 KB |
| 最終ジャッジ日時 | 2026-05-21 08:55:43 |
| 合計ジャッジ時間 | 5,206 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 TLE * 1 -- * 21 |
ソースコード
import itertools
def calc(lst):
M = ''
for i in itertools.permutations(lst, r = len(lst)):
if M == '':
M = ''.join(i)
else:
tmp = ''.join(i)
if M != tmp:
return tmp
else:
return '0'
X = input().strip()
X = sorted(list(X), reverse=True)
ans = calc(X)
if ans[0] == '0':
ans = '-1'
print(ans)
liny_tail