2022-03-22から1日間の記事一覧
yukicoder.me 解答 from itertools import permutations K = int(input()) N = permutations('12345678',8) cnt = 0 for i in N: if int(''.join(list(i))) % K == 0: cnt += 1 print(cnt) permutations('****', N) これは第一引数の文字列をN個並べてできる…
yukicoder.me 解答 from itertools import permutations K = int(input()) N = permutations('12345678',8) cnt = 0 for i in N: if int(''.join(list(i))) % K == 0: cnt += 1 print(cnt) permutations('****', N) これは第一引数の文字列をN個並べてできる…