結果

問題 No.1644 Eight Digits
コンテスト
ユーザー sgsw
提出日時 2021-08-13 21:55:06
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 53 ms / 1,000 ms
コード長 599 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 268 ms
コンパイル使用メモリ 85,376 KB
実行使用メモリ 80,896 KB
最終ジャッジ日時 2026-04-19 19:48:56
合計ジャッジ時間 2,964 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

'''
    Python3(PyPy3) Template for Programming-Contest.

    author : sgsw

    generated : 2021/08/13   
    when : 21:53:11

'''

import sys


def input():
    return sys.stdin.readline().rstrip()


DXY = [(0, -1), (1, 0), (0, 1), (-1, 0)]  # LDRU
mod = 998244353
inf = 1 << 64

from itertools import permutations
def main():
    d = int(input())
    ans = 0
    perm = [i + 1 for i in range(8)]
    for array in permutations(perm):
        num = "".join(list(map(str,array)))
        if int(num) % d == 0:
            ans += 1
    print(ans)
    return 0


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