結果

問題 No.1156 Nada Picnic 2
ユーザー akitsugu777akitsugu777
提出日時 2020-12-08 14:49:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 11,816 KB
実行使用メモリ 10,088 KB
最終ジャッジ日時 2023-10-17 17:15:11
合計ジャッジ時間 3,291 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 514 ms
10,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

N = int(input())

L = []
for a, b, c, d, e, f, g in permutations(range(10), 7):
    if 100*a+10*b+c + 100*d+10*e+f == 1000+100*g+10*c+b and a != b != c != d != e != f != g != 1:
        L += [1000+100*g+10*c+b]
        break

for a, b, c, d, e, f, g, h, i in permutations(range(10), 9):
    if 1000*a+100*a+10*b+c + 1000*d+100*e+10*f+g == 10000+1000*h+100*b+10*c+i and a != b != c != d != e != f != g != h != i!= 1:
        L += [10000+1000*h+100*b+10*c+i]
        break

L += [841341]

print(L[N-1])
0