結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー bluemegane
提出日時 2024-03-02 15:23:57
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 1,438 ms / 2,000 ms
コード長 519 bytes
コンパイル時間 7,109 ms
コンパイル使用メモリ 169,852 KB
実行使用メモリ 209,784 KB
最終ジャッジ日時 2024-09-29 15:58:09
合計ジャッジ時間 39,067 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (91 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.Numerics;
using System;

public class Hello
{
    static void Main()
    {
        var T = int.Parse(Console.ReadLine().Trim());
        while (T-- > 0)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            var n = BigInteger.Parse(line[0]);
            var m = int.Parse(line[1]);
            getAns(n, m);
        }
    }
    static void getAns(BigInteger n, int m)
    {
        var a = n * (n + 1) / 2;
        var ans = a % m;
        Console.WriteLine(ans);
    }
}
0