結果

問題 No.2211 Frequency Table of GCD
ユーザー mkawa2mkawa2
提出日時 2023-02-10 21:44:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 197 ms / 2,000 ms
コード長 1,032 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 107,936 KB
最終ジャッジ日時 2023-09-22 01:03:09
合計ジャッジ時間 6,252 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,408 KB
testcase_01 AC 68 ms
71,184 KB
testcase_02 AC 68 ms
71,604 KB
testcase_03 AC 143 ms
85,652 KB
testcase_04 AC 149 ms
92,148 KB
testcase_05 AC 168 ms
100,424 KB
testcase_06 AC 153 ms
88,168 KB
testcase_07 AC 176 ms
97,732 KB
testcase_08 AC 83 ms
85,844 KB
testcase_09 AC 77 ms
81,328 KB
testcase_10 AC 96 ms
97,752 KB
testcase_11 AC 88 ms
90,672 KB
testcase_12 AC 99 ms
100,824 KB
testcase_13 AC 143 ms
88,964 KB
testcase_14 AC 158 ms
88,748 KB
testcase_15 AC 148 ms
87,268 KB
testcase_16 AC 155 ms
88,608 KB
testcase_17 AC 166 ms
98,932 KB
testcase_18 AC 194 ms
107,884 KB
testcase_19 AC 194 ms
107,716 KB
testcase_20 AC 195 ms
107,640 KB
testcase_21 AC 195 ms
107,688 KB
testcase_22 AC 197 ms
107,616 KB
testcase_23 AC 147 ms
86,624 KB
testcase_24 AC 179 ms
107,828 KB
testcase_25 AC 100 ms
104,116 KB
testcase_26 AC 69 ms
71,680 KB
testcase_27 AC 185 ms
107,776 KB
testcase_28 AC 189 ms
107,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# inf = (1 << 31)-1
# md = 10**9+7
md = 998244353

n,m=LI()
aa=LI()
cnt=[0]*(m+1)
for a in aa:cnt[a]+=1

for a in range(1,m//2+1):
    for b in range(a+a,m+1,a):
        cnt[a]+=cnt[b]
# pDB(cnt)

dp=[0]*(m+1)
for a in range(m,0,-1):
    dp[a]=pow(2,cnt[a],md)-1
    for b in range(a+a,m+1,a):
        dp[a]-=dp[b]
        dp[a]%=md

print(*dp[1:],sep="\n")
0