s_id
string
p_id
string
u_id
string
date
string
language
string
original_language
string
filename_ext
string
status
string
cpu_time
string
memory
string
code_size
string
code
string
error
string
stdout
string
s851356378
p02549
u592944963
1600548190
Python
PyPy3 (7.3.0)
py
Runtime Error
716
158800
399
N, K = map(int, input().split()) LR = [list(map(int, input().split())) for _ in range(K)] dp = [-1 for _ in range(N + 1)] dp[0] = 1 def dfs(n): if n < 0: return 0 if 0 <= dp[n]: return dp[n] ans = 0 for l, r in LR: for d in range(l, r + 1): ans += dfs(n - d) ...
Traceback (most recent call last): File "/tmp/tmpgxc_hvzi/tmp9dyoq17_.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s236427227
p02549
u072717685
1600548149
Python
PyPy3 (7.3.0)
py
Runtime Error
2208
85392
641
import sys read = sys.stdin.read #readlines = sys.stdin.readlines def main(): large_num = 998244353 n, k = map(int, input().split()) n -= 1 dd = [0] * (n+1) m = map(int, read().split()) ab = zip(m, m) for a, b in ab: for i1 in range(a, b + 1): dd[i1]=1 s = [i for i, ...
Traceback (most recent call last): File "/tmp/tmpq2bodsxv/tmp7f6y5dy2.py", line 29, in <module> main() File "/tmp/tmpq2bodsxv/tmp7f6y5dy2.py", line 7, in main n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s143532807
p02549
u525302207
1600548144
Python
Python (3.8.2)
py
Runtime Error
31
9096
394
mod = 998244353 n,k = map(int,input().split()) t = [False] * 20 for i in range(k): l,r = map(int,input().split()) for j in range(l,r+1,1): t[j] = True s = [] for i,v in enumerate(t): if v == True: s.append(i) dp = [0] * (n+5) dp[1] = 1 for i in range(2,n+1,1): for d in s: if...
Traceback (most recent call last): File "/tmp/tmp5z9ww2ty/tmpm4g5podk.py", line 2, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s823493103
p02549
u856519712
1600548129
Python
Python (3.8.2)
py
Runtime Error
2206
17312
478
# -*- coding: utf-8 -*- N, K = map(int, input().split()) D = [] S = [] T = [] mod = 998244353 for i in range(K): D.append(list(map(int, input().split()))) while(D[i][0] <= D[i][1]): S.append(D[i][0]) D[i][0] += 1 def func(x,S,T): for i in range(len(T)): if x == T[i][0]: return T[i][1] count =...
Traceback (most recent call last): File "/tmp/tmpw2ov3u41/tmpjl3lhbcw.py", line 2, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s665386237
p02549
u072717685
1600548054
Python
Python (3.8.2)
py
Runtime Error
1942
106756
783
import sys read = sys.stdin.read #readlines = sys.stdin.readlines import numpy as np from numba import njit def main(): large_num = 998244353 n, k = map(int, input().split()) n -= 1 jump = [] m = map(int, read().split()) for a, b in zip(m, m): jump.append((a, b)) jump = np.array(jump...
Traceback (most recent call last): File "/tmp/tmpd_ude7ga/tmpi24m48ke.py", line 31, in <module> main() File "/tmp/tmpd_ude7ga/tmpi24m48ke.py", line 8, in main n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s295989826
p02549
u942356554
1600548030
Python
Python (3.8.2)
py
Runtime Error
2207
32848
611
n,k = map(int,input().split()) mod = 998244353 s = [] for i in range(k): l,r =map(int,input().split()) if l == r: if l < n: s.append(l) else: for i in range(l,r+1): if i < n: s.append(i) s = list(set(s)) s = sorted(s) min1 = s[0] tansa = sorted(s[...
Traceback (most recent call last): File "/tmp/tmpjctnwx7h/tmpdbcoga35.py", line 1, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s292175821
p02549
u391725895
1600548028
Python
Python (3.8.2)
py
Runtime Error
28
9016
322
import numpy as np N, K = map(int, input().split()) D = [] for _ in range(K): L, R = map(int, input().split()) for i in range(L, R+1): D.append(i) D.sort() dp = np.zeros(300000) dp[1] = 1 for d in D: for i in range(1, N//d) dp += np.roll(dp, i * d) dp %= 998244353 print(int(dp[N]...
File "/tmp/tmpm5nz8d_n/tmp8p24jju6.py", line 19 for i in range(1, N//d) ^ SyntaxError: expected ':'
s568636350
p02549
u334703235
1600548023
Python
Python (3.8.2)
py
Runtime Error
410
32440
441
m = 998244353 N,K = map(int,input().split()) s=set() for i in range(K): i1,i2 = map(int,input().split()) s.update(set(range(i1,i2+1))) memo = [-1]*(N+1) def saiki(n): if n == 1: return 1 elif n <=0: return 0 elif memo[n] != -1:#use memo return memo[n] count = 0 for ...
Traceback (most recent call last): File "/tmp/tmpquuxl22s/tmpsopguxj5.py", line 3, in <module> N,K = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s257046845
p02549
u525302207
1600548010
Python
Python (3.8.2)
py
Runtime Error
29
9120
377
mod = 998244353 n,k = map(int,input().split()) t = [False] * 20 for i in range(k): l,r = map(int,input().split()) for j in range(l,r+1,1): t[j] = True s = [] for i,v in enumerate(t): if v == True: s.append(i) dp = [0] * (n+5) dp[1] = 1 for i in range(2,n+1,1): for d in s: if...
Traceback (most recent call last): File "/tmp/tmpr6nipvzg/tmpsjb22o17.py", line 2, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s185591686
p02549
u510331904
1600548010
Python
PyPy3 (7.3.0)
py
Runtime Error
2208
105652
1113
#!/usr/bin/env python3 import sys import math import decimal import itertools from itertools import product from functools import reduce def input(): return sys.stdin.readline()[:-1] def gcd(*numbers): return reduce(math.gcd, numbers) def lcm_base(x, y): return (x * y) // math.gcd(x, y) def lcm(*numbers): ...
Traceback (most recent call last): File "/tmp/tmpgz3s9wnm/tmp5n7_cjev.py", line 54, in <module> main() File "/tmp/tmpgz3s9wnm/tmp5n7_cjev.py", line 30, in main N, K = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s128485376
p02549
u829999015
1600548003
Python
Python (3.8.2)
py
Runtime Error
2539
534956
440
import itertools N, K = map(int, input().split()) LR = [map(int, input().split()) for _ in range(K)] L, R = [list(i) for i in zip(*LR)] L.extend(R) LR = list(set(L)) count = 0 for j in range(N): h = list(itertools.combinations_with_replacement(LR, j)) print(h) for i in range(len(h)): if sum(h[i]) == N - 1...
Traceback (most recent call last): File "/tmp/tmpg5lw8_fq/tmp_xka5u_c.py", line 2, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s215838995
p02549
u509214520
1600547999
Python
Python (3.8.2)
py
Runtime Error
26
9096
318
N, K = map(int, input().split()) A = [list(map(int,input().split())) for i in range(K)] S = [] for l, r in A: for i in range(l, r + 1): S.append(i) dp = [0]*N dp[0] = 1 for i in range(1, N): c = 0 for j in S: if i - j >= 0: c += dp[i-j] dp[i] = c print(dp[N-1]%998244353
File "/tmp/tmp6vdw_dyy/tmpb7s7auw5.py", line 19 print(dp[N-1]%998244353 ^ SyntaxError: '(' was never closed
s815871360
p02549
u419354839
1600547999
Python
PyPy3 (7.3.0)
py
Runtime Error
2208
80980
407
import sys from functools import lru_cache sys.setrecursionlimit(2000) N, K = map(int, input().split()) LR = [list(map(int,input().split())) for _ in range(K)] S = list() for l,r in LR: S.extend(list(range(l, r+1))) S = sorted(S) @lru_cache(maxsize=1000) def an(n): if n == 1: return 1 elif n < 1: ...
Traceback (most recent call last): File "/tmp/tmpje_5kn6j/tmpkhgyj5ml.py", line 6, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s323945188
p02549
u936985471
1600547994
Python
Python (3.8.2)
py
Runtime Error
1919
108056
580
import sys readline=sys.stdin.readline import numpy as np from numba import njit,i8 N,K=map(int,readline().split()) DIV = 998244353 steps = [] for i in range(K): l,r = map(int,readline().split()) for j in range(l, r + 1): steps.append(j) steps = sorted(steps) steps = np.array(steps, dtype = int) @njit(i...
Traceback (most recent call last): File "/tmp/tmpio57tpdx/tmpbhqi47xp.py", line 7, in <module> N,K=map(int,readline().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s718975340
p02549
u508503899
1600547994
Python
Python (3.8.2)
py
Runtime Error
29
9376
332
n,k = map(int,input().split()) mod = 998244353 lr = [] for i in range(k): l,r = map(int,input().split()) lr.append(l) lr.append(r) S = list(set(lr)) n-=1 rout=0 def travel(n,S,rout): for s in S: if n<s: continue if n-s>0: return travel(n-s,S,rout) else: rout+=1 travel(n,S,rout) pri...
Traceback (most recent call last): File "/tmp/tmp4gzf4c_8/tmp2fbaz2pt.py", line 1, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s894697149
p02549
u240444124
1600547993
Python
Python (3.8.2)
py
Runtime Error
2207
62016
479
M=998244353 y=lambda:map(int,input().split()) n,k=y() q=set() for i in range(k): a,b=y() for j in range(a,b+1):q.add(j) s=[(n,n+1)] t=[[-1,-1]for i in range(n)] t[0]=[1,0] while s: v=s[-1][0] if t[v-1][1]<0: t[v-1][1]=0 for i in q: if v-i>0: if t[v-i-1][0]>=0:...
Traceback (most recent call last): File "/tmp/tmppc3nvbzt/tmpq60iu7iq.py", line 3, in <module> n,k=y() ^^^ File "/tmp/tmppc3nvbzt/tmpq60iu7iq.py", line 2, in <lambda> y=lambda:map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s310995042
p02549
u035210736
1600547989
Python
Python (3.8.2)
py
Runtime Error
2206
9660
258
n, k = map(int, input().split()) a = list(set(sum([list(map(int, input().split())) for i in range(k)], []))) def dfs(i): cnt = 0 if i > n: return 0 elif i == n: return 1 for x in a: cnt += dfs(i+x) return cnt print(dfs(0) % 998244353)
Traceback (most recent call last): File "/tmp/tmp31mwac1j/tmpz948ushu.py", line 1, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s384256913
p02549
u942356554
1600547987
Python
Python (3.8.2)
py
Runtime Error
2207
33160
611
n,k = map(int,input().split()) mod = 998244353 s = [] for i in range(k): l,r =map(int,input().split()) if l == r: if l < n: s.append(l) else: for i in range(l,r+1): if i < n: s.append(i) s = list(set(s)) s = sorted(s) min1 = s[0] tansa = sorted(s[...
Traceback (most recent call last): File "/tmp/tmp9hg6t2vo/tmpukgqvr1t.py", line 1, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s768713681
p02549
u239528020
1600547986
Python
PyPy3 (7.3.0)
py
Runtime Error
106
68616
738
#!/usr/bin/env python3 import numpy as np import sys sys.setrecursionlimit(10**6) mod = 998244353 n, k = list(map(int, input().split())) lr = [] # sets = set([]) for i in range(k): l, r = list(map(int, input().split())) # sets.update(set(range(l, r+1))) lr.append((l, r)) # print(sets) lr.sort() np_lists...
Traceback (most recent call last): File "/tmp/tmppryhrr35/tmpd3tqf58r.py", line 7, in <module> n, k = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s368560970
p02549
u388164885
1600547975
Python
Python (3.8.2)
py
Runtime Error
38
10104
395
import functools n, k = map(int, input().split()) s = set() for i in range(k): k1, k2 = map(int, input().split()) s.add(k1) s.add(k2) @functools.lru_cache(None) def dp(cur): ret = 0 if cur == n: ret += 1 for i in s: temp = i + cur if temp > n: continue ...
Traceback (most recent call last): File "/tmp/tmpy7nxg6va/tmpe4tj30tr.py", line 2, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s838062937
p02549
u592944963
1600547972
Python
PyPy3 (7.3.0)
py
Runtime Error
733
158832
418
N, K = map(int, input().split()) LR = [list(map(int, input().split())) for _ in range(K)] dp = [-1 for _ in range(N)] def dfs(n): if n < 0: return 0 if n == 0: return 1 if 0 <= dp[n]: return dp[n] ans = 0 for l, r in LR: for d in range(l, r + 1): ans...
Traceback (most recent call last): File "/tmp/tmplulwi36d/tmpncr8vwv2.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s446011801
p02549
u306241759
1600547955
Python
Python (3.8.2)
py
Runtime Error
2206
11380
446
N, K = list(map(int, input().split())) L = [list(map(int, input().split())) for i in range(K)] LL=[] for l in L: LL += l S = set(LL) c=['.' for i in range(N-1)] c.append("g") count=0 def dfs(x): global count if not (x < N): #探索範囲外になった場合はreturn return if c[x] == "g": # ゴールを見つけたらカウント c...
Traceback (most recent call last): File "/tmp/tmp9ad7qv8k/tmptfazdtax.py", line 1, in <module> N, K = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s784699240
p02549
u970809473
1600547951
Python
PyPy2 (7.3.0)
py
Runtime Error
141
64420
326
n,k=map(int,input().split()) s=[] dp=[0,1] for i in range(k): a,b=map(int,input().split()) if b==n: s.extend(list(range(a,b))) else: s.extend(list(range(a,b+1))) s.sort() for i in range(2,n+1): tmp=0 for j in s: if i-j>=1: tmp+=dp[i-j] else: break dp.append(tmp%998244353) print(d...
Traceback (most recent call last): File "/tmp/tmpl2sq5hin/tmp0tvjsx4d.py", line 1, in <module> n,k=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s873895278
p02549
u777800738
1600547949
Python
Python (3.8.2)
py
Runtime Error
147
27112
499
import numpy as np num=input().split(' ') count=0 plot=np.zeros([int(num[0]),int(num[0])]) t=[] for a in range(int(num[1])): tmp=input().split(' ') t.append([int(tmp[0])+a for a in range(int(tmp[1])-int(tmp[0])+1)]) for a in range(int(num[0])): if a==0: plot[0,0]=1 else: for posit in np.where(plot[a-1]>...
Traceback (most recent call last): File "/tmp/tmppy1ycd2q/tmp6tx80g9b.py", line 2, in <module> num=input().split(' ') ^^^^^^^ EOFError: EOF when reading a line
s122241735
p02549
u676653739
1600547947
Python
PyPy3 (7.3.0)
py
Runtime Error
87
68712
722
# ABC179-D Leaping Tak goalN, shugosuK = map(int, input().strip().split(' ')) # print(goalN, shugosuK) shugo = [] wa = [] for i in range(shugosuK): shugo = list(map(int, input().strip().split(' '))) # print('shugo', shugo) wa = wa + shugo # print('wa', wa) # wa = set(wa) # print(wa) wa = list(set(wa...
Traceback (most recent call last): File "/tmp/tmpgk6u03gp/tmpkruznhnr.py", line 2, in <module> goalN, shugosuK = map(int, input().strip().split(' ')) ^^^^^^^ EOFError: EOF when reading a line
s969391588
p02549
u798675549
1600547942
Python
PyPy3 (7.3.0)
py
Runtime Error
86
68656
299
n,k=map(int,input().split()) a=list([1]+[0]*(n-1)) lst=[] for i in range(k): x,y=map(int,input().split()) lst+=list(range(x,y+1)) from functools import lru_cache @lru_cache(maxsize = None) def f() for j in lst: if j<=i:a[i]+=a[i-j] for i in range(1,n):f() print(a[-1]%998244353)
File "/tmp/tmpxt7d6m7w/tmp50siicod.py", line 10 def f() ^ SyntaxError: expected ':'
s265789382
p02549
u923270446
1600547941
Python
Python (3.8.2)
py
Runtime Error
2537
141908
501
mod = 998244353 n, k = map(int, input().split()) lr = [list(map(int, input().split())) for i in range(k)] dp = [0 for i in range(n + 1)] dp[0] = 1 cum = [0, 1] cur = [0 for i in range(k)] for i in range(1, n + 1): cnt = 0 for j in range(k): r = (i - (lr[j][1] - lr[j][0] + 1)) l = r - (lr[j][1] -...
Traceback (most recent call last): File "/tmp/tmp32x6en23/tmp0jbp689p.py", line 2, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s646137271
p02549
u922487073
1600547938
Python
Python (3.8.2)
py
Runtime Error
2206
35236
344
MOD = 998244353 N,K = map(int, input().split()) d_set = set() for k in range(K): L,R = map(int, input().split()) d_set |= set(list(range(L,R+1))) dp = [0] * (N+1) # init for d in d_set: dp[d] = 1 for i in range(N): for d in d_set: if i+d > N: d_set.remove(d) dp[i+d] += dp...
Traceback (most recent call last): File "/tmp/tmpe8xi2l9i/tmpzu6whndw.py", line 2, in <module> N,K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s689906025
p02549
u310956674
1600547936
Python
PyPy3 (7.3.0)
py
Runtime Error
95
90144
519
N, K =map(int, input().split()) LR = [map(int, input().split()) for _ in range(K)] L, R = [list(i) for i in zip(*LR)] list=[] count=0 for j in range(K): for num in range(L[j],R[j]+1): list.append(num) from collections import deque que = deque() for i in range(len(list)): que.append(list[i]) while que: se...
Traceback (most recent call last): File "/tmp/tmp1rk5s_vv/tmpb4tcopao.py", line 1, in <module> N, K =map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s703629700
p02549
u518386853
1600547933
Python
PyPy3 (7.3.0)
py
Runtime Error
91
68700
352
n, k = map(int, input().split()) s = set() for i in range(k): a, b = map(int, input().split()) l += [i for i in range(a, b+1)] l = list(set(l)) dp = [0]*(n+1) dp[1] = 1 for i in range(2, n+1): for j in l: cnt = 0 sa = i-j if sa > 0: cnt += dp[i-j] dp[i] += cnt%9...
Traceback (most recent call last): File "/tmp/tmpneondp4g/tmpwox5byvn.py", line 1, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s418195130
p02549
u903005414
1600547931
Python
Python (3.8.2)
py
Runtime Error
435
114756
518
from numba import jit import sys sys.setrecursionlimit(10**9) N, K = map(int, input().split()) S = set() MOD = 998244353 for _ in range(K): L, R = map(int, input().split()) S |= set(range(L, R + 1)) # print(f'{S=}') DP = [-1] * (N + 1) DP[0] = 0 DP[1] = 1 @njit def f(idx): ans = 0 for s in S: ...
Traceback (most recent call last): File "/tmp/tmpm84285tr/tmpa7jlca42.py", line 6, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s896522915
p02549
u769095634
1600547926
Python
Python (3.8.2)
py
Runtime Error
2206
19656
453
n, k = map(int, input().split()) allowed_jump = [False for i in range(n)] for i in range(k): l, r = map(int, input().split()) for i in range(r-l+1): allowed_jump[l+i] = True allowed_jump2 = [] for i in range(n): if allowed_jump[i]: allowed_jump2.append(i) ans = [0 for i in range(n)] ans[0]=1...
Traceback (most recent call last): File "/tmp/tmph1ai76vh/tmpzg393kue.py", line 1, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s296206132
p02549
u310956674
1600547897
Python
PyPy3 (7.3.0)
py
Runtime Error
91
87680
570
N, K =map(int, input().split()) LR = [map(int, input().split()) for _ in range(K)] L, R = [list(i) for i in zip(*LR)] list=[] count=0 for j in range(K): for num in range(L[j],R[j]+1): list.append(num) from collections import deque que = deque() que.append(最初の状態) for i in range(len(list)): que.append(list[...
Traceback (most recent call last): File "/tmp/tmpf1d1jv7g/tmpbl0k4xkw.py", line 1, in <module> N, K =map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s548158983
p02549
u448406471
1600547896
Python
Python (3.8.2)
py
Runtime Error
474
31280
572
K, N = map(int, input().split()) num_list = [] for i in range(N): L, R = map(int, input().split()) num_list += list(range(L, R+1)) num_set = set(sorted(num_list)) counted = {} def recursion(n, count): if n == 0: return 1 elif n < 0: return 0 for i in num_set: if i <= 0:...
Traceback (most recent call last): File "/tmp/tmp9y7gjo0y/tmp6yq2env3.py", line 1, in <module> K, N = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s563659136
p02549
u903005414
1600547866
Python
Python (3.8.2)
py
Runtime Error
1734
131344
519
from numba import njit import sys sys.setrecursionlimit(10**9) N, K = map(int, input().split()) S = set() MOD = 998244353 for _ in range(K): L, R = map(int, input().split()) S |= set(range(L, R + 1)) # print(f'{S=}') DP = [-1] * (N + 1) DP[0] = 0 DP[1] = 1 @njit def f(idx): ans = 0 for s in S: ...
Traceback (most recent call last): File "/tmp/tmp05shkist/tmpfy8o6l48.py", line 6, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s012934770
p02549
u592944963
1600547860
Python
Python (3.8.2)
py
Runtime Error
2206
11448
422
N, K = map(int, input().split()) LR = [list(map(int, input().split())) for _ in range(K)] dp = [-1 for _ in range(N + 2)] def dfs(n): if n < 0: return 0 if n == 0: return 1 if 0 <= dp[n]: return dp[n] ans = 0 for l, r in LR: for d in range(l, r + 1): ...
Traceback (most recent call last): File "/tmp/tmptr87dgdn/tmpx6mvzybd.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s788739372
p02549
u406379114
1600547857
Python
Python (3.8.2)
py
Runtime Error
2206
18976
467
n, k = map(int, input().split()) s = [] for i in range(k): l, r = map(int, input().split()) for j in range(l, r+1): s.append(j) dp = [-1 for i in range(n+1)] def dfs(A): if (A < 0): return 0 if (A == 0): return 1 if (dp[A] >= 0): return dp[A] ans = 0 for i in s: ans += dfs(A...
Traceback (most recent call last): File "/tmp/tmpi0b2kini/tmpq_utfau2.py", line 1, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s484595976
p02549
u157857824
1600547854
Python
Python (3.8.2)
py
Runtime Error
26
8904
380
import itertools n, k = map(int, input().split()) mod = 998244353 m_list = [] for _ in range(k): l, r = map(int, input().split()) t_list = list(range(l,r+1)) m_list.append(t_list) m_list = list(itertools.chain.from_iterable(m_list)) dp = [0]*n dp[0] = 1 for i in range(n): for j in range(len(m_li...
File "/tmp/tmpigz340gi/tmp6dsr7dvm.py", line 1 import itertools IndentationError: unexpected indent
s869608413
p02549
u823585596
1600547851
Python
Python (3.8.2)
py
Runtime Error
48
19764
566
import sys sys.setrecursionlimit(10**6) mod=998244353 N,K=map(int,input().split()) S1=[] for _ in range(K): l,r=map(int,input().split()) S1+=list(range(l,r+1)) S=sorted(S1) dp=[0]*(N+1) def Leaping_Tak(n,S): if dp[n]!=0: return dp[n] if n==0: return 1 if 0<n<S[0]: return 0 ...
Traceback (most recent call last): File "/tmp/tmp5jnbessg/tmpkqx2l9s3.py", line 4, in <module> N,K=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s435493637
p02549
u334703235
1600547836
Python
Python (3.8.2)
py
Runtime Error
2206
32512
439
m = 998244353 N,K = map(int,input().split()) s=set() for i in range(K): i1,i2 = map(int,input().split()) s.update(set(range(i1,i2+1))) memo = [0]*(N+1) def saiki(n): if n == 1: return 1 elif n <=0: return 0 elif memo[n] != 0:#use memo return memo[n] count = 0 for i ...
Traceback (most recent call last): File "/tmp/tmp34bnvk8_/tmpsy7cw8q_.py", line 3, in <module> N,K = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s151481063
p02549
u509214520
1600547835
Python
Python (3.8.2)
py
Runtime Error
27
8996
318
N, K = map(int, input().split()) A = [list(map(int,input().split())) for i in range(K)] S = [] for l, r in A: for i in range(l, r + 1): S.append(i) dp = [0]*N dp[0] = 1 for i in range(1, N): c = 0 for j in S: if i - j >= 0: c += dp[i-j] dp[i] = c print(dp[N-1]%998244353
File "/tmp/tmpidjv8ny7/tmpgm1o9t33.py", line 19 print(dp[N-1]%998244353 ^ SyntaxError: '(' was never closed
s495896818
p02549
u932758529
1600547831
Python
PyPy3 (7.3.0)
py
Runtime Error
2208
83000
453
from sys import stdin #再起? cnt = 0 def move(N, S): global cnt if N == 0: cnt += 1 cnt %= 998244353 return elif N < 0: return else: for x in S: move(N-x, S) S = set() N, K = [int(x) for x in stdin.readline().rstrip().split()] for i in range(K): L, R...
Traceback (most recent call last): File "/tmp/tmpoysd6t46/tmpepe8lnm4.py", line 16, in <module> N, K = [int(x) for x in stdin.readline().rstrip().split()] ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s577893811
p02549
u099006712
1600547806
Python
Python (3.8.2)
py
Runtime Error
45
11216
456
def count(n, S, memo): if n < 0: return 0 elif n == 1: return 1 elif memo[n] > -1: return memo[n] else: x = 0 for s in S: x += count(n - s, S, memo) memo[n] = x return memo[n] N, K = map(int, input().split()) S1 = set() for i in range...
Traceback (most recent call last): File "/tmp/tmpsrngvhvm/tmpo1mui_19.py", line 16, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s931485994
p02549
u592944963
1600547770
Python
PyPy3 (7.3.0)
py
Runtime Error
737
158820
639
N, K = map(int, input().split()) LR = [list(map(int, input().split())) for _ in range(K)] dp = [-1 for _ in range(N + 1)] def dfs(n): if n < 0: # あとマイナスマス(行き過ぎ)のとき return 0 if n == 0: # あと 0 マスのとき return 1 if 0 <= dp[n]: # 何通りか知っているとき return dp[n] ans = 0 for l, r in...
Traceback (most recent call last): File "/tmp/tmp7mdfza15/tmpz7y_5rq9.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s792334240
p02549
u823585596
1600547763
Python
Python (3.8.2)
py
Runtime Error
42
19616
544
import sys sys.setrecursionlimit(10**6) mod=998244353 N,K=map(int,input().split()) S1=[] for _ in range(K): l,r=map(int,input().split()) S1+=list(range(l,r+1)) S=sorted(S1) dp=[0]*(N+1) def Leaping_Tak(n,S): if dp[n]!=0: return dp[n] if n==0: return 1 if 0<n<S[0]: return 0 ...
Traceback (most recent call last): File "/tmp/tmpkge61k4r/tmpfbgchnlg.py", line 4, in <module> N,K=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s050181106
p02549
u564655959
1600547755
Python
Python (3.8.2)
py
Runtime Error
90
26276
636
def dfs(q, here, result): # print('q,here1: ', q, here, result) if len(q) == 0: print(result % 998244353) return result for i in num: # print('i, here: ', i, here) if i + here <= n: q.append(i + here) else: break # print('q,here2,result: ', q, here, result) here = q.pop() if here == n: result +=...
Traceback (most recent call last): File "/tmp/tmpyfkpwjzk/tmpenlms0qd.py", line 20, in <module> n, k = (int(each) for each in input().split()) ^^^^^^^ EOFError: EOF when reading a line
s887979559
p02549
u035210736
1600547714
Python
Python (3.8.2)
py
Runtime Error
2206
9616
261
n, k = map(int, input().split()) a = list(set(sum([list(map(int, input().split())) for i in range(k)], []))) def dfs(i): cnt = 0 if i > n: return 0 elif i == n: return 1 for x in a: cnt += dfs(i+x) return cnt print(dfs(a[0]) % 998244353)
Traceback (most recent call last): File "/tmp/tmp085wffh5/tmps1by7k8w.py", line 1, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s969119320
p02549
u903005414
1600547679
Python
PyPy3 (7.3.0)
py
Runtime Error
1027
132384
448
N, K = map(int, input().split()) S = set() MOD = 998244353 for _ in range(K): L, R = map(int, input().split()) S |= set(range(L, R + 1)) # print(f'{S=}') DP = [-1] * (N + 1) DP[0] = 0 DP[1] = 1 def f(idx): ans = 0 for s in S: if idx - s < 1: continue if DP[idx - s] == -1:...
Traceback (most recent call last): File "/tmp/tmpd1c9x6ge/tmpyyumb5rj.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s306226240
p02549
u306241759
1600547677
Python
Python (3.8.2)
py
Runtime Error
2206
11400
446
N, K = list(map(int, input().split())) L = [list(map(int, input().split())) for i in range(K)] LL=[] for l in L: LL += l S = set(LL) c=['.' for i in range(N-1)] c.append("g") count=0 def dfs(x): global count if not (x < N): #探索範囲外になった場合はreturn return if c[x] == "g": # ゴールを見つけたらカウント c...
Traceback (most recent call last): File "/tmp/tmpjhl8sh3r/tmp73tdqh5r.py", line 1, in <module> N, K = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s392463705
p02549
u777800738
1600547672
Python
Python (3.8.2)
py
Runtime Error
140
27204
544
import numpy as np num=input().split(' ') count=0 plot=np.zeros([int(num[0]),int(num[0])]) t=[] for a in range(int(num[1])): tmp=input().split(' ') t.append([int(tmp[0])+a for a in range(int(tmp[1])-int(tmp[0])+1)]) for a in range(int(num[0])): if a==0: plot[0,0]=1 else: for posit in np.where(plot[a-1]>...
Traceback (most recent call last): File "/tmp/tmp9xuzmpop/tmpouc84h6p.py", line 2, in <module> num=input().split(' ') ^^^^^^^ EOFError: EOF when reading a line
s893515848
p02549
u092061507
1600547664
Python
Python (3.8.2)
py
Runtime Error
88
27876
390
from bisect import bisect N, K = map(int, input().split()) LR = [list(map(int, input().split())) for i in range(K)] S = set() for i in LR: for j in range(i[0], i[1]+1): S.add(j) L = sorted(list(S)) print(L) dp = [0 for i in range(N)] dp[0] = 1 for i in range(1, N): x = bisect.bisect(L, i) t = L[:x...
Traceback (most recent call last): File "/tmp/tmp7qwo01iv/tmp_ktopuko.py", line 2, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s922808643
p02549
u885068064
1600547651
Python
Python (3.8.2)
py
Runtime Error
2239
3442808
431
N, K = map(int, input().split()) ints = [] for _ in range(K): L, R = map(int, input().split()) ints = list(set(ints) | set(list(range(L, R + 1)))) import numpy as np ints = np.array(ints) orig_ints = ints.copy() ints += 1 count = 0 count += (ints == N).sum() for k in range(N): y, x = np.meshgrid(orig_ints,...
Traceback (most recent call last): File "/tmp/tmptpl4qkmd/tmpcv_nmyza.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s226571564
p02549
u448406471
1600547650
Python
Python (3.8.2)
py
Runtime Error
444
31104
532
K, N = map(int, input().split()) num_list = [] for i in range(N): L, R = map(int, input().split()) num_list += list(range(L, R+1)) num_set = set(sorted(num_list)) counted = {} def recursion(n, count): if n == 0: return 1 elif n < 0: return 0 for i in num_set: if n-i in...
Traceback (most recent call last): File "/tmp/tmp3wskzr4s/tmpfe1kvoi_.py", line 2, in <module> K, N = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s486937458
p02549
u508972438
1600547637
Python
PyPy3 (7.3.0)
py
Runtime Error
115
74580
1575
# Template 1.0 import sys, re from collections import deque, defaultdict, Counter, OrderedDict from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from heapq import heappush, heappop, heapify, nlargest, nsmallest def STR(): return list(input()) def INT(): return int(input()) def MAP(): return map(int, ...
File "/tmp/tmp91rddx6q/tmpzk6frxxd.py", line 41 count[i]%=998244353 TabError: inconsistent use of tabs and spaces in indentation
s668276270
p02549
u092061507
1600547621
Python
Python (3.8.2)
py
Runtime Error
90
27848
390
from bisect import bisect N, K = map(int, input().split()) LR = [list(map(int, input().split())) for i in range(K)] S = set() for i in LR: for j in range(i[0], i[1]+1): S.add(j) L = sorted(list(S)) print(L) dp = [0 for i in range(N)] dp[0] = 1 for i in range(1, N): x = bisect.bisect(L, i) t = L[:x...
Traceback (most recent call last): File "/tmp/tmptpzcopmb/tmp3iwmqkyk.py", line 2, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s622454764
p02549
u732061897
1600547619
Python
PyPy3 (7.3.0)
py
Runtime Error
2207
98604
692
N, K = map(int, input().split()) LR = set() MOD = 998244353 for i in range(K): l, r = map(int, input().split()) for j in range(l, r + 1): LR.add(j) #print(list(LR)) class Search: def __init__(self): self.ans = 0 def dfs(self, now): if now == N: self.ans += 1 ...
Traceback (most recent call last): File "/tmp/tmp3ajkpqgm/tmpvg5sju_x.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s782895003
p02549
u406379114
1600547613
Python
Python (3.8.2)
py
Runtime Error
2206
19256
392
n, k = map(int, input().split()) s = [] for i in range(k): l, r = map(int, input().split()) for j in range(l, r+1): s.append(j) dp = [-1 for i in range(n+1)] def dfs(A): if (A < 0): return 0 if (A == 0): return 1 if (dp[A] >= 0): return dp[A] ans = 0 for i in s: ans += dfs(A...
Traceback (most recent call last): File "/tmp/tmp5r6xj2_8/tmpixejbq2s.py", line 1, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s347994156
p02549
u248996551
1600547599
Python
PyPy3 (7.3.0)
py
Runtime Error
347
86112
781
N,K=map(int,input().split()) from functools import lru_cache #上手くいかない時は下 # from functools32 import lru_cache table=[0]*(N+1) table[1]=1 step=[] for i in range(K): l,r=map(int,input().split()) for i in range(l,r+1): step.append(i) mod=998244353 @lru_cache(None) def leapy(x): if table[x] !...
Traceback (most recent call last): File "/tmp/tmp3jh74h91/tmp6pnas_p_.py", line 1, in <module> N,K=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s304704727
p02549
u448406471
1600547595
Python
Python (3.8.2)
py
Runtime Error
280
31168
665
K, N = map(int, input().split()) num_list = [] for i in range(N): L, R = map(int, input().split()) num_list += list(range(L, R+1)) num_set = set(sorted(num_list)) counted = {} def recursion(n, count): if n == 0: return 1 elif n < 0: return 0 for i in num_set: if n-i < ...
Traceback (most recent call last): File "/tmp/tmpzwj6_xir/tmp63099w8u.py", line 2, in <module> K, N = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s274869570
p02549
u823585596
1600547582
Python
PyPy3 (7.3.0)
py
Runtime Error
95
77336
469
import sys sys.setrecursionlimit(10**9) mod=998244353 N,K=map(int,input().split()) _S=[] for _ in range(K): l,r=map(int,input().split()) _S+=list(range(l,r+1)) S=sorted(_S) dp=[0]*(N+1) def Leaping_Tak(n,S): if dp[n]!=0: return dp[n] if n==0: return 1 if 0<n<S[0]: return 0 ...
Traceback (most recent call last): File "/tmp/tmpl5y_qdy5/tmptrvzto0h.py", line 4, in <module> N,K=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s953012621
p02549
u448406471
1600547553
Python
Python (3.8.2)
py
Runtime Error
282
31324
711
import math K, N = map(int, input().split()) num_list = [] for i in range(N): L, R = map(int, input().split()) num_list += list(range(L, R+1)) num_set = set(sorted(num_list)) count_log = [-1 for i in range(K)] counted = {} def recursion(n, count): if n == 0: return 1 elif n < 0: re...
Traceback (most recent call last): File "/tmp/tmpb7ijv6ne/tmpelg39tio.py", line 2, in <module> K, N = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s061570572
p02549
u903005414
1600547519
Python
PyPy3 (7.3.0)
py
Runtime Error
985
138816
598
N, K = map(int, input().split()) S = set() MOD = 998244353 for _ in range(K): L, R = map(int, input().split()) S |= set(range(L, R + 1)) # print(f'{S=}') DP = [-1] * ((N + 1) * 2) DP[0] = 0 DP[1] = 1 def f(idx): ans = 0 for s in S: if idx - s < 0: continue if DP[idx - s] ...
Traceback (most recent call last): File "/tmp/tmpx0tyojm4/tmpiwh10ece.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s380510506
p02549
u333537444
1600547480
Python
Python (3.8.2)
py
Runtime Error
2206
11264
818
def input_int(): return(int(input())) def input_int_list(): return(list(map(int,input().split()))) def input_int_map(): return(map(int,input().split())) def run(): n, k = input_int_map() k_set = set() ranges = [] for _ in range(k): l, r = input_int_map() ranges.append(...
Traceback (most recent call last): File "/tmp/tmpka44n55g/tmpoil81ymr.py", line 48, in <module> run() File "/tmp/tmpka44n55g/tmpoil81ymr.py", line 12, in run n, k = input_int_map() ^^^^^^^^^^^^^^^ File "/tmp/tmpka44n55g/tmpoil81ymr.py", line 9, in input_int_map return(map(int,input().split(...
s476409078
p02549
u448406471
1600547466
Python
Python (3.8.2)
py
Runtime Error
262
31180
708
import math K, N = map(int, input().split()) num_list = [] for i in range(N): L, R = map(int, input().split()) num_list += list(range(L, R+1)) num_set = set(sorted(num_list)) count_log = [-1 for i in range(K)] def recursion(n, count): if n == 0: return 1 elif n < 0: return 0 fo...
Traceback (most recent call last): File "/tmp/tmp3jc9to57/tmp0o31ednp.py", line 2, in <module> K, N = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s176174986
p02549
u248996551
1600547426
Python
PyPy3 (7.3.0)
py
Runtime Error
340
86152
753
N,K=map(int,input().split()) from functools import lru_cache #上手くいかない時は下 # from functools32 import lru_cache table=[0]*(N+1) table[1]=1 step=[] for i in range(K): l,r=map(int,input().split()) for i in range(l,r+1): step.append(i) mod=998244353 @lru_cache(None) def leapy(x): if table[x] !...
Traceback (most recent call last): File "/tmp/tmp_pdnyla5/tmpyy0xajqw.py", line 1, in <module> N,K=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s948412483
p02549
u903005414
1600547416
Python
PyPy3 (7.3.0)
py
Runtime Error
1027
132304
592
N, K = map(int, input().split()) S = set() MOD = 998244353 for _ in range(K): L, R = map(int, input().split()) S |= set(range(L, R + 1)) # print(f'{S=}') DP = [-1] * (N + 1) DP[0] = 0 DP[1] = 1 def f(idx): ans = 0 for s in S: if idx - s < 0: continue if DP[idx - s] == -1:...
Traceback (most recent call last): File "/tmp/tmpm_bfteig/tmpq17qgcrd.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s096441417
p02549
u347502437
1600547386
Python
Python (3.8.2)
py
Runtime Error
26
9204
374
def main(): N, K = map(int, input().split()) S = [] while K !=0: L, R = map(int, input().split()) S += [[L,R]] K -= 1 S.sort() A = [1] + [0 for i in range(N + max(s for s in S))] for i in range(N): for s in S: for t in range(s[0], s[1]+1): ...
Traceback (most recent call last): File "/tmp/tmpaopog14u/tmppo8uhz9m.py", line 17, in <module> main() File "/tmp/tmpaopog14u/tmppo8uhz9m.py", line 2, in main N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s666860648
p02549
u347502437
1600547351
Python
Python (3.8.2)
py
Runtime Error
31
8972
373
def main(): N, K = map(int, input().split()) S = [] while K !=0: L, R = map(int, input().split()) S += [[L,R]] K -= 1 S.sort() A = [1] + [0 for i in range(N + max(s for s in S))] for i in range(N): for s in S: for t in range(s[0], s[1]+1): ...
File "/tmp/tmpv93o1dlq/tmp5s0zijdo.py", line 13 A[i+t] += A[i] ^ IndentationError: expected an indented block after 'for' statement on line 12
s208595374
p02549
u798361174
1600547325
Python
Python (3.8.2)
py
Runtime Error
27
9036
896
#include <iostream> #include <iomanip> #include <algorithm> #include <vector> using namespace std; void Main() { // input int64_t mod = 998244353; int64_t N, K; cin >> N >> K; vector<int64_t> S(2 * K); for (int64_t i = 0; i < K; i++) { cin >> S[2 * i] >> S[2 * i + 1]; } sort(S...
File "/tmp/tmptgt1sjmj/tmp_2frmp32.py", line 6 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s842694477
p02549
u823585596
1600547318
Python
PyPy3 (7.3.0)
py
Runtime Error
96
77072
419
import sys sys.setrecursionlimit(10**9) mod=998244353 N,K=map(int,input().split()) _S=[] for _ in range(K): l,r=map(int,input().split()) _S+=list(range(l,r+1)) S=sorted(_S) dp=[0]*(N+1) def Leaping_Tak(n,S): x=0 if n==0: return 1 if 0<n<S[0]: return 0 for s in range(S): i...
Traceback (most recent call last): File "/tmp/tmpyrybz4py/tmp6hlhzvfu.py", line 4, in <module> N,K=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s370270032
p02549
u264395947
1600547297
Python
Python (3.8.2)
py
Runtime Error
2206
9928
444
N, K = map(int, input().split()) L = [0]*K R = [0]*K for i in range(K): L[i], R[i] = map(int, input().split()) L = sorted(L) R = sorted(R) mod = 998244353 def c(n): if n == 1: return 1 else: ans = 0 for i in range(K): for j in range(L[i],R[i]+1): if n...
Traceback (most recent call last): File "/tmp/tmpo5hpd_11/tmpqw5ac1ie.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s856301584
p02549
u448406471
1600547264
Python
Python (3.8.2)
py
Runtime Error
2206
19212
669
import math K, N = map(int, input().split()) num_set = [] for i in range(N): L, R = map(int, input().split()) num_set += list(range(L, R+1)) count_log = [-1 for i in range(K)] def recursion(n, count): if n == 0: return 1 elif n < 0: return 0 for i in num_set: if n-i < 0: ...
Traceback (most recent call last): File "/tmp/tmp4hkdnh38/tmpsfzerlh2.py", line 2, in <module> K, N = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s482936917
p02549
u882950355
1600547252
Python
PyPy3 (7.3.0)
py
Runtime Error
107
82572
450
n, k = map(int,input().split()) lr = [map(int, input().split()) for _ in range(k)] l, r = [list(i) for i in zip(*lr)] step = [] for i in range(k): step.extend(list(range(l[i],r[i]+1))) step.sort() m = 998244353 dp = [-1]*n dp[0] = 1 def solve(n): ans = 0 if dp[n] != -1: return dp[n] else: for s in step...
Traceback (most recent call last): File "/tmp/tmpxoyfukfz/tmpv8hbp18j.py", line 1, in <module> n, k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s366772020
p02549
u786801412
1600547244
Python
Python (3.8.2)
py
Runtime Error
2206
36996
458
import numpy as np mod = 998244353 n, k = input().split() n, k = int(n), int(k) s = [] for i in range(k): l, r = input().split() for j in range(int(l), int(r)+1): s.append(j) f = [-1] * n f[0] = 1 def func(i): sum = 0 for j in s: if j <= i: if (f[i-j] == -1): ...
Traceback (most recent call last): File "/tmp/tmppvkw230s/tmpqwlryxnv.py", line 4, in <module> n, k = input().split() ^^^^^^^ EOFError: EOF when reading a line
s706235909
p02549
u680190333
1600547222
Python
Python (3.8.2)
py
Runtime Error
2206
19660
414
import sys input = sys.stdin.readline N,K = (int(x) for x in input().rstrip('\n').split()) As = [] n = [x for x in range(1,N+1)] for _ in range(K): L,R = (int(x) for x in input().rstrip('\n').split()) As.extend(n[L-1:R]) res = [1] for i in range(1,As[-1]): res.append(sum(res[i-v] for v in As if i-v >= 0)%9982443...
Traceback (most recent call last): File "/tmp/tmpb1lcjles/tmpjbtih_pk.py", line 4, in <module> N,K = (int(x) for x in input().rstrip('\n').split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s863556207
p02549
u248996551
1600547185
Python
PyPy3 (7.3.0)
py
Runtime Error
343
86020
713
N,K=map(int,input().split()) from functools import lru_cache #上手くいかない時は下 # from functools32 import lru_cache table=[0]*(N+1) table[1]=1 step=[] for i in range(K): l,r=map(int,input().split()) for i in range(l,r+1): step.append(i) mod=998244353 @lru_cache(None) def leapy(x): for y in step...
Traceback (most recent call last): File "/tmp/tmplw27rs8w/tmpyygs12t4.py", line 1, in <module> N,K=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s825372320
p02549
u239528020
1600547161
Python
PyPy3 (7.3.0)
py
Runtime Error
101
68612
696
#!/usr/bin/env python3 import numpy as np mod = 998244353 n, k = list(map(int, input().split())) lr = [] # sets = set([]) for i in range(k): l, r = list(map(int, input().split())) # sets.update(set(range(l, r+1))) lr.append((l, r)) # print(sets) lr.sort() np_lists = np.zeros(n, dtype=int) np_lists[0] =...
Traceback (most recent call last): File "/tmp/tmpkt6yg5ud/tmpac359y6e.py", line 6, in <module> n, k = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s458551794
p02549
u448406471
1600547132
Python
Python (3.8.2)
py
Runtime Error
2206
19092
643
import math K, N = map(int, input().split()) num_set = [] for i in range(N): L, R = map(int, input().split()) num_set += list(range(L, R+1)) #print(num_set) count_log = [-1 for i in range(K)] def recursion(n, count): if n == 0: return 1 elif n < 0: return 0 for i in num_set: ...
Traceback (most recent call last): File "/tmp/tmp9ifak5ul/tmpjvpholae.py", line 2, in <module> K, N = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s625797624
p02549
u240444124
1600547125
Python
Python (3.8.2)
py
Runtime Error
445
45440
297
import sys sys.setrecursionlimit(30000) M=998244353 y=lambda:map(int,input().split()) n,k=y() s=set() for i in range(k): a,b=y() for j in range(a,b+1):s.add(j) d={1:1} def v(n): if n<1:return 0 if n in d:return d[n] r=sum(v(n-i)for i in s)%M d[n]=r return r print(v(n))
Traceback (most recent call last): File "/tmp/tmpf1gswjem/tmpy6mr93ki.py", line 5, in <module> n,k=y() ^^^ File "/tmp/tmpf1gswjem/tmpy6mr93ki.py", line 4, in <lambda> y=lambda:map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s562428242
p02549
u331105860
1600547093
Python
Python (3.8.2)
py
Runtime Error
1939
106716
591
import numpy as np # noqa import numba # noqa from numba import njit, b1, i4, i8, f8 # noqa m = 998244353 N, K = map(int, input().split()) jumps = [] for i in range(K): l, r = map(int, input().split()) jumps.append([l, r]) jumps = np.array(jumps) @njit((i8, i8, i8[:, :]), cache=True) def main(N, m, jump...
Traceback (most recent call last): File "/tmp/tmpp4vt_cgd/tmpwucgmkk2.py", line 6, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s460965772
p02549
u072717685
1600547083
Python
Python (3.8.2)
py
Runtime Error
2009
106832
784
import sys read = sys.stdin.read #readlines = sys.stdin.readlines import numpy as np from numba import njit def main(): large_num = 998244353 n, k = map(int, input().split()) n -= 1 jump = [] m = map(int, read().split()) for a, b in zip(m, m): jump.append((a, b)) jump = np.array(jump...
Traceback (most recent call last): File "/tmp/tmprlch7b45/tmp9jot7gys.py", line 31, in <module> main() File "/tmp/tmprlch7b45/tmp9jot7gys.py", line 8, in main n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s170327724
p02549
u240444124
1600547055
Python
Python (3.8.2)
py
Runtime Error
440
38044
297
import sys sys.setrecursionlimit(20000) M=998244353 y=lambda:map(int,input().split()) n,k=y() s=set() for i in range(k): a,b=y() for j in range(a,b+1):s.add(j) d={1:1} def v(n): if n<1:return 0 if n in d:return d[n] r=sum(v(n-i)for i in s)%M d[n]=r return r print(v(n))
Traceback (most recent call last): File "/tmp/tmpptk3phsy/tmpv_wn_zaw.py", line 5, in <module> n,k=y() ^^^ File "/tmp/tmpptk3phsy/tmpv_wn_zaw.py", line 4, in <lambda> y=lambda:map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s768964293
p02549
u239528020
1600547034
Python
PyPy3 (7.3.0)
py
Runtime Error
97
74748
723
#!/usr/bin/env python3 import numpy as np import sys sys.setrecursionlimit(10**6) mod = 998244353 n, k = list(map(int, input().split())) lr = [] # sets = set([]) for i in range(k): l, r = list(map(int, input().split())) # sets.update(set(range(l, r+1))) lr.append((l, r)) # print(sets) lr.sort() np_lists...
Traceback (most recent call last): File "/tmp/tmptiv3hc_c/tmpm0p6c9_5.py", line 7, in <module> n, k = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s903659895
p02549
u239528020
1600547011
Python
PyPy3 (7.3.0)
py
Runtime Error
95
74732
723
#!/usr/bin/env python3 import numpy as np import sys sys.setrecursionlimit(10**6) mod = 998244353 n, k = list(map(int, input().split())) lr = [] # sets = set([]) for i in range(k): l, r = list(map(int, input().split())) # sets.update(set(range(l, r+1))) lr.append((l, r)) # print(sets) lr.sort() np_lists...
Traceback (most recent call last): File "/tmp/tmpo613a674/tmpoq2uuqqu.py", line 7, in <module> n, k = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s341598209
p02549
u638217437
1600547007
Python
Python (3.8.2)
py
Runtime Error
71
27096
456
def get(): return [int(x) for x in input().split()] n, k = get() s = set() for _ in range(k): start, end = get() [s.add(x) for x in range(start, end+1)] memo = {} def rec(N): if N < 1: return 0 elif N == 1: return 1 ans = 0 for i in s: if i > N: break ...
Traceback (most recent call last): File "/tmp/tmpn7g6d1u_/tmp28g8nip2.py", line 4, in <module> n, k = get() ^^^^^ File "/tmp/tmpn7g6d1u_/tmp28g8nip2.py", line 2, in get return [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s426573465
p02549
u825186577
1600546980
Python
Python (3.8.2)
py
Runtime Error
2247
1157956
514
n, k = map(int, input().split()) S = set() LR = [] for _ in range(k): tmp = list(map(int, input().split())) LR.append(tmp) for i in LR: l, r = int(i[0]), int(i[1]) for j in range(l, r + 1): S.add(j) diff = n-1 ans = 0 MOD = 998244353 def dfs(A): if sum(A) == diff: return 1 ...
Traceback (most recent call last): File "/tmp/tmpis_zg3re/tmp1oizhwap.py", line 1, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s877934636
p02549
u734876600
1600546936
Python
Python (3.8.2)
py
Runtime Error
120
29928
409
import numpy as np n, k = map(int, input().split()) sec = np.array([], dtype=np.int) masu = np.zeros(n, dtype=np.int) masu[0] = 1 for i in range(k): l, r = map(int, input().split()) sec = np.hstack([sec, np.arange(l,r+1)]) sec.sort() for i in range(n): until = np.where(i+sec > n) for step in sec[:until...
Traceback (most recent call last): File "/tmp/tmp696jid24/tmpfcyrj4gd.py", line 2, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s561293359
p02549
u232873434
1600546835
Python
PyPy3 (7.3.0)
py
Runtime Error
2208
74224
421
mod =998244353 N, K = map(int,input().split()) lr_list = [] for i in range(K): L, R = map(int,input().split()) lr_list += list(range(L,R+1)) dp = [0]*N min_lr_list = min(lr_list) dp[min_lr_list] = 1 for i in range(min_lr_list+1,N): for j in lr_list: if i>j: dp[i] += dp[i-j] ...
Traceback (most recent call last): File "/tmp/tmp4rwx2lzw/tmp2yxph2i7.py", line 4, in <module> N, K = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s075785081
p02549
u793868662
1600546812
Python
PyPy3 (7.3.0)
py
Runtime Error
114
79792
520
def resolve(): n, k = map(int, input().split()) mod = 998244353 dp = [0] * (2*n) imos = [0] * (2*n) lr = [] for i in range(k): l, r = map(int, input().split()) lr.append((l, r+1)) for l, r in lr: imos[l] = 1 imos[r] = -1 now = 0 for i in range(1, n): ...
Traceback (most recent call last): File "/tmp/tmpg2il6rrw/tmpzfgrz_4s.py", line 24, in <module> resolve() File "/tmp/tmpg2il6rrw/tmpzfgrz_4s.py", line 2, in resolve n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s552605779
p02549
u264395947
1600546768
Python
Python (3.8.2)
py
Runtime Error
2206
9796
471
N, K = map(int, input().split()) L = [0]*K R = [0]*K for i in range(K): L[i], R[i] = map(int, input().split()) L = sorted(L) R = sorted(R) mod = 998244353 def c(n): if n < 1: return 0 elif n == 1: return 1 else: ans = 0 for i in range(K): for j in range(L...
Traceback (most recent call last): File "/tmp/tmpo2j__4bz/tmplu0eepjm.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s631034508
p02549
u240444124
1600546766
Python
Python (3.8.2)
py
Runtime Error
420
26100
257
M=998244353 y=lambda:map(int,input().split()) n,k=y() s=set() for i in range(k): a,b=y() for j in range(a,b+1):s.add(j) d={1:1} def v(n): if n<1:return 0 if n in d:return d[n] r=sum(v(n-i)for i in s)%M d[n]=r return r print(v(n))
Traceback (most recent call last): File "/tmp/tmpnq_roxd7/tmpsiqgw2g5.py", line 3, in <module> n,k=y() ^^^ File "/tmp/tmpnq_roxd7/tmpsiqgw2g5.py", line 2, in <lambda> y=lambda:map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s605114047
p02549
u451122856
1600546702
Python
PyPy3 (7.3.0)
py
Runtime Error
2207
86016
2287
import os from io import BytesIO, IOBase import sys from collections import defaultdict,deque import math def main(): def coun(x, i): if dp[i] != 0: return dp[i] else: for j in x: if (j + i) <= n - 1: dp[i] += coun(x, i + j) ret...
Traceback (most recent call last): File "/tmp/tmpkia8lu3i/tmpjaxta780.py", line 79, in <module> main() File "/tmp/tmpkia8lu3i/tmpjaxta780.py", line 16, in main n, k = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s450153938
p02549
u688908698
1600546697
Python
PyPy3 (7.3.0)
py
Runtime Error
2207
138156
415
n,k = map(int,input().split()) s = set() for i in range(k): l, r = map(int,input().split()) lr = set(list(range(l,r+1))) s = s|lr def iterate(start, goal, s): if start == goal: return 1 elif start > goal: return 0 else: res = 0 for i in s: res += iter...
Traceback (most recent call last): File "/tmp/tmpo03z5ecb/tmpcu5_xewr.py", line 1, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s490030336
p02549
u009348313
1600546680
Python
PyPy3 (7.3.0)
py
Runtime Error
734
159140
390
n,k = map(int,input().split()) s = [] for i in range(k): l,r = map(int,input().split()) s.append((l,r)) MOD = 998244353 memo = [-1 for _ in range(n+1)] def f(x): if x < 1: return 0 if x == 1: return 1 if memo[x] != -1: return memo[x] res = 0 for l,r in s: for i in range(l,r+1): res...
Traceback (most recent call last): File "/tmp/tmpoe49_atb/tmp9hrz28q1.py", line 1, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s355654047
p02549
u934119021
1600546634
Python
Python (3.8.2)
py
Runtime Error
2206
41344
895
import itertools import math import collections def get_integral_value_combination(list, target): def a(idx, l, r, t): if t == sum(l): r.append(l) elif t < sum(l): return for u in range(idx, len(list)): a((u + 1), l + [list[u]], r, t) return r return a(0, [], [], targ...
Traceback (most recent call last): File "/tmp/tmp4wk36gyi/tmpvku9aktn.py", line 17, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s097381890
p02549
u072717685
1600546608
Python
Python (3.8.2)
py
Runtime Error
538
106932
777
import sys read = sys.stdin.read #readlines = sys.stdin.readlines import numpy as np from numba import njit def main(): large_num = 998244353 n, k = map(int, input().split()) n -= 1 jump = [] m = map(int, read().split()) for a, b in zip(m, m): jump.append((a, b)) jump = np.array(jum...
Traceback (most recent call last): File "/tmp/tmphcnsnan4/tmp05qcmpud.py", line 34, in <module> main() File "/tmp/tmphcnsnan4/tmp05qcmpud.py", line 8, in main n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s854969848
p02549
u688908698
1600546522
Python
PyPy3 (7.3.0)
py
Runtime Error
2208
138312
520
n,k = map(int,input().split()) l = [] r = [] for i in range(k): left, right = map(int,input().split()) l.append(left) r.append(right) s = set() for i in range(k): lr = list(range(l[i],r[i]+1)) tmp = set(lr) s = s|tmp def iterate(start, goal, s): if start == goal: return 1 elif ...
Traceback (most recent call last): File "/tmp/tmpb9f0olvt/tmpmckmes75.py", line 1, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s414408137
p02549
u587370992
1600546503
Python
PyPy3 (7.3.0)
py
Runtime Error
2262
1757492
606
import sys N, K = list(map(int, input().split())) MOD = 998244353 sys.setrecursionlimit(N * 3) L = [] R = [] for _ in range(K): l, r = list(map(int, input().split())) L.append(l) R.append(r) memo = [None] * (N + 1) def f(x): if x < 0: return 0 if memo[x] is None: memo[x] = _f(x)...
Traceback (most recent call last): File "/tmp/tmpo3889rds/tmpkhb7uxil.py", line 3, in <module> N, K = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s883393030
p02549
u912330011
1600546485
Python
PyPy3 (7.3.0)
py
Runtime Error
436
81504
470
N, K = map(int, input().split()) LR = [tuple(map(int, input().split())) for _ in range(K)] minL = min(i[0] for i in LR) mod = 998244353 result = [None for _ in range(N)] result[0] = 1 #for ni in range(1, N): def dp(ni): result[ni] = 0 for l, r in LR: for j in range(l, r+1): if ni-j<0: continue re...
Traceback (most recent call last): File "/tmp/tmphs13v8gz/tmp3yeefzs2.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s179745278
p02549
u503227287
1600546389
Python
PyPy3 (7.3.0)
py
Runtime Error
491
85440
1171
from sys import stdin class DFS(): def __init__(self,N,S): self.N = N self.S = S self.seen = [False] * self.N self.cnt = [0] * self.N def dfs(self, i): if i == self.N-1: return 1 elif i > self.N-1: return 0 elif self.seen[i]: ...
Traceback (most recent call last): File "/tmp/tmpb4kugpwz/tmpx1ghgc7r.py", line 49, in <module> main() File "/tmp/tmpb4kugpwz/tmpx1ghgc7r.py", line 30, in main N, K = list(map(int, _in[0].split(' '))) # type:list(int) ~~~^^^ IndexError: list index out of range