結果

問題 No.2891 Mint
ユーザー 👑 kakel-sankakel-san
提出日時 2024-09-13 22:57:28
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 1,102 bytes
コンパイル時間 10,162 ms
コンパイル使用メモリ 166,780 KB
実行使用メモリ 189,360 KB
最終ジャッジ日時 2024-09-13 22:57:45
合計ジャッジ時間 16,449 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
29,820 KB
testcase_01 AC 55 ms
29,940 KB
testcase_02 AC 55 ms
29,696 KB
testcase_03 AC 55 ms
29,696 KB
testcase_04 AC 78 ms
30,076 KB
testcase_05 AC 55 ms
29,696 KB
testcase_06 WA -
testcase_07 AC 55 ms
29,824 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 55 ms
29,568 KB
testcase_12 AC 56 ms
29,952 KB
testcase_13 AC 56 ms
29,824 KB
testcase_14 AC 58 ms
29,824 KB
testcase_15 WA -
testcase_16 AC 55 ms
29,824 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 73 ms
30,080 KB
testcase_38 AC 72 ms
30,080 KB
testcase_39 AC 77 ms
30,208 KB
testcase_40 AC 77 ms
30,188 KB
testcase_41 AC 68 ms
30,080 KB
testcase_42 AC 56 ms
29,824 KB
testcase_43 AC 56 ms
29,696 KB
testcase_44 AC 55 ms
29,944 KB
testcase_45 AC 56 ms
29,824 KB
testcase_46 AC 54 ms
29,824 KB
testcase_47 AC 75 ms
30,080 KB
testcase_48 AC 75 ms
29,952 KB
testcase_49 AC 78 ms
29,952 KB
testcase_50 AC 63 ms
30,208 KB
testcase_51 AC 73 ms
30,080 KB
testcase_52 AC 62 ms
30,208 KB
testcase_53 AC 69 ms
30,076 KB
testcase_54 AC 71 ms
29,952 KB
testcase_55 AC 59 ms
29,952 KB
testcase_56 AC 78 ms
189,360 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (95 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var (n, m) = (c[0], c[1]);
        var mod = 998_244_353;
        var sq = (int)Math.Sqrt(m);
        var ans = 0L;
        for (var k = 1; k < sq && k <= n; ++k)
        {
            ans = (ans + m % k) % mod;
        }
        for (var rk = 1; rk <= sq; ++rk)
        {
            var mink = m / (rk + 1) + 1;
            mink = Math.Max(mink, sq);
            var maxk = m / rk;
            maxk = Math.Min(maxk, n);
            if (mink <= maxk)
            {
                var count = maxk - mink + 1;
                ans = (ans + m * count - (mink + maxk) * count / 2 % mod * rk) % mod;
            }
        }
        if (n > m) ans = (ans + m * (n - m) % mod) % mod;
        WriteLine(ans);
    }
}
0