結果

問題 No.2647 [Cherry 6th Tune A] Wind
コンテスト
ユーザー aaa aa
提出日時 2025-12-08 20:37:55
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 755 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 8,633 ms
コンパイル使用メモリ 170,868 KB
実行使用メモリ 190,196 KB
最終ジャッジ日時 2025-12-08 20:38:13
合計ジャッジ時間 11,179 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (120 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #
raw source code

using System;
using System.Numerics;

class Program
{
    static void Main()
    {
        int T = int.Parse(Console.ReadLine());
        while (T-- > 0)
        {
            var parts = Console.ReadLine().Split();
            int D = int.Parse(parts[0]);
            BigInteger A = BigInteger.Parse(parts[1]);

            var xs = Console.ReadLine().Split();
            var ans = new BigInteger[D];

            BigInteger twoA = A * 2;

            for (int i = 0; i < D; i++)
            {
                BigInteger X = BigInteger.Parse(xs[i]);
                // 四捨五入: round(X / A) = floor((2X + A) / (2A))
                ans[i] = (X * 2 + A) / twoA;
            }

            Console.WriteLine(string.Join(" ", ans));
        }
    }
}
0