結果

問題 No.1803 Remainder of Sum
ユーザー KudeKude
提出日時 2022-01-07 22:12:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 226 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 76,544 KB
最終ジャッジ日時 2024-04-26 18:42:50
合計ジャッジ時間 3,751 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,328 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 291 ms
75,520 KB
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n, m = map(int, input().split())
    if m == 1:
        print(0)
    if n >= m:
        print(m // 2)
    else:
        l = m - n - 2
        print(m // 2 - (m - n) + (2 + m - n) * l // 2 + l)
0