結果

問題 No.1156 Nada Picnic 2
ユーザー akitsugu777
提出日時 2020-12-08 15:10:16
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 781 ms / 2,000 ms
コード長 657 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 439 ms
コンパイル使用メモリ 20,824 KB
実行使用メモリ 15,228 KB
最終ジャッジ日時 2026-04-06 08:05:02
合計ジャッジ時間 4,236 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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 b == 1 and [1] not in [a, c, d, e, f] \
    and len(set([a, b, c, d, e, f])) == 6:
        L += [1000+100*g+10*c+b]
        break

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

L += [841341]

print(L[N-1])
0