結果

問題 No.2891 Mint
ユーザー PNJPNJ
提出日時 2024-09-13 21:33:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 469 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 75,520 KB
最終ジャッジ日時 2024-09-13 21:33:45
合計ジャッジ時間 5,869 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,840 KB
testcase_01 AC 41 ms
51,712 KB
testcase_02 AC 44 ms
52,736 KB
testcase_03 AC 41 ms
52,224 KB
testcase_04 AC 73 ms
57,856 KB
testcase_05 AC 41 ms
51,584 KB
testcase_06 AC 124 ms
75,264 KB
testcase_07 AC 41 ms
51,840 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 42 ms
51,840 KB
testcase_12 AC 41 ms
51,840 KB
testcase_13 AC 41 ms
52,096 KB
testcase_14 AC 41 ms
51,712 KB
testcase_15 WA -
testcase_16 AC 43 ms
52,224 KB
testcase_17 AC 103 ms
71,168 KB
testcase_18 AC 81 ms
66,560 KB
testcase_19 AC 78 ms
65,664 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 115 ms
73,728 KB
testcase_26 AC 113 ms
73,216 KB
testcase_27 AC 111 ms
72,704 KB
testcase_28 WA -
testcase_29 AC 79 ms
66,432 KB
testcase_30 WA -
testcase_31 AC 84 ms
66,432 KB
testcase_32 WA -
testcase_33 AC 87 ms
68,224 KB
testcase_34 AC 92 ms
68,864 KB
testcase_35 AC 96 ms
70,016 KB
testcase_36 WA -
testcase_37 AC 65 ms
57,856 KB
testcase_38 AC 65 ms
57,856 KB
testcase_39 AC 71 ms
57,856 KB
testcase_40 AC 71 ms
57,600 KB
testcase_41 AC 60 ms
57,856 KB
testcase_42 AC 41 ms
51,712 KB
testcase_43 AC 41 ms
52,096 KB
testcase_44 AC 41 ms
51,584 KB
testcase_45 AC 42 ms
51,584 KB
testcase_46 AC 40 ms
52,096 KB
testcase_47 AC 68 ms
57,984 KB
testcase_48 AC 68 ms
57,728 KB
testcase_49 AC 74 ms
57,728 KB
testcase_50 AC 54 ms
57,600 KB
testcase_51 AC 66 ms
57,728 KB
testcase_52 AC 52 ms
57,728 KB
testcase_53 AC 62 ms
57,856 KB
testcase_54 AC 64 ms
58,240 KB
testcase_55 AC 50 ms
57,600 KB
testcase_56 AC 73 ms
57,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353

N,M = map(int,input().split())

ans = 0
for k in range(1,M + 1):
  if k * k > M:
    break
  if k > N:
    break
  ans += M % k
  ans %= mod

for q in range(1,M + 1):
  if (q + 1) * (q + 1) > M:
    break
  l = M // (q + 1) + 1
  r = min(M // q,N)
  if l > N:
    continue
  s = (l + r) * (r - l + 1) // 2
  s %= mod
  c = (r - l + 1) % mod
  res = c * M % mod - s * q % mod
  ans = (ans + res) % mod
ans += M * max(N - M,0) % mod
ans %= mod
print(ans)
0