結果

問題 No.2001 Distanced Triple
ユーザー hir355hir355
提出日時 2022-07-08 22:01:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 274 bytes
コンパイル時間 697 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 71,700 KB
最終ジャッジ日時 2023-08-27 21:33:55
合計ジャッジ時間 4,500 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,460 KB
testcase_01 AC 71 ms
71,404 KB
testcase_02 AC 73 ms
71,204 KB
testcase_03 AC 72 ms
71,204 KB
testcase_04 AC 73 ms
71,156 KB
testcase_05 AC 72 ms
71,228 KB
testcase_06 WA -
testcase_07 AC 72 ms
71,052 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 71 ms
71,376 KB
testcase_11 AC 70 ms
71,064 KB
testcase_12 AC 70 ms
71,320 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 69 ms
70,980 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 71 ms
71,148 KB
testcase_26 AC 70 ms
71,224 KB
testcase_27 WA -
testcase_28 AC 69 ms
71,068 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 71 ms
71,420 KB
testcase_32 AC 70 ms
71,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
l, r = map(int, input().split())
r -= l - 1
a, b, c = map(int, input().split())
if a + b >= c:
    p = r - a - b + 2
    print((p * (p - 1) * (p - 2) // 6) % MOD)
else:
    r -= 1
    b += a
    print((r + 2 - c) * (r + 1 - c) * (r + 3 + 2 * c - 3 * b) // 6)
0