| Task: | Skittles |
| Sender: | aalto26km_048 |
| Submission time: | 2026-11-16 17:35:40 +0200 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.05 s | details |
| #2 | ACCEPTED | 0.05 s | details |
| #3 | ACCEPTED | 0.05 s | details |
| #4 | ACCEPTED | 0.05 s | details |
| #5 | ACCEPTED | 0.05 s | details |
| #6 | ACCEPTED | 0.05 s | details |
| #7 | ACCEPTED | 0.05 s | details |
| #8 | ACCEPTED | 0.05 s | details |
| #9 | ACCEPTED | 0.05 s | details |
| #10 | ACCEPTED | 0.05 s | details |
| #11 | ACCEPTED | 0.05 s | details |
| #12 | ACCEPTED | 0.44 s | details |
| #13 | RUNTIME ERROR | 0.72 s | details |
| #14 | RUNTIME ERROR | 0.70 s | details |
| #15 | RUNTIME ERROR | 0.71 s | details |
| #16 | RUNTIME ERROR | 0.68 s | details |
| #17 | RUNTIME ERROR | 0.70 s | details |
| #18 | RUNTIME ERROR | 0.71 s | details |
| #19 | RUNTIME ERROR | 0.69 s | details |
| #20 | RUNTIME ERROR | 0.71 s | details |
| #21 | RUNTIME ERROR | 0.69 s | details |
| #22 | RUNTIME ERROR | 0.71 s | details |
| #23 | RUNTIME ERROR | 0.67 s | details |
| #24 | RUNTIME ERROR | 0.70 s | details |
| #25 | TIME LIMIT EXCEEDED | -- | details |
| #26 | RUNTIME ERROR | 0.68 s | details |
| #27 | RUNTIME ERROR | 0.70 s | details |
| #28 | RUNTIME ERROR | 0.69 s | details |
| #29 | RUNTIME ERROR | 0.69 s | details |
| #30 | RUNTIME ERROR | 0.70 s | details |
| #31 | RUNTIME ERROR | 0.69 s | details |
| #32 | RUNTIME ERROR | 0.68 s | details |
| #33 | RUNTIME ERROR | 0.69 s | details |
| #34 | TIME LIMIT EXCEEDED | -- | details |
| #35 | RUNTIME ERROR | 0.68 s | details |
| #36 | RUNTIME ERROR | 0.70 s | details |
| #37 | RUNTIME ERROR | 0.69 s | details |
| #38 | RUNTIME ERROR | 0.70 s | details |
| #39 | RUNTIME ERROR | 0.69 s | details |
| #40 | RUNTIME ERROR | 0.69 s | details |
| #41 | RUNTIME ERROR | 0.69 s | details |
| #42 | RUNTIME ERROR | 0.69 s | details |
| #43 | RUNTIME ERROR | 0.68 s | details |
| #44 | RUNTIME ERROR | 0.68 s | details |
| #45 | RUNTIME ERROR | 0.68 s | details |
| #46 | RUNTIME ERROR | 0.67 s | details |
| #47 | RUNTIME ERROR | 0.69 s | details |
| #48 | RUNTIME ERROR | 0.70 s | details |
| #49 | RUNTIME ERROR | 0.70 s | details |
| #50 | RUNTIME ERROR | 0.67 s | details |
| #51 | RUNTIME ERROR | 0.71 s | details |
| #52 | RUNTIME ERROR | 0.70 s | details |
| #53 | RUNTIME ERROR | 0.70 s | details |
| #54 | RUNTIME ERROR | 0.69 s | details |
| #55 | RUNTIME ERROR | 0.71 s | details |
| #56 | RUNTIME ERROR | 0.71 s | details |
| #57 | RUNTIME ERROR | 0.70 s | details |
| #58 | RUNTIME ERROR | 0.71 s | details |
| #59 | RUNTIME ERROR | 0.69 s | details |
| #60 | RUNTIME ERROR | 0.69 s | details |
| #61 | RUNTIME ERROR | 0.70 s | details |
| #62 | RUNTIME ERROR | 0.70 s | details |
| #63 | RUNTIME ERROR | 0.71 s | details |
Code
# FULL TEMPLATE: delete every block you don't use. Blocks don't depend on each other.
# Nodes are 1..n (slot 0 unused). Arrays are 0-indexed.
import sys
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from itertools import accumulate, permutations, combinations, product, chain
from functools import lru_cache, cmp_to_key
from math import gcd, isqrt, comb, inf, factorial
input = sys.stdin.readline
MOD = 10**9 + 7
def I(): return int(input()) # "5" -> 5
def MI(): return map(int, input().split()) # "8 4" -> n, q = MI()
def LI(): return list(map(int, input().split())) # "3 2 4 5" -> [3, 2, 4, 5]
def S(): return input().strip() # "BABAZA", ".*.#" (kept as text)
def LS(): return input().split() # "? 2 3" -> ['?', '2', '3']
def main():
n, a, b = MI()
out = 0
dp = [1] * (n + b - 1 + 1)
for i in range(1, n + b - 1 + 1):
dp[i] = i * dp[i-1]
for i in range(a, b+1):
out += (dp[n + i - 1] // (dp[i] * dp[n-1]) )% 998244353
print(out% 998244353)
main()
Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 1 1 10 |
| correct output |
|---|
| 10 |
| user output |
|---|
| 10 |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 2 3 3 |
| correct output |
|---|
| 4 |
| user output |
|---|
| 4 |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 2 4 5 |
| correct output |
|---|
| 11 |
| user output |
|---|
| 11 |
Test 4
Verdict: ACCEPTED
| input |
|---|
| 3 4 5 |
| correct output |
|---|
| 36 |
| user output |
|---|
| 36 |
Test 5
Verdict: ACCEPTED
| input |
|---|
| 3 2 2 |
| correct output |
|---|
| 6 |
| user output |
|---|
| 6 |
Test 6
Verdict: ACCEPTED
| input |
|---|
| 5 5 5 |
| correct output |
|---|
| 126 |
| user output |
|---|
| 126 |
Test 7
Verdict: ACCEPTED
| input |
|---|
| 10 10 10 |
| correct output |
|---|
| 92378 |
| user output |
|---|
| 92378 |
Test 8
Verdict: ACCEPTED
| input |
|---|
| 10 1 10 |
| correct output |
|---|
| 184755 |
| user output |
|---|
| 184755 |
Test 9
Verdict: ACCEPTED
| input |
|---|
| 100 100 100 |
| correct output |
|---|
| 866655715 |
| user output |
|---|
| 866655715 |
Test 10
Verdict: ACCEPTED
| input |
|---|
| 10 100 100 |
| correct output |
|---|
| 918123961 |
| user output |
|---|
| 918123961 |
Test 11
Verdict: ACCEPTED
| input |
|---|
| 1000 10 10 |
| correct output |
|---|
| 84965120 |
| user output |
|---|
| 84965120 |
Test 12
Verdict: ACCEPTED
| input |
|---|
| 10000 10000 10000 |
| correct output |
|---|
| 658363258 |
| user output |
|---|
| 658363258 |
Test 13
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 100000 100000 |
| correct output |
|---|
| 966937032 |
| user output |
|---|
| (empty) |
Test 14
Verdict: RUNTIME ERROR
| input |
|---|
| 54883 59286 71521 |
| correct output |
|---|
| 908996595 |
| user output |
|---|
| (empty) |
Test 15
Verdict: RUNTIME ERROR
| input |
|---|
| 41703 72034 99721 |
| correct output |
|---|
| 139159644 |
| user output |
|---|
| (empty) |
Test 16
Verdict: RUNTIME ERROR
| input |
|---|
| 43601 2593 18509 |
| correct output |
|---|
| 804369499 |
| user output |
|---|
| (empty) |
Test 17
Verdict: RUNTIME ERROR
| input |
|---|
| 55081 7073 70816 |
| correct output |
|---|
| 806880502 |
| user output |
|---|
| (empty) |
Test 18
Verdict: RUNTIME ERROR
| input |
|---|
| 96705 54725 90064 |
| correct output |
|---|
| 521461113 |
| user output |
|---|
| (empty) |
Test 19
Verdict: RUNTIME ERROR
| input |
|---|
| 22200 5519 87075 |
| correct output |
|---|
| 866679044 |
| user output |
|---|
| (empty) |
Test 20
Verdict: RUNTIME ERROR
| input |
|---|
| 89288 33199 94750 |
| correct output |
|---|
| 812654801 |
| user output |
|---|
| (empty) |
Test 21
Verdict: RUNTIME ERROR
| input |
|---|
| 7631 22735 77994 |
| correct output |
|---|
| 30255908 |
| user output |
|---|
| (empty) |
Test 22
Verdict: RUNTIME ERROR
| input |
|---|
| 87345 1112 96856 |
| correct output |
|---|
| 944788802 |
| user output |
|---|
| (empty) |
Test 23
Verdict: RUNTIME ERROR
| input |
|---|
| 1038 36447 50189 |
| correct output |
|---|
| 654272260 |
| user output |
|---|
| (empty) |
Test 24
Verdict: RUNTIME ERROR
| input |
|---|
| 41703 72034 99721 |
| correct output |
|---|
| 139159644 |
| user output |
|---|
| (empty) |
Test 25
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 18028 1948 6831 |
| correct output |
|---|
| 631722506 |
| user output |
|---|
| (empty) |
Test 26
Verdict: RUNTIME ERROR
| input |
|---|
| 4873 28912 79929 |
| correct output |
|---|
| 106074189 |
| user output |
|---|
| (empty) |
Test 27
Verdict: RUNTIME ERROR
| input |
|---|
| 28606 2900 95813 |
| correct output |
|---|
| 538554734 |
| user output |
|---|
| (empty) |
Test 28
Verdict: RUNTIME ERROR
| input |
|---|
| 25093 4610 68059 |
| correct output |
|---|
| 799962519 |
| user output |
|---|
| (empty) |
Test 29
Verdict: RUNTIME ERROR
| input |
|---|
| 67575 4472 32712 |
| correct output |
|---|
| 857647130 |
| user output |
|---|
| (empty) |
Test 30
Verdict: RUNTIME ERROR
| input |
|---|
| 82449 18136 86245 |
| correct output |
|---|
| 420446937 |
| user output |
|---|
| (empty) |
Test 31
Verdict: RUNTIME ERROR
| input |
|---|
| 18558 38661 75914 |
| correct output |
|---|
| 924425479 |
| user output |
|---|
| (empty) |
Test 32
Verdict: RUNTIME ERROR
| input |
|---|
| 35543 34086 47960 |
| correct output |
|---|
| 210554536 |
| user output |
|---|
| (empty) |
Test 33
Verdict: RUNTIME ERROR
| input |
|---|
| 20101 32903 99080 |
| correct output |
|---|
| 88647511 |
| user output |
|---|
| (empty) |
Test 34
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 18028 1948 6831 |
| correct output |
|---|
| 631722506 |
| user output |
|---|
| (empty) |
Test 35
Verdict: RUNTIME ERROR
| input |
|---|
| 61218 12076 16908 |
| correct output |
|---|
| 820171450 |
| user output |
|---|
| (empty) |
Test 36
Verdict: RUNTIME ERROR
| input |
|---|
| 78139 13111 69284 |
| correct output |
|---|
| 904117059 |
| user output |
|---|
| (empty) |
Test 37
Verdict: RUNTIME ERROR
| input |
|---|
| 45455 2862 43952 |
| correct output |
|---|
| 430742811 |
| user output |
|---|
| (empty) |
Test 38
Verdict: RUNTIME ERROR
| input |
|---|
| 84538 61888 77158 |
| correct output |
|---|
| 294818599 |
| user output |
|---|
| (empty) |
Test 39
Verdict: RUNTIME ERROR
| input |
|---|
| 26937 59685 80971 |
| correct output |
|---|
| 680140546 |
| user output |
|---|
| (empty) |
Test 40
Verdict: RUNTIME ERROR
| input |
|---|
| 30632 9727 88573 |
| correct output |
|---|
| 877318826 |
| user output |
|---|
| (empty) |
Test 41
Verdict: RUNTIME ERROR
| input |
|---|
| 55737 66074 71002 |
| correct output |
|---|
| 123569267 |
| user output |
|---|
| (empty) |
Test 42
Verdict: RUNTIME ERROR
| input |
|---|
| 59351 587 51636 |
| correct output |
|---|
| 122513346 |
| user output |
|---|
| (empty) |
Test 43
Verdict: RUNTIME ERROR
| input |
|---|
| 8954 7866 51810 |
| correct output |
|---|
| 961929284 |
| user output |
|---|
| (empty) |
Test 44
Verdict: RUNTIME ERROR
| input |
|---|
| 61218 12076 16908 |
| correct output |
|---|
| 820171450 |
| user output |
|---|
| (empty) |
Test 45
Verdict: RUNTIME ERROR
| input |
|---|
| 9556 43003 92502 |
| correct output |
|---|
| 424034313 |
| user output |
|---|
| (empty) |
Test 46
Verdict: RUNTIME ERROR
| input |
|---|
| 20433 945 23474 |
| correct output |
|---|
| 794687216 |
| user output |
|---|
| (empty) |
Test 47
Verdict: RUNTIME ERROR
| input |
|---|
| 9941 45344 78340 |
| correct output |
|---|
| 875489658 |
| user output |
|---|
| (empty) |
Test 48
Verdict: RUNTIME ERROR
| input |
|---|
| 82532 68582 70655 |
| correct output |
|---|
| 238007640 |
| user output |
|---|
| (empty) |
Test 49
Verdict: RUNTIME ERROR
| input |
|---|
| 52729 37586 66259 |
| correct output |
|---|
| 93243919 |
| user output |
|---|
| (empty) |
Test 50
Verdict: RUNTIME ERROR
| input |
|---|
| 10475 17392 24871 |
| correct output |
|---|
| 977605482 |
| user output |
|---|
| (empty) |
Test 51
Verdict: RUNTIME ERROR
| input |
|---|
| 76232 88012 95143 |
| correct output |
|---|
| 871309467 |
| user output |
|---|
| (empty) |
Test 52
Verdict: RUNTIME ERROR
| input |
|---|
| 77184 58424 64500 |
| correct output |
|---|
| 693972156 |
| user output |
|---|
| (empty) |
Test 53
Verdict: RUNTIME ERROR
| input |
|---|
| 96888 47083 55295 |
| correct output |
|---|
| 406195062 |
| user output |
|---|
| (empty) |
Test 54
Verdict: RUNTIME ERROR
| input |
|---|
| 9556 43003 92502 |
| correct output |
|---|
| 424034313 |
| user output |
|---|
| (empty) |
Test 55
Verdict: RUNTIME ERROR
| input |
|---|
| 83891 47894 87748 |
| correct output |
|---|
| 686766192 |
| user output |
|---|
| (empty) |
Test 56
Verdict: RUNTIME ERROR
| input |
|---|
| 85080 21779 92819 |
| correct output |
|---|
| 114946782 |
| user output |
|---|
| (empty) |
Test 57
Verdict: RUNTIME ERROR
| input |
|---|
| 88235 6779 56603 |
| correct output |
|---|
| 70147249 |
| user output |
|---|
| (empty) |
Test 58
Verdict: RUNTIME ERROR
| input |
|---|
| 88858 66896 98375 |
| correct output |
|---|
| 601764178 |
| user output |
|---|
| (empty) |
Test 59
Verdict: RUNTIME ERROR
| input |
|---|
| 50586 8901 76084 |
| correct output |
|---|
| 881324074 |
| user output |
|---|
| (empty) |
Test 60
Verdict: RUNTIME ERROR
| input |
|---|
| 87594 26882 34225 |
| correct output |
|---|
| 42681251 |
| user output |
|---|
| (empty) |
Test 61
Verdict: RUNTIME ERROR
| input |
|---|
| 73130 30310 55103 |
| correct output |
|---|
| 843664756 |
| user output |
|---|
| (empty) |
Test 62
Verdict: RUNTIME ERROR
| input |
|---|
| 63584 31874 92876 |
| correct output |
|---|
| 437812641 |
| user output |
|---|
| (empty) |
Test 63
Verdict: RUNTIME ERROR
| input |
|---|
| 88714 2531 74051 |
| correct output |
|---|
| 603847190 |
| user output |
|---|
| (empty) |
