結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,712 KB
testcase_01 AC 303 ms
76,160 KB
testcase_02 AC 295 ms
75,904 KB
testcase_03 AC 298 ms
76,544 KB
testcase_04 AC 305 ms
76,032 KB
testcase_05 AC 294 ms
76,672 KB
testcase_06 AC 289 ms
76,160 KB
testcase_07 AC 289 ms
76,544 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 - 1
        print(m // 2 - (m - n) + (2 + m - n) * l // 2 + l)
0