結果

問題 No.2647 [Cherry 6th Tune A] Wind
ユーザー paruki
提出日時 2024-03-02 23:24:39
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 617 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 6,816 KB
実行使用メモリ 41,856 KB
最終ジャッジ日時 2024-09-29 16:28:43
合計ジャッジ時間 1,727 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

function Main(input) {
    const lines = input.split("\n");
    const T = parseInt(lines[0]);
    for(let i=0; i<T; i++) {
        const DA = lines[1+i*2].split(" ");
        const D = parseInt(DA[0]);
        const A = BigInt(DA[1]);
        const X = lines[1+i*2+1].split(" ").map(BigInt);
        let answer = "";
        for(let i=0; i<D; ++i) {
            let y = X[i]/A;
            let r = X[i] % A;
            if(r*2n >= A) {
                y++;
            }
            answer += y + (i==D-1?"":" ");
        }
        console.log(answer);
    }
}
0