結果

問題 No.2647 [Cherry 6th Tune A] Wind
ユーザー bluemeganebluemegane
提出日時 2024-02-24 06:54:45
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 770 bytes
コンパイル時間 13,219 ms
コンパイル使用メモリ 158,316 KB
実行使用メモリ 178,248 KB
最終ジャッジ日時 2024-02-24 06:55:01
合計ジャッジ時間 13,333 ms
ジャッジサーバーID
(参考情報)
judge16 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
31,012 KB
testcase_01 AC 60 ms
31,524 KB
testcase_02 AC 60 ms
31,396 KB
testcase_03 AC 60 ms
31,652 KB
testcase_04 AC 59 ms
31,268 KB
testcase_05 AC 61 ms
31,780 KB
testcase_06 AC 62 ms
31,780 KB
testcase_07 AC 66 ms
31,652 KB
testcase_08 AC 63 ms
31,908 KB
testcase_09 AC 65 ms
32,804 KB
testcase_10 AC 64 ms
32,804 KB
testcase_11 AC 66 ms
33,572 KB
testcase_12 AC 66 ms
33,572 KB
testcase_13 AC 57 ms
178,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (118 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using static System.Math;
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 = int.Parse(line[0]);
            var a = long.Parse(line[1]);
            line = Console.ReadLine().Trim().Split(' ');
            var x = Array.ConvertAll(line, long.Parse);
            getAns(n, a, x);
        }
    }
    static void getAns(int n, long a, long[] x)
    {
        var ans = new long[n];
        for (int i = 0; i < n; i++)
        {
            ans[i] = (long)Round((decimal)x[i] / a, 0, MidpointRounding.AwayFromZero);
        }
        Console.WriteLine(string.Join(" ", ans));
    }
}
0