結果
| 問題 |
No.2903 A Round-the-World Trip with the Tent
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-09-27 21:07:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 314 bytes |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 82,224 KB |
| 実行使用メモリ | 343,680 KB |
| 最終ジャッジ日時 | 2024-09-27 21:07:39 |
| 合計ジャッジ時間 | 3,743 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | -- * 42 |
ソースコード
K,N=map(int,input().split())
D=[[] for n in range(N+1)]
for d in range(1,N+1):
for n in range(2*d,N+1,d):
D[n].append(d)
mod=998244353
dp=[0]*(N+1)
for n in range(1,N+1):
dp[n]=pow(2,n,mod)
if K>1:
dp[n]+=1
for d in D[n]:
dp[n]-=dp[d]
dp[n]%=mod
ans=dp[N]
print(ans)
vwxyz