結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー parukiparuki
提出日時 2024-03-03 01:00:40
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 1,623 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 6,548 KB
実行使用メモリ 70,744 KB
最終ジャッジ日時 2024-03-22 05:43:38
合計ジャッジ時間 22,478 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
37,632 KB
testcase_01 AC 1,598 ms
69,492 KB
testcase_02 AC 1,566 ms
68,596 KB
testcase_03 AC 1,565 ms
68,596 KB
testcase_04 AC 1,568 ms
68,596 KB
testcase_05 AC 1,623 ms
70,744 KB
testcase_06 AC 1,602 ms
70,744 KB
testcase_07 AC 262 ms
48,964 KB
testcase_08 AC 265 ms
48,964 KB
testcase_09 AC 141 ms
44,616 KB
testcase_10 AC 142 ms
44,616 KB
testcase_11 AC 69 ms
37,760 KB
testcase_12 AC 69 ms
37,760 KB
testcase_13 AC 190 ms
38,628 KB
testcase_14 AC 179 ms
38,500 KB
testcase_15 AC 161 ms
38,372 KB
testcase_16 AC 178 ms
38,500 KB
testcase_17 AC 187 ms
38,756 KB
testcase_18 AC 171 ms
38,500 KB
testcase_19 AC 179 ms
38,628 KB
testcase_20 AC 207 ms
38,756 KB
testcase_21 AC 179 ms
38,628 KB
testcase_22 AC 181 ms
38,628 KB
testcase_23 AC 210 ms
38,884 KB
testcase_24 AC 212 ms
38,884 KB
testcase_25 AC 210 ms
38,884 KB
testcase_26 AC 211 ms
38,884 KB
testcase_27 AC 211 ms
38,884 KB
testcase_28 AC 211 ms
38,884 KB
testcase_29 AC 212 ms
38,884 KB
testcase_30 AC 211 ms
38,884 KB
testcase_31 AC 212 ms
38,884 KB
testcase_32 AC 210 ms
38,884 KB
testcase_33 AC 210 ms
38,884 KB
testcase_34 AC 1,555 ms
67,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

function Main(lines) {
    const T = parseInt(lines[0]);
    for(let i=0; i<T; ++i) {
        const NM = lines[i+1].split(" ").map(BigInt);
        let M = NM[1];
        let N = NM[0] % (2n*M);
        const r = N*(N+1n)%(2n*M)/2n;
        console.log(r.toString());
    }
}
0