結果

問題 No.1644 Eight Digits
ユーザー chineristACchineristAC
提出日時 2021-08-13 21:24:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 1,000 ms
コード長 1,172 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 82,260 KB
実行使用メモリ 76,384 KB
最終ジャッジ日時 2024-04-14 16:35:55
合計ジャッジ時間 3,599 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
74,740 KB
testcase_01 AC 72 ms
73,552 KB
testcase_02 AC 70 ms
73,176 KB
testcase_03 AC 71 ms
75,648 KB
testcase_04 AC 75 ms
75,116 KB
testcase_05 AC 70 ms
75,272 KB
testcase_06 AC 73 ms
74,740 KB
testcase_07 AC 70 ms
74,956 KB
testcase_08 AC 71 ms
75,652 KB
testcase_09 AC 71 ms
75,032 KB
testcase_10 AC 70 ms
74,308 KB
testcase_11 AC 71 ms
74,348 KB
testcase_12 AC 71 ms
74,744 KB
testcase_13 AC 71 ms
75,108 KB
testcase_14 AC 71 ms
74,188 KB
testcase_15 AC 73 ms
74,716 KB
testcase_16 AC 70 ms
75,140 KB
testcase_17 AC 72 ms
74,320 KB
testcase_18 AC 72 ms
74,568 KB
testcase_19 AC 70 ms
75,096 KB
testcase_20 AC 70 ms
76,384 KB
testcase_21 AC 71 ms
74,880 KB
testcase_22 AC 72 ms
75,020 KB
testcase_23 AC 71 ms
74,964 KB
testcase_24 AC 70 ms
74,172 KB
testcase_25 AC 72 ms
73,908 KB
testcase_26 AC 70 ms
73,328 KB
testcase_27 AC 76 ms
74,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

spf = [i for i in range(10**5)]
for i in range(2,10**5):
    if spf[i]!=i:
        continue
    for j in range(2*i,10**5,i):
        spf[j] = i

def factorization(n):
    res = []
    for i in range(2,n+1):
        if i**2 > n:
            break
        if n%i==0:
            assert spf[i]==i
            cnt = 0
            while n%i==0:
                cnt += 1
                n //= i
            res.append((i,cnt))
    if n!=1:
        res.append((n,1))
    return res

def divisors(n):
    res = []
    for i in range(2,n+1):
        if i**2 >= n:
            break
        if n%i==0:
            res.append(i)
            res.append(n//i)
    if i**2==n:
        res.append(i)
    return res

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import gcd,log

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

K = int(input())

L = permutations([i+1 for i in range(8)])
res = 0
for p in L:
    tmp = 0
    for i in range(8):
        tmp = 10 * tmp + p[i]
    if tmp%K==0:
        res += 1

print(res)
0