結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー miya145592miya145592
提出日時 2024-02-23 22:16:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 362 ms / 2,000 ms
コード長 263 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 112,608 KB
最終ジャッジ日時 2024-02-23 22:16:59
合計ジャッジ時間 6,814 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 208 ms
96,588 KB
testcase_02 AC 209 ms
96,588 KB
testcase_03 AC 212 ms
96,588 KB
testcase_04 AC 237 ms
96,588 KB
testcase_05 AC 362 ms
112,608 KB
testcase_06 AC 355 ms
112,608 KB
testcase_07 AC 87 ms
77,892 KB
testcase_08 AC 85 ms
77,764 KB
testcase_09 AC 62 ms
68,816 KB
testcase_10 AC 59 ms
68,816 KB
testcase_11 AC 37 ms
53,460 KB
testcase_12 AC 37 ms
53,460 KB
testcase_13 AC 95 ms
72,028 KB
testcase_14 AC 86 ms
71,528 KB
testcase_15 AC 81 ms
71,476 KB
testcase_16 AC 87 ms
71,548 KB
testcase_17 AC 100 ms
71,972 KB
testcase_18 AC 84 ms
71,456 KB
testcase_19 AC 97 ms
72,352 KB
testcase_20 AC 133 ms
74,008 KB
testcase_21 AC 94 ms
72,352 KB
testcase_22 AC 102 ms
72,012 KB
testcase_23 AC 133 ms
74,032 KB
testcase_24 AC 134 ms
74,032 KB
testcase_25 AC 134 ms
74,032 KB
testcase_26 AC 135 ms
74,032 KB
testcase_27 AC 133 ms
74,032 KB
testcase_28 AC 133 ms
74,032 KB
testcase_29 AC 134 ms
74,032 KB
testcase_30 AC 144 ms
74,032 KB
testcase_31 AC 133 ms
74,032 KB
testcase_32 AC 137 ms
74,032 KB
testcase_33 AC 132 ms
74,032 KB
testcase_34 AC 207 ms
96,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.set_int_max_str_digits(10**7)
input = sys.stdin.readline
T = int(input())
NM = [list(map(int, input().split())) for _ in range(T)]
#T = 1
#NM = [[int("1"*10**6), 123456]]
for n, m in NM:
    m2 = m*2
    ans = (n%m2)*((n+1)%m2)%m2
    print(ans//2)
0