結果

問題 No.2649 [Cherry 6th Tune C] Anthem Flower
ユーザー arad
提出日時 2024-02-23 21:50:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 570 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 82,256 KB
実行使用メモリ 76,648 KB
最終ジャッジ日時 2024-09-29 06:13:41
合計ジャッジ時間 7,952 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.set_int_max_str_digits(0)
t = int(input())
for ti in range(t):
    x,m = map(int,input().split())
    y = x+1
    if x%2==0:
        x //= 2
    else:
        y //= 2
    x %= m
    y %= m
    print((x*y)%m)
0