結果
| 問題 |
No.2649 [Cherry 6th Tune C] Anthem Flower
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-23 21:48:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 501 bytes |
| コンパイル時間 | 202 ms |
| コンパイル使用メモリ | 82,300 KB |
| 実行使用メモリ | 77,892 KB |
| 最終ジャッジ日時 | 2024-09-29 06:11:08 |
| 合計ジャッジ時間 | 5,367 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 RE * 21 |
ソースコード
import sys
inf = float("inf")
# sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip("\r\n")
print = lambda *args, end="\n", sep=" ": sys.stdout.write(
sep.join(map(str, args)) + end
)
def II():
return int(input())
def MII(b=0):
return map(lambda x: int(x) - b, input().split())
def LII(b=0):
return list(MII(b))
for _ in range(II()):
x, m = LII()
y = x + 1
if x & 1:
y //= 2
else:
x //= 2
print((x % m) * (y % m) % m)