結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー parukiparuki
提出日時 2024-03-03 00:38:57
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 1,467 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 70,656 KB
最終ジャッジ日時 2024-04-24 16:09:23
合計ジャッジ時間 18,344 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
38,528 KB
testcase_01 AC 1,371 ms
68,888 KB
testcase_02 AC 1,340 ms
68,764 KB
testcase_03 AC 1,334 ms
68,636 KB
testcase_04 AC 1,350 ms
68,636 KB
testcase_05 AC 1,437 ms
70,528 KB
testcase_06 AC 1,467 ms
70,656 KB
testcase_07 AC 270 ms
49,588 KB
testcase_08 AC 277 ms
49,720 KB
testcase_09 AC 108 ms
44,544 KB
testcase_10 AC 114 ms
44,544 KB
testcase_11 AC 57 ms
38,528 KB
testcase_12 AC 63 ms
38,528 KB
testcase_13 AC 197 ms
40,592 KB
testcase_14 AC 193 ms
40,588 KB
testcase_15 AC 177 ms
40,592 KB
testcase_16 AC 191 ms
40,784 KB
testcase_17 AC 206 ms
40,632 KB
testcase_18 AC 183 ms
40,456 KB
testcase_19 AC 221 ms
40,328 KB
testcase_20 AC 232 ms
39,976 KB
testcase_21 AC 199 ms
40,200 KB
testcase_22 AC 195 ms
40,844 KB
testcase_23 AC 265 ms
40,284 KB
testcase_24 AC 236 ms
40,548 KB
testcase_25 AC 231 ms
40,544 KB
testcase_26 AC 233 ms
40,284 KB
testcase_27 AC 229 ms
40,412 KB
testcase_28 AC 230 ms
40,544 KB
testcase_29 AC 236 ms
40,288 KB
testcase_30 AC 236 ms
40,288 KB
testcase_31 AC 234 ms
40,548 KB
testcase_32 AC 228 ms
40,292 KB
testcase_33 AC 236 ms
40,544 KB
testcase_34 AC 1,346 ms
66,652 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) {
        // NM = lines[i+1].split(" ").map((x)=>BigInt(x));
        const NM = lines[i+1].split(" ").map(BigInt);
        const M = NM[1];
        const N = NM[0];
        const ans = N*(N+1n)/2n%M;
        console.log(ans.toString());
    }
}
0