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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s189419171 | p02537 | u581634684 | 1601169191 | Python | PyPy3 (7.3.0) | py | Runtime Error | 161 | 100356 | 890 | from sys import stdin, stdout
from collections import defaultdict
input = stdin.readline
class Graph:
def __init__(self,V):
self.V = V
self.adj = [[] for i in range(V)]
def DFSUtil(self, temp, v, visited):
visited[v] = True
temp.append(v)
for i in self.adj[v]:
if visited[i] == False:
... | Traceback (most recent call last):
File "/tmp/tmpf19e79p0/tmp6s63bah4.py", line 39, in <module>
n, m = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s789701664 | p02537 | u340781749 | 1601169127 | Python | PyPy3 (7.3.0) | py | Runtime Error | 398 | 115776 | 1854 | import sys
class SegTreeMax:
"""
以下のクエリを処理する
1.update: i番目の値をxに更新する
2.get_min: 区間[l, r)の最小値を得る
"""
def __init__(self, n, INF):
"""
:param n: 要素数
:param INF: 初期値(入りうる要素より十分に大きな数)
"""
n2 = 1 << (n - 1).bit_length()
self.offset = n2
self.t... | Traceback (most recent call last):
File "/tmp/tmpmi0khmh5/tmp0r_e6tu_.py", line 68, in <module>
n, k, *aaa = map(int, sys.stdin.buffer.read().split())
^^^^^^^^^^
ValueError: not enough values to unpack (expected at least 2, got 0)
| |
s182273694 | p02537 | u340781749 | 1601169079 | Python | PyPy3 (7.3.0) | py | Runtime Error | 456 | 115768 | 1832 | import sys
class SegTreeMax:
"""
以下のクエリを処理する
1.update: i番目の値をxに更新する
2.get_min: 区間[l, r)の最小値を得る
"""
def __init__(self, n, INF):
"""
:param n: 要素数
:param INF: 初期値(入りうる要素より十分に大きな数)
"""
n2 = 1 << (n - 1).bit_length()
self.offset = n2
self.t... | Traceback (most recent call last):
File "/tmp/tmp6txkp14r/tmpgayoy524.py", line 68, in <module>
n, k, *aaa = map(int, sys.stdin.buffer.read().split())
^^^^^^^^^^
ValueError: not enough values to unpack (expected at least 2, got 0)
| |
s631627352 | p02537 | u714642969 | 1601169025 | Python | PyPy3 (7.3.0) | py | Runtime Error | 495 | 99480 | 1662 | # -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1
N,K=map(int,input().split())
A=[int(input()) fo... | Traceback (most recent call last):
File "/tmp/tmpla9nrs_7/tmpoc29eyow.py", line 11, in <module>
N,K=map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s600636826 | p02538 | u203197031 | 1601449174 | Python | PyPy3 (7.3.0) | py | Runtime Error | 216 | 150000 | 7218 | MOD = 998244353
class LazySegmentTree: # from https://atcoder.jp/contests/practice2/submissions/16598122
__slots__ = ["n", "data", "lazy", "me", "oe", "fmm", "fmo", "foo"]
def __init__(self, monoid_data, monoid_identity, operator_identity, func_monoid_monoid, func_monoid_operator,
func_operato... | Traceback (most recent call last):
File "/tmp/tmp_149llii/tmpkckotu4v.py", line 305, in <module>
main()
File "/tmp/tmp_149llii/tmpkckotu4v.py", line 208, in main
n,q = ina()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s437180604 | p02538 | u941407962 | 1601309285 | Python | PyPy3 (7.3.0) | py | Runtime Error | 121 | 76948 | 1512 |
N, Q = map(int, input().split())
LV = (N-1).bit_length()
N0 = 2**LV
data = [(1, 0)]*(2*N0)
lazy = [None]*(2*N0)
def gindex(l, r):
L = (l + N0) >> 1; R = (r + N0) >> 1
lc = 0 if l & 1 else (L & -L).bit_length()
rc = 0 if r & 1 else (R & -R).bit_length()
for i in range(LV):
if rc <= i:
... | Traceback (most recent call last):
File "/tmp/tmp8acz15di/tmpewwujkde.py", line 2, in <module>
N, Q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s048721331 | p02538 | u284854859 | 1601245153 | Python | PyPy3 (7.3.0) | py | Runtime Error | 102 | 76436 | 5381 | import sys
input = sys.stdin.readline
class LazySegmentTree():
def __init__(self, n, op, e, mapping, composition, id):
self.n = n
self.op = op
self.e = e
self.mapping = mapping
self.composition = composition
self.id = id
self.log = (n - 1).bit_length()
... | Traceback (most recent call last):
File "/tmp/tmpn_uc18dj/tmpnfjw5zjz.py", line 172, in <module>
n,q = map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s076223630 | p02538 | u284854859 | 1601244806 | Python | PyPy3 (7.3.0) | py | Runtime Error | 126 | 77820 | 5280 | import sys
input = sys.stdin.readline
class LazySegmentTree():
def __init__(self, n, op, e, mapping, composition, id):
self.n = n
self.op = op
self.e = e
self.mapping = mapping
self.composition = composition
self.id = id
self.log = (n - 1).bit_length()
... | Traceback (most recent call last):
File "/tmp/tmpfztuago6/tmpufvkxg7c.py", line 170, in <module>
n,q = map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s848784881 | p02538 | u227082700 | 1601244401 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 68648 | 3375 | import sys
def input(): return sys.stdin.readline().rstrip()
class LazySegmentTree:
__slots__ = ["n", "seg", "x_unit", "m_unit", "f", "g", "h", "lazy"]
def __init__(self, n, p, x_unit, m_unit, f, g, h):
self.n = n
self.seg = p*2
self.x_unit = x_unit
self.m_unit = m_unit
self.f = f
self.... | Traceback (most recent call last):
File "/tmp/tmpsbbsfy9h/tmppxzoy18i.py", line 85, in <module>
n,q=map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s181352834 | p02538 | u189023301 | 1601225226 | Python | Python (3.8.2) | py | Runtime Error | 120 | 27228 | 5509 | import sys
import os
import numpy as np
def solve(inp):
MOD = 998244353
def bit_length(x):
ret = 0
while x:
x >>= 1
ret += 1
return ret
e = 0
id_x = -1
n = inp[0]
q = inp[1]
X = inp[2::3]
Y = inp[3::3]
REP = inp[4::3]
log = bit_... | Traceback (most recent call last):
File "/tmp/tmpvwcdh7lv/tmpk8psnogl.py", line 244, in <module>
from my_module import solve
ModuleNotFoundError: No module named 'my_module'
| |
s862144604 | p02538 | u678167152 | 1601200760 | Python | PyPy3 (7.3.0) | py | Runtime Error | 133 | 94656 | 4675 | class LazySegmentTree():
def __init__(self, n, op, e, mapping, composition, id):
self.n = n
self.op = op
self.e = e
self.mapping = mapping
self.composition = composition
self.id = id
self.log = (n - 1).bit_length()
self.size = 1 << self.log
self.data = [(e,e)] * (2 * self.size)
... | Traceback (most recent call last):
File "/tmp/tmpfou6fek5/tmpxggjoiog.py", line 157, in <module>
N, Q = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s211446982 | p02538 | u615285493 | 1601196816 | Python | PyPy2 (7.3.0) | py | Runtime Error | 318 | 85296 | 10595 | import types
_atcoder_code = """
# Python port of AtCoder Library.
__version__ = '0.0.1'
"""
atcoder = types.ModuleType('atcoder')
exec(_atcoder_code, atcoder.__dict__)
_atcoder__bit_code = """
def _ceil_pow2(n: int) -> int:
x = 0
while (1 << x) < n:
x += 1
return x
def _bsf(n: int) -> int:
... | File "/tmp/tmp6r3dcm95/tmp_sub1ny4.py", line 247
from __future__ import division, print_function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: from __future__ imports must occur at the beginning of the file
| |
s383798074 | p02538 | u615285493 | 1601196708 | Python | PyPy2 (7.3.0) | py | Runtime Error | 490 | 85312 | 9897 | import types
_atcoder_code = """
# Python port of AtCoder Library.
__version__ = '0.0.1'
"""
atcoder = types.ModuleType('atcoder')
exec(_atcoder_code, atcoder.__dict__)
_atcoder__bit_code = """
def _ceil_pow2(n: int) -> int:
x = 0
while (1 << x) < n:
x += 1
return x
def _bsf(n: int) -> int:
... | Traceback (most recent call last):
File "/tmp/tmpmi3p8tr6/tmpeumuuxrl.py", line 362, in <module>
main()
File "/tmp/tmpmi3p8tr6/tmpeumuuxrl.py", line 282, in main
n, q = getints()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s662241313 | p02538 | u224993839 | 1601193012 | Python | Python (3.8.2) | py | Runtime Error | 480 | 138568 | 134 | n,q=map(int,input().split())
r='1'*n
for i in range(q):
a,b,c=map(int,input().split())
r=r[:a-1]+str(c)*(b-a+1)+r[b:]
print(r)
| Traceback (most recent call last):
File "/tmp/tmp_ukwtp50/tmpig4h3rtq.py", line 1, in <module>
n,q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s476170151 | p02538 | u224993839 | 1601192952 | Python | PyPy3 (7.3.0) | py | Runtime Error | 514 | 271796 | 134 | n,q=map(int,input().split())
r='1'*n
for i in range(q):
a,b,c=map(int,input().split())
r=r[:a-1]+str(c)*(b-a+1)+r[b:]
print(r)
| Traceback (most recent call last):
File "/tmp/tmpm5ocf2oc/tmp_k_n23th.py", line 1, in <module>
n,q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s966974354 | p02538 | u860829879 | 1601188014 | Python | PyPy3 (7.3.0) | py | Runtime Error | 205 | 70040 | 14159 | import types
_atcoder_code = """
# Python port of AtCoder Library.
__version__ = '0.0.1'
"""
atcoder = types.ModuleType('atcoder')
exec(_atcoder_code, atcoder.__dict__)
_atcoder__bit_code = """
def _ceil_pow2(n: int) -> int:
x = 0
while (1 << x) < n:
x += 1
return x
def _bsf(n: int) -> int:
... | Traceback (most recent call last):
File "/tmp/tmppbznj882/tmpq5bu63mo.py", line 548, in <module>
main()
File "/tmp/tmppbznj882/tmpq5bu63mo.py", line 518, in main
n, q = map(int, sys.stdin.readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s815098157 | p02538 | u860829879 | 1601187861 | Python | PyPy3 (7.3.0) | py | Runtime Error | 99 | 74740 | 1038 | import sys
from atcoder.lazysegtree import LazySegTree
from atcoder.modint import ModContext, Modint
def main() -> None:
with ModContext(998244353):
n, q = map(int, sys.stdin.readline().split())
a=[(Modint(1),Modint(10))]*n
def op(x: (Modint, Modint), y: (Modint, Modint)) -> (Modint, Modi... | Traceback (most recent call last):
File "/tmp/tmpnrykyh2n/tmp3zp8182s.py", line 3, in <module>
from atcoder.lazysegtree import LazySegTree
ModuleNotFoundError: No module named 'atcoder'
| |
s025909839 | p02538 | u960080897 | 1601179822 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 68480 | 5522 | # Date [ 2020-09-26 22:17:31 ]
# Problem [ e.py ]
# Author Koki_tkg
from __future__ import annotations
import sys
def read_str(): return sys.stdin.readline().strip()
def read_int(): return int(sys.stdin.readline().strip())
def read_ints(): return map(int, sys.stdin.readline().strip().split())
def read_str_split(): re... | Traceback (most recent call last):
File "/tmp/tmp6z_nwcz9/tmp5zw870ke.py", line 164, in <module>
Main()
File "/tmp/tmp6z_nwcz9/tmp5zw870ke.py", line 155, in Main
n, q = read_ints()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s505879124 | p02538 | u923172145 | 1601177175 | Python | PyPy3 (7.3.0) | py | Runtime Error | 213 | 158052 | 4667 | MOD = 998244353
Ref = [[0 for _ in range(100)] for _ in range(10)]
pow_2_lv = [pow(2,lv) for lv in range(30)]
P = 3*10**5+1
pow_10_MOD = [1 for i in range(P)]
for i in range(1,P):
pow_10_MOD[i] = (pow_10_MOD[i-1] * 10) % MOD
for i in range(1,10):
Ref[i][0] = i
for s in range(1,30):
Ref[i][s] += (Ref[i][s-1]... | Traceback (most recent call last):
File "/tmp/tmpr23_4qgl/tmpg7onz2p3.py", line 154, in <module>
lst.update(L, R+1, [D,1])
File "/tmp/tmpr23_4qgl/tmpg7onz2p3.py", line 121, in update
self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... | |
s970476287 | p02538 | u923172145 | 1601176787 | Python | PyPy3 (7.3.0) | py | Runtime Error | 195 | 117668 | 4562 | MOD = 998244353
Ref = [[0 for _ in range(100)] for _ in range(10)]
pow_2_lv = [pow(2,lv) for lv in range(30)]
pow_10_MOD = [pow(10, i, MOD) for i in range(50)]
for i in range(1,10):
Ref[i][0] = i
for s in range(1,30):
Ref[i][s] += (Ref[i][s-1] * (pow(10, pow_2_lv[s-1], MOD) + 1)) % MOD
Ref[i][s] %= MOD
#p... | Traceback (most recent call last):
File "/tmp/tmpsz0lcxlk/tmpd8b0gpjo.py", line 144, in <module>
N, Q = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s071861518 | p02538 | u631521893 | 1601175557 | Python | Python (3.8.2) | py | Runtime Error | 133 | 29692 | 292 | import numpy as np
n ,q = map(int, input().split())
a = np.ones(n, dtype = np.int)
for i in range(q):
l, r, d = map(int, input().split())
b = np.full(r-l+1, d)
a[l-1:r] = b
string = np.array_str(a).replace(" ", "").replace("[","").replace("]", "")
print(int(string)%998244353)
| Traceback (most recent call last):
File "/tmp/tmpovnidlog/tmpr60194y3.py", line 2, in <module>
n ,q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s375851018 | p02538 | u814986259 | 1601175232 | Python | Python (3.8.2) | py | Runtime Error | 241 | 33856 | 1984 | N, Q = map(int, input().split())
# N: 処理する区間の長さ
INF = 2**31-1
LV = (N-1).bit_length()
N0 = 2**LV
data = [0]*(2*N0)
lazy = [None]*(2*N0)
mod = 998244353
modv = [0]*N0*2
modv[N0+N-2] = 1
for i in range(N-1):
modv[N0+N-3-i] = (modv[N0+N-2-i]*10) % mod
# print(modv)
for i in range(N0-2, -1, -1):
modv[i] = (modv[2... | Traceback (most recent call last):
File "/tmp/tmp9uzhms2o/tmp3fhhqkn6.py", line 1, in <module>
N, Q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s651146564 | p02538 | u935558307 | 1601174834 | Python | PyPy3 (7.3.0) | py | Runtime Error | 83 | 68872 | 3104 | def main():
import sys
input = sys.stdin
N,Q = map(int,input().split())
squr = int(N**0.5)+1
mod = 998244353
"""
前処理
"""
memo = [[0]*(N) for _ in range(10)]
for i in range(10):
for j in range(N):
memo[i][j] = i*pow(10,N-j-1,mod)%mod
memo2 = [[0]*(N) for _... | Traceback (most recent call last):
File "/tmp/tmp0navuj77/tmp1_vcqbq7.py", line 96, in <module>
main()
File "/tmp/tmp0navuj77/tmp1_vcqbq7.py", line 4, in main
N,Q = map(int,input().split())
^^^^^^^
TypeError: '_io.TextIOWrapper' object is not callable
| |
s868386690 | p02538 | u334712262 | 1601174635 | Python | PyPy3 (7.3.0) | py | Runtime Error | 498 | 169144 | 4486 | # -*- coding: utf-8 -*-
import sys
# sys.setrecursionlimit(10**6)
readline = sys.stdin.buffer.readline
# readline = sys.stdin.readline
INF = 1 << 60
def read_int():
return int(readline())
def read_int_n():
return list(map(int, readline().split()))
def read_float():
return float(readline())
def rea... | Traceback (most recent call last):
File "/tmp/tmp1dx4k26l/tmp561tla76.py", line 215, in <module>
main()
File "/tmp/tmp1dx4k26l/tmp561tla76.py", line 209, in main
N, Q = read_int_n()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s052973759 | p02538 | u969708690 | 1601174410 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2212 | 177872 | 603 | def yuni(n,e):
s=n
for i in range(e):
s+=mod
if s%e==0:
return (s//e)%mod
N,Q=map(int,input().split())
mod=998244353
S="1"*N
L=[]#各桁までのmod
a=10
R=list()
for i in range(N):
L.append(yuni(a-1,9))
R.append(yuni(a,10))
a*=10
a%=mod
for i in range(Q):
a,b,c=map(int,input().split())
a,b=N-b+1,N-... | Traceback (most recent call last):
File "/tmp/tmp6gg2ikym/tmpb4pm7mv_.py", line 7, in <module>
N,Q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s059698015 | p02538 | u250218230 | 1601174404 | Python | Python (3.8.2) | py | Runtime Error | 46 | 10436 | 173 | n,q = map(int,input().split())
numb = [0]*n
for num in range(q):
l,r,d = map(int,input().split())
for i in range(l-1,r):
numb[i] = d
print(atoi(numb)/998244353)
| Traceback (most recent call last):
File "/tmp/tmp16wbczei/tmps3kc9ug7.py", line 1, in <module>
n,q = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s019713411 | p02538 | u415718506 | 1601174396 | Python | PyPy3 (7.3.0) | py | Runtime Error | 208 | 70000 | 15689 | import types
_atcoder_code = """
# Python port of AtCoder Library.
__version__ = '0.0.1'
"""
atcoder = types.ModuleType('atcoder')
exec(_atcoder_code, atcoder.__dict__)
_atcoder__bit_code = """
def _ceil_pow2(n: int) -> int:
x = 0
while (1 << x) < n:
x += 1
return x
def _bsf(n: int) -> int:
... | Traceback (most recent call last):
File "/tmp/tmp8ngwj8kn/tmpi_hmac3i.py", line 588, in <module>
s, nrows = list(map(int,inp[0].split()))
~~~^^^
IndexError: list index out of range
| |
s226175978 | p02538 | u608007704 | 1601174390 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 68660 | 152 | N,Q=map(int,input().split())
S="1"*N
for i in range(Q):
L,R,D=map(int,input().split())
for j in range(L,R+1)
S[j]=D
print(inr(S)%998244353)
| File "/tmp/tmp81j1ihcl/tmpaj2y5t7e.py", line 5
for j in range(L,R+1)
^
SyntaxError: expected ':'
| |
s572591806 | p02538 | u801617021 | 1601174385 | Python | Python (3.8.2) | py | Runtime Error | 79 | 9276 | 287 | n,q=map(int,input().split())
str1="1"
str2=""
for i in range(0,n):
str2=str2[0:]+str1[0:]
for i in range(0,q):
a,b,d=map(int,input().split())
d1=str(d)
for j in range(a-1,b):
str4=str4[0:j]+d1[0:]+str4[j+1:]
xx=int(str4)
yy=xx%998244533
print(yy)
| Traceback (most recent call last):
File "/tmp/tmpdqs4uq7y/tmpu0ihsvtc.py", line 1, in <module>
n,q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s041415582 | p02538 | u983892907 | 1601174384 | Python | Python (3.8.2) | py | Runtime Error | 1813 | 138592 | 248 | n,q = map(int,input().split())
s = "1"*n
for i in range(q-1):
L,R,D = map(int,input().split())
s = s[:(L-1)] + str(D)*(R-L+1) + s[(R):]
print(s)
L,R,D = map(int,input().split())
s = s[:(L-1)] + str(D)*(R-L+1) + s[(R):]
print(int(s)%998244353) | Traceback (most recent call last):
File "/tmp/tmpcgsi5fx1/tmp2jo8h2tj.py", line 1, in <module>
n,q = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s391717291 | p02538 | u119148115 | 1601174384 | Python | PyPy3 (7.3.0) | py | Runtime Error | 116 | 74548 | 3889 | import sys
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし
def S(): return s... | File "/tmp/tmppdh1t2q4/tmp_fiabvh9.py", line 57
if self.A[i] != 0
^
SyntaxError: expected ':'
| |
s356567586 | p02538 | u536034761 | 1601174370 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2210 | 172404 | 3653 | #####segfunc#####
def segfunc(x, y):
return min(x, y)
#################
#####ide_ele#####
ide_ele = 2**31 - 1
#################
class LazySegmentTree:
"""
init(init_val, ide_ele): 配列init_valで初期化 O(N)
update(l, r, x): 区間[l, r)をxに更新 O(logN)
query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN)
"""
... | Traceback (most recent call last):
File "/tmp/tmpa2x3q595/tmpyyvip_60.py", line 123, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s291269320 | p02538 | u969708690 | 1601174346 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 37044 | 612 | def yuni(n,e):
s=n
for i in range(e):
s+=mod
if s%e==0:
return (s//e)%mod
N,Q=map(int,input().split())
mod=998244353
S="1"*N
L=[]#各桁までのmod
a=10
R=list()
for i in range(N):
L.append(yuni(a-1,9))
R.append(yuni(a,10))
a*=10
a%=mod
for i in range(Q):
a,b,c=map(int,input().split())
a,b=N-b+1,N-... | Traceback (most recent call last):
File "/tmp/tmpz878u01m/tmpuwakilf1.py", line 7, in <module>
N,Q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s944019901 | p02538 | u376752722 | 1601174336 | Python | Python (3.8.2) | py | Runtime Error | 3583 | 138644 | 260 | n, q = map(int, input().split())
_string = ""
for i in range(n):
_string = _string + "1"
for i in range(q):
l, r, d = map(int, input().split())
tmp = ""
tmp = str(d) * (r-l+1)
_string = _string[0:l-1] + tmp + _string[r:]
print(_string) | Traceback (most recent call last):
File "/tmp/tmpb_r5hpah/tmpbq19rcwi.py", line 1, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s720072408 | p02538 | u983892907 | 1601174288 | Python | Python (3.8.2) | py | Runtime Error | 1757 | 138528 | 256 | n,q = map(int,input().split())
s = "1"*n
for i in range(q-1):
L,R,D = map(int,input().split())
s = s[:(L-1)] + str(D)*(R-L+1) + s[(R):]
print(s)
L,R,D = map(int,input().split())
s = s[:(L-1)] + str(D)*(R-L+1) + s[(R):]
sr = int(s)%998244353
print(sr) | Traceback (most recent call last):
File "/tmp/tmpkz36aw42/tmp3jdqolgv.py", line 1, in <module>
n,q = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s618775690 | p02538 | u872191059 | 1601174043 | Python | PyPy3 (7.3.0) | py | Runtime Error | 174 | 74216 | 1241 | MOD = 998244353
X, Y = 500, 400
n, q = map(int, input().split())
re = [[pow(10, X * i + j, MOD) for j in range(X)] for i in range(Y)]
ans = 0
se = [[0 for _ in range(X)] for _ in range(Y)]
sa = [0 for _ in range(Y)]
for i in range(Y):
for j in range(X):
if i * X + j < n:
ans += re[i][j]
... | Traceback (most recent call last):
File "/tmp/tmp_m_utjjs/tmpm83txm5n.py", line 3, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s804130577 | p02538 | u872191059 | 1601173904 | Python | PyPy3 (7.3.0) | py | Runtime Error | 170 | 74332 | 1241 | MOD = 998244353
X, Y = 500, 400
n, q = map(int, input().split())
re = [[pow(10, X * i + j, MOD) for j in range(X)] for i in range(Y)]
ans = 0
se = [[0 for _ in range(X)] for _ in range(Y)]
sa = [0 for _ in range(Y)]
for i in range(Y):
for j in range(X):
if i * X + j < n:
ans += re[i][j]
... | Traceback (most recent call last):
File "/tmp/tmpxfkumiqw/tmpw45mpym0.py", line 3, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s817226591 | p02538 | u947664173 | 1601173888 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2209 | 98568 | 171 | n,q=map(int,input().split())
ans="1"*n
while 1:
l,r,d=map(int,input().split())
ans=ans[:l]+str(d)*(r-l+1)+ans[r:]
answer=(int(ans))%998244353
print(answer) | Traceback (most recent call last):
File "/tmp/tmph87nspbw/tmp_27gw9lv.py", line 1, in <module>
n,q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s716772888 | p02538 | u263660661 | 1601173804 | Python | Python (3.8.2) | py | Runtime Error | 33 | 10328 | 226 | from decimal import Decimal as dec
n, q = map(int, input().split())
s = "1" * n
for i in range(q):
l, r, d = map(int, input().split())
if l != r:
s = s[:l-1] + str(d) * (r-l+1) + s[r:]
print(dec(s) % 998244353)
| Traceback (most recent call last):
File "/tmp/tmpy8reqh4c/tmprz6nt_bp.py", line 3, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s758550983 | p02538 | u263660661 | 1601173707 | Python | Python (3.8.2) | py | Runtime Error | 29 | 10256 | 211 | from decimal import Decimal as dec
n, q = map(int, input().split())
s = "1" * n
for i in range(q):
l, r, d = map(int, input().split())
s = s[:l-1] + str(d) * (r-l+1) + s[r:]
print(dec(s) % 998244353)
| Traceback (most recent call last):
File "/tmp/tmpsq1uq40b/tmpn72_e4e3.py", line 3, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s169184133 | p02538 | u321605735 | 1601173645 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 42620 | 318 | r=input().split()
N=int(r[0])
Q=int(r[1])
data=int("1"*N)
d=[[int(s) for s in input().split()] for i in range(Q)]
import math
for i in range(Q):
data=int(math.floor(data/(10**(N-d[i][0]+1))))*(10**(N-d[i][0]+1))+int(str(d[i][2])*(d[i][1]-d[i][0]+1))*(10**(N-d[i][1]))+data%10**(N-d[i][1])
print(data%998244353) | Traceback (most recent call last):
File "/tmp/tmpyb0096pn/tmpwqfzjccm.py", line 1, in <module>
r=input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s158320178 | p02538 | u321605735 | 1601173597 | Python | Python (3.8.2) | py | Runtime Error | 638 | 42412 | 306 | r=input().split()
N=int(r[0])
Q=int(r[1])
data=int("1"*N)
d=[[int(s) for s in input().split()] for i in range(Q)]
for i in range(Q):
data=int(math.floor(data/(10**(N-d[i][0]+1))))*(10**(N-d[i][0]+1))+int(str(d[i][2])*(d[i][1]-d[i][0]+1))*(10**(N-d[i][1]))+data%10**(N-d[i][1])
print(data%998244353) | Traceback (most recent call last):
File "/tmp/tmp6r7loxxj/tmps5vevry3.py", line 1, in <module>
r=input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s906029237 | p02538 | u991542950 | 1601173502 | Python | PyPy3 (7.3.0) | py | Runtime Error | 100 | 68684 | 214 | import numpy as np
mod = 998244353
n, q = map(int, input().split())
s = np.ones(n)
for _ in range(q):
l, r, d = map(int, input().split())
s[l-1:r] = d
print(str(int("".join(s.astype(int).astype(str))) % mod)) | Traceback (most recent call last):
File "/tmp/tmpi053qeqc/tmpg_umvuo4.py", line 3, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s472264687 | p02538 | u321605735 | 1601173482 | Python | Python (3.8.2) | py | Runtime Error | 626 | 42348 | 306 | r=input().split()
N=int(r[0])
Q=int(r[1])
data=int("1"*N)
d=[[int(s) for s in input().split()] for i in range(Q)]
for i in range(Q):
data=int(math.floor(data/(10**(N-d[i][0]+1))))*(10**(N-d[i][0]+1))+int(str(d[i][2])*(d[i][1]-d[i][0]+1))*(10**(N-d[i][1]))+data%10**(N-d[i][1])
print(data%998244353) | Traceback (most recent call last):
File "/tmp/tmp0eicz3ya/tmpu0hnw3wc.py", line 1, in <module>
r=input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s406430216 | p02538 | u163971674 | 1601173452 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9200 | 213 | n,m=map(int,input().split(" "))
A=[1,1,1,1,1,1,1,1]
for i in range(m):
a,b,x=map(int,input().split(" "))
c=1
g=0
for j in range(a-1,b):
A[j]=x
for j in range(n):
g=A[j]+g*10
print(g%998244353) | Traceback (most recent call last):
File "/tmp/tmp9hroa4l7/tmpjqmkti1d.py", line 1, in <module>
n,m=map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s629604365 | p02538 | u163971674 | 1601173390 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9100 | 213 | n,m=map(int,input().split(" "))
A=[1,1,1,1,1,1,1,1]
for i in range(m):
a,b,x=map(int,input().split(" "))
c=1
g=0
for i in range(a-1,b):
A[i]=x
for j in range(n):
g=A[j]+g*10
print(g%998244353) | Traceback (most recent call last):
File "/tmp/tmpqxd8ch6v/tmpu7saxgi2.py", line 1, in <module>
n,m=map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s985770739 | p02538 | u802781234 | 1601172860 | Python | PyPy3 (7.3.0) | py | Runtime Error | 100 | 68664 | 442 | def N():
return int(input())
def L():
return list(map(int,input().split()))
def NL(n):
return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7
import numpy as np
import sys
import math
import collections
n,q = L()
lrd = NL(q)
b = [1]*n
for l,r,d in lrd:
for i in range(n):
if ... | Traceback (most recent call last):
File "/tmp/tmpnnky66ge/tmp73bxxd73.py", line 12, in <module>
n,q = L()
^^^
File "/tmp/tmpnnky66ge/tmp73bxxd73.py", line 4, in L
return list(map(int,input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s852877030 | p02538 | u445978065 | 1601172755 | Python | PyPy2 (7.3.0) | py | Runtime Error | 346 | 90880 | 424 | import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
raw_input = iter(_INPUT_LINES).next
_OUTPUT_BUFFER = io.BytesIO()
sys.stdout = _OUTPUT_BUFFER
@atexit.register
def write():
sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
n,m = map(int,raw_input().split())
s = "1"*n
for i in range(... | Traceback (most recent call last):
File "/tmp/tmp01u1k2sj/tmpvoxem5nx.py", line 6, in <module>
raw_input = iter(_INPUT_LINES).next
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'list_iterator' object has no attribute 'next'
| |
s643002515 | p02538 | u380791283 | 1601172316 | Python | Python (3.8.2) | py | Runtime Error | 2227 | 31852 | 242 | #E
n,q = list(map(int, input().split()))
nl=[0]*n
for i in range(q):
l,r,d=list(map(int, input().split()))
for j in range(l,r):
nl[j]=d
li = map(str, nl)
print(''.join(li))
num=map(int,li)
ans=num%998244353
print(ans) | Traceback (most recent call last):
File "/tmp/tmpc_0qywx8/tmpy98kwsd9.py", line 2, in <module>
n,q = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s062261220 | p02538 | u947664173 | 1601172178 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2209 | 97664 | 169 | n,q=map(int,input().split())
ans="1"*n
while 1:
l,r,d=map(int,input().split())
ans=ans[:l]+str(d)*(r-l+1)+ans[r:]
answer=int(ans)%998244353
print(answer) | Traceback (most recent call last):
File "/tmp/tmpngd7vfje/tmp7qp96o1q.py", line 1, in <module>
n,q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s136960930 | p02538 | u695811449 | 1601171905 | Python | PyPy3 (7.3.0) | py | Runtime Error | 211 | 122520 | 3004 | import sys
input = sys.stdin.readline
N,Q=map(int,input().split())
mod=998244353
seg_el=1<<(N.bit_length()) # Segment treeの台の要素数
seg_height=1+N.bit_length() # Segment treeの高さ
SEG=[0 for i in range(2*seg_el)] # 区間の和
LAZY=[0 for i in range(2*seg_el)]
POW10=[pow(10,i,mod) for i in range(N+1)]
gyaku=pow(9,-1,mod)
def... | Traceback (most recent call last):
File "/tmp/tmpd3r3cl4n/tmp1kz7boos.py", line 4, in <module>
N,Q=map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s881819153 | p02538 | u175034939 | 1601171842 | Python | PyPy3 (7.3.0) | py | Runtime Error | 1355 | 93192 | 343 | n, q = map(int, input().split())
MOD = 998244353
a = '1'*n
for _ in range(q):
ans = 0
l, r, d = map(int, input().split())
if l-1 <= n:
ans += (int(a[:l-1] + '0'*(n-l+1)) % MOD)
ans += (int(str(d)*(r-l+1) + '0'*(n-r)) % MOD)
if r < n:
ans += (int(a[r:]) % MOD)
ans %= MOD
prin... | Traceback (most recent call last):
File "/tmp/tmp986903rj/tmp4nmctfhf.py", line 1, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s001707340 | p02538 | u321605735 | 1601171821 | Python | Python (3.8.2) | py | Runtime Error | 419 | 68032 | 231 | r=input().split()
N=int(r[0])
Q=int(r[1])
data="1"*N
d=[input().split() for i in range(Q)]
for i in range(Q):
data=data[0:int(d[i][0])-1]+d[i][2]*(int(d[i][1])-int(d[i][0]+1))+data[int(d[i][1]):N]
print(int(data)%998244353) | Traceback (most recent call last):
File "/tmp/tmpunrcwd8b/tmpumjz1vb9.py", line 1, in <module>
r=input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s279848324 | p02538 | u510749912 | 1601171802 | Python | Python (3.8.2) | py | Runtime Error | 2175 | 138672 | 176 | n, q = map(int,input().split())
s = '1' * n
for _ in range(q):
l, r, d = map(int,input().split())
tmp = str(d) * (r - l + 1)
s = s[:l-1] + tmp + s[r:]
print(s) | Traceback (most recent call last):
File "/tmp/tmpwlq6z6xh/tmp51c70txe.py", line 1, in <module>
n, q = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s799843993 | p02538 | u250026974 | 1601171235 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 9812 | 192 | N, Q = map(int, input().split(" "))
S = "1"*N
for i in range(N):
L, R, D = input().split(" ")
L = int(L)
R = int(R)
S = S[0:L-1]+D*(R-L+1)+S[R:]
print(int(S) % 998244353) | Traceback (most recent call last):
File "/tmp/tmp90s2fzhq/tmpn3fy_ekh.py", line 1, in <module>
N, Q = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s233248330 | p02538 | u035603241 | 1601169578 | Python | PyPy3 (7.3.0) | py | Runtime Error | 161 | 78524 | 4848 | # ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode... | Traceback (most recent call last):
File "/tmp/tmpk9zgwbsa/tmpsapw74dl.py", line 163, in <module>
n, k = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s272646775 | p02539 | u368780724 | 1601332752 | Python | PyPy3 (7.3.0) | py | Runtime Error | 1906 | 379008 | 4744 | import sys
readline = sys.stdin.readline
from collections import Counter
from heapq import heappop as hpp, heappush as hp
MOD = 998244353
def frac(limit):
frac = [1]*limit
for i in range(2,limit):
frac[i] = i * frac[i-1]%MOD
fraci = [None]*limit
fraci[-1] = pow(frac[-1], MOD -2, MOD)
for i... | Traceback (most recent call last):
File "/tmp/tmpiufjiw44/tmpcha4_4dv.py", line 144, in <module>
N = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s008806878 | p02539 | u368780724 | 1601322663 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 79320 | 2659 | import sys
readline = sys.stdin.readline
from collections import Counter, deque
def frac(limit):
frac = [1]*limit
for i in range(2,limit):
frac[i] = i * frac[i-1]%MOD
fraci = [None]*limit
fraci[-1] = pow(frac[-1], MOD -2, MOD)
for i in range(-2, -limit-1, -1):
fraci[i] = fraci[i+1]... | Traceback (most recent call last):
File "/tmp/tmppipq1lat/tmpjtyf1an_.py", line 15, in <module>
frac, fraci = frac(1341398)
^^^^^^^^^^^^^
File "/tmp/tmppipq1lat/tmpjtyf1an_.py", line 9, in frac
frac[i] = i * frac[i-1]%MOD
^^^
NameError: name 'MOD' is not defined... | |
s762868057 | p02539 | u368780724 | 1601321508 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2216 | 263728 | 4360 | import sys
readline = sys.stdin.readline
from collections import Counter
from heapq import heappop as hpp, heappush as hp
MOD = 998244353
def frac(limit):
frac = [1]*limit
for i in range(2,limit):
frac[i] = i * frac[i-1]%MOD
fraci = [None]*limit
fraci[-1] = pow(frac[-1], MOD -2, MOD)
for i... | Traceback (most recent call last):
File "/tmp/tmp4mne_b8r/tmpqlkjkspg.py", line 130, in <module>
N = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s688089460 | p02539 | u493130708 | 1601275586 | Python | Python (3.8.2) | py | Runtime Error | 517 | 104180 | 3752 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import defaultdict
from collections import deque
import heapq
from scipy import fft
import numba
from numba import njit, b1, i4, i8, f8
MOD = 998244353
def DD(arg): return defaultdict(arg)
def inv(n): return pow(n, MOD-2, MOD)
ka... | Traceback (most recent call last):
File "/tmp/tmpkn9zqduq/tmp0kqlh378.py", line 34, in <module>
@njit((i8, i8), cache=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/sandbox-runtime/lib/python3.11/site-packages/numba/core/decorators.py", line 241, in wrapper
disp.compile(sig)
File "/root... | |
s122161131 | p02539 | u493130708 | 1601275549 | Python | Python (3.8.2) | py | Runtime Error | 138 | 31136 | 3700 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import defaultdict
from collections import deque
import heapq
from scipy import fft
MOD = 998244353
def DD(arg): return defaultdict(arg)
def inv(n): return pow(n, MOD-2, MOD)
kaijo_memo = []
def kaijo(n):
if(len(kaijo_memo) > n... | Traceback (most recent call last):
File "/tmp/tmpwrhu_6rn/tmpcd4duash.py", line 32, in <module>
@njit((i8, i8), cache=True)
^^^^
NameError: name 'njit' is not defined
| |
s764902354 | p02539 | u493130708 | 1601275517 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 68612 | 3700 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import defaultdict
from collections import deque
import heapq
from scipy import fft
MOD = 998244353
def DD(arg): return defaultdict(arg)
def inv(n): return pow(n, MOD-2, MOD)
kaijo_memo = []
def kaijo(n):
if(len(kaijo_memo) > n... | Traceback (most recent call last):
File "/tmp/tmp4f44guly/tmpi82v8t7z.py", line 32, in <module>
@njit((i8, i8), cache=True)
^^^^
NameError: name 'njit' is not defined
| |
s783976125 | p02539 | u520276780 | 1601260851 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 68740 | 923 |
## https://atcoder.jp/contests/abc170/submissions/14416787
class SegmentTree():
def __init__(self,n,init):
self.offset=2**((n-1).bit_length())
self.tree=[init]*(2*self.offset)
self.init=init
def update(self,pos,val):
pos+=self.offset
self.tree[pos]=val
while pos>... | Traceback (most recent call last):
File "/tmp/tmpixffj5ac/tmp6_2tkry6.py", line 27, in <module>
n,k=map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s036385744 | p02539 | u520276780 | 1601260801 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 68660 | 963 |
## https://atcoder.jp/contests/abc170/submissions/14416787
class SegmentTree():
def __init__(self,n,init):
self.offset=2**((n-1).bit_length())
self.tree=[init]*(2*self.offset)
self.init=init
def update(self,pos,val):
pos+=self.offset
self.tree[pos]=val
while pos>... | Traceback (most recent call last):
File "/tmp/tmpx48lpub_/tmpdoh3d9mv.py", line 27, in <module>
n,k=map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s006421972 | p02539 | u440566786 | 1601232742 | Python | PyPy3 (7.3.0) | py | Runtime Error | 935 | 140624 | 3053 | import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
class NTT(object):
def __init__(self, prime, root):
self._prime = prime
self._root = root
def _fmt(self, A, inverse = False):
N = len(A)
logN = (N... | Traceback (most recent call last):
File "/tmp/tmpudzc8tv2/tmp4lop8z3g.py", line 101, in <module>
resolve()
File "/tmp/tmpudzc8tv2/tmp4lop8z3g.py", line 65, in resolve
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s678942707 | p02539 | u119148115 | 1601189383 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2214 | 256456 | 2524 | import sys
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
# 998244353 = 119*2**23+1
mod = 998244353
primitive_root = 3 # mod の原始根
roots = [pow(primitive_root,(mod-1) >> i,mod) for i in range(24)]
inv_roots = [pow(r,mod-2,mod) for r in roots]
# roots[i] = 1 の 2**i 乗根、inv_roots[i] = 1... | Traceback (most recent call last):
File "/tmp/tmpga09bbjr/tmp_3xi1y2y.py", line 61, in <module>
N = I()
^^^
File "/tmp/tmpga09bbjr/tmp_3xi1y2y.py", line 3, in I
def I(): return int(sys.stdin.readline().rstrip())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for i... | |
s200338438 | p02539 | u119148115 | 1601188789 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2213 | 261688 | 2516 |
# 998244353 = 119*2**23+1
mod = 998244353
primitive_root = 3 # mod の原始根
roots = [pow(primitive_root,(mod-1) >> i,mod) for i in range(24)]
inv_roots = [pow(r,mod-2,mod) for r in roots]
# roots[i] = 1 の 2**i 乗根、inv_roots[i] = 1 の 2**i 乗根の逆元
# 順番は変わる
def ntt(A,n):
for i in range(n):
m = 1 << (n-i-1)
... | Traceback (most recent call last):
File "/tmp/tmp3781ydps/tmpxhpigtw5.py", line 62, in <module>
N = I()
^^^
File "/tmp/tmp3781ydps/tmpxhpigtw5.py", line 59, in I
def I(): return int(sys.stdin.readline().rstrip())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for ... | |
s020369351 | p02539 | u119148115 | 1601188670 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2213 | 262204 | 2515 |
# 998244353 = 119*2**23+1
mod = 998244353
primitive_root = 3 # mod の原始根
roots = [pow(primitive_root,(mod-1) >> i,mod) for i in range(24)]
inv_roots = [pow(r,mod-2,mod) for r in roots]
# roots[i] = 1 の 2**i 乗根、inv_roots[i] = 1 の 2**i 乗根の逆元
# 順番は変わる
def ntt(A,n):
for i in range(n):
m = 1 << (n-i-1)
... | Traceback (most recent call last):
File "/tmp/tmp1l6kuqva/tmpf9b8rb1r.py", line 62, in <module>
N = I()
^^^
File "/tmp/tmp1l6kuqva/tmpf9b8rb1r.py", line 59, in I
def I(): return int(sys.stdin.readline().rstrip())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for ... | |
s278488984 | p02539 | u340781749 | 1601183058 | Python | Python (3.8.2) | py | Runtime Error | 249 | 41128 | 6568 | import os
import sys
from heapq import heappop, heappush
import numpy as np
# https://github.com/atcoder/ac-library/blob/master/atcoder/convolution.hpp
def solve(inp):
def ceil_pow2(n):
x = 0
while 1 << x < n:
x += 1
return x
def bit_scan_forward(n):
x = 0
... | Traceback (most recent call last):
File "/tmp/tmpj8vxkfnt/tmpb7mn0qp9.py", line 234, in <module>
from my_module import solve
ModuleNotFoundError: No module named 'my_module'
| |
s064318515 | p02539 | u119148115 | 1601180350 | Python | PyPy3 (7.3.0) | py | Runtime Error | 371 | 97196 | 2054 |
# 998244353 = 119*2**23+1
mod = 998244353
primitive_root = 3 # mod の原始根
roots = [pow(primitive_root,(mod-1) >> i,mod) for i in range(24)]
inv_roots = [pow(r,mod-2,mod) for r in roots]
# roots[i] = 1 の 2**i 乗根、inv_roots[i] = 1 の 2**i 乗根の逆元
# 順番は変わる
def ntt(A,n):
for i in range(n):
m = 1 << (n-i-1)
... | Traceback (most recent call last):
File "/tmp/tmpdqmjxvof/tmp2pu6272k.py", line 62, in <module>
N = I()
^^^
File "/tmp/tmpdqmjxvof/tmp2pu6272k.py", line 59, in I
def I(): return int(sys.stdin.readline().rstrip())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for ... | |
s813839615 | p02539 | u119148115 | 1601180253 | Python | PyPy3 (7.3.0) | py | Runtime Error | 360 | 97156 | 2049 |
# 998244353 = 119*2**23+1
mod = 998244353
primitive_root = 3 # mod の原始根
roots = [pow(primitive_root,(mod-1) >> i,mod) for i in range(24)]
inv_roots = [pow(r,mod-2,mod) for r in roots]
# roots[i] = 1 の 2**i 乗根、inv_roots[i] = 1 の 2**i 乗根の逆元
# 順番は変わる
def ntt(A,n):
for i in range(n):
m = 1 << (n-i-1)
... | Traceback (most recent call last):
File "/tmp/tmp1ozjegm8/tmptbg6fdhx.py", line 62, in <module>
N = I()
^^^
File "/tmp/tmp1ozjegm8/tmptbg6fdhx.py", line 59, in I
def I(): return int(sys.stdin.readline().rstrip())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for ... | |
s730203414 | p02539 | u034128150 | 1601177661 | Python | Python (3.8.2) | py | Runtime Error | 420 | 66592 | 1463 | import numpy as np
from collections import Counter
from heapq import *
import sys
input = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
def convolve(a, b):
l = len(a) + len(b)
return np.round(np.real(np.fft.irfft(np.fft.rfft(a, l) * np.fft.rfft(b, l), l))).astype(np.int64)
class Arr:
def __ini... | Traceback (most recent call last):
File "/tmp/tmp6861k4p9/tmpgj50vuj9.py", line 24, in <module>
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b''
| |
s390976010 | p02539 | u875291233 | 1601173048 | Python | PyPy3 (7.3.0) | py | Runtime Error | 402 | 104512 | 3112 | ROOT = 3
MOD = 998244353
roots = [pow(ROOT,(MOD-1)>>i,MOD) for i in range(24)] # 1 の 2^i 乗根
iroots = [pow(x,MOD-2,MOD) for x in roots] # 1 の 2^i 乗根の逆元
def untt(a,n):
for i in range(n):
m = 1<<(n-i-1)
for s in range(1<<i):
w_N = 1
s *= m*2
for p in range(m):
... | Traceback (most recent call last):
File "/tmp/tmphfk43q_a/tmp98vwme3d.py", line 102, in <module>
n,*h = map(int, read().split())
^^^^
ValueError: not enough values to unpack (expected at least 1, got 0)
| |
s833086925 | p02539 | u707124227 | 1601172385 | Python | PyPy3 (7.3.0) | py | Runtime Error | 146 | 68620 | 336 | mod=998244353
n,q=map(int,input().split())
lrd=[list(map(int,input().split())) for _ in range(q)]
s=0
ss=[]
tmp=1
for i in range(n):
ss.append(tmp)
s+=tmp
s%=mod
tmp*=10
tmp%=mod
ss.reverse()
#print(ss,s)
for l,r,d in lrd:
for i in range(l-1,r):
s-=ss[i]
ss[i]=d*pow(10,n-i-1,mod)
s+=ss[i]
s%... | Traceback (most recent call last):
File "/tmp/tmp3kuw761_/tmpxi6pb1xg.py", line 2, in <module>
n,q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s602737185 | p02540 | u295361373 | 1600699885 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2208 | 103200 | 1650 | '''
Auther: ghoshashis545 Ashis Ghosh
College: jalpaiguri Govt Enggineering College
'''
from os import path
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd
from bisect import bisect,bisect_left,bisect_right,insort,insort_lef... | Traceback (most recent call last):
File "/tmp/tmpkbjypzz_/tmp5hew0w1u.py", line 90, in <module>
solve()
File "/tmp/tmpkbjypzz_/tmp5hew0w1u.py", line 37, in solve
n = ii()
^^^^
File "/tmp/tmpkbjypzz_/tmp5hew0w1u.py", line 15, in ii
def ii():return int(input())
^^^^^^^^^^^^
V... | |
s805366781 | p02540 | u237939506 | 1600674988 | Python | Python (3.8.2) | py | Runtime Error | 99 | 10032 | 496 | a = []
b = []
number = []
hello = input()
for i in range(0,int(hello)):
temp = input()
temp.split(' ')
a.append(int(temp[0]))
b.append(int(temp[1]))
number.append(1)
for i in range(0, int(hello)):
for j in range(0, int(hello)):
if i != j:
if a[i]>a[j] and b[i]>b[j]:
... | Traceback (most recent call last):
File "/tmp/tmp_sc0c9wn/tmpksdtt6qv.py", line 6, in <module>
hello = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s760125756 | p02540 | u368796742 | 1600662842 | Python | PyPy3 (7.3.0) | py | Runtime Error | 203 | 144012 | 1039 | import sys
input = sys.stdin.readline
class Unionfind:
def __init__(self,n):
self.uf = [-1]*n
def find(self,x):
if self.uf[x] < 0:
return x
else:
self.uf[x] = self.find(self.uf[x])
return self.uf[x]
def same(self,x,y):
return sel... | Traceback (most recent call last):
File "/tmp/tmp6rrggis4/tmpatuq1rf8.py", line 35, in <module>
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s517147438 | p02540 | u678167152 | 1600659998 | Python | PyPy3 (7.3.0) | py | Runtime Error | 751 | 121228 | 1601 | class UnionFind():
def __init__(self, n):
self.n = n
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
x = self.find(x)
y = self.find(y)
if x ==... | Traceback (most recent call last):
File "/tmp/tmprepwqqfr/tmp_2_s59nq.py", line 48, in <module>
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s008386114 | p02540 | u678167152 | 1600659959 | Python | PyPy3 (7.3.0) | py | Runtime Error | 720 | 123804 | 1707 | class UnionFind():
def __init__(self, n):
self.n = n
self.parents = [-1] * n
self.min_y = [N]*n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
x = self.find(x)
y = se... | Traceback (most recent call last):
File "/tmp/tmpnh_950ee/tmpkvlho05b.py", line 50, in <module>
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s997807193 | p02540 | u875291233 | 1600645548 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2383 | 243924 | 1496 | class UnionFind:
def __init__(self, n):
self.parent = list(range(n)) #親ノード
self.size = [1]*n #グループの要素数
def root(self, x): #root(x): xの根ノードを返す.
while self.parent[x] != x:
self.parent[x] = self.parent[self.parent[x]]
x = self.parent[x]
return x
def ... | Traceback (most recent call last):
File "/tmp/tmpont1yyh8/tmpfggidel7.py", line 33, in <module>
n = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s043740555 | p02540 | u015019251 | 1600638928 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 38232 | 910 | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 15 17:00:46 2020
@author: saito
"""
# %% import phase
# %% define phase
def root(x):
if par[x] == x:
return x
else:
par[x] = root(par[x])
return par[x]
def same(x, y):
return root(x) == root(y)
def unite(x, y):
x = root(x)
y... | Traceback (most recent call last):
File "/tmp/tmpzf89b9x_/tmpbjreo5y1.py", line 31, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s900666544 | p02540 | u475402977 | 1600638901 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 35256 | 858 | N=int(input())
X=[0]
Y=[0]
par = [i for i in range(N+1)] #親=グループ
size = [1 for _ in range(N+1)] #そのグループに属する要素数
def find(x): #親=グループを出力
if par[x] == x:
return x
else:
par[x] = find(par[x]) #経路圧縮
return par[x]
def same(x,y): #True or False
return find(x) == find(y)
def unite(x,y): #2... | Traceback (most recent call last):
File "/tmp/tmp0q9uq6zl/tmpkfmprggi.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s512835949 | p02540 | u015019251 | 1600638784 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 61624 | 893 | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 15 17:00:46 2020
@author: saito
"""
# %% import phase
# %% define phase
def root(x):
if par[x] == x:
return x
else:
par[x] = root(par[x])
return par[x]
def same(x, y):
return root(x) == root(y)
def unite(x, y):
x = root(x)
y... | Traceback (most recent call last):
File "/tmp/tmp6if7zw0k/tmpic43yd_v.py", line 31, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s964690643 | p02540 | u711539583 | 1600637457 | Python | PyPy3 (7.3.0) | py | Runtime Error | 322 | 98544 | 954 | import sys
import heapq
input = sys.stdin.readline
class UnionFind():
def __init__(self, n):
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
de... | Traceback (most recent call last):
File "/tmp/tmpkb8xt3id/tmp7a7sebv0.py", line 29, in <module>
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s314054229 | p02540 | u481099232 | 1600637426 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9004 | 417 | #include <bits/stdc++.h>
using namespace std;
int main(){
long long N;
cin >> N;
long long x[N],y[N];
vector<int> cnt(N,1);
for(int i = 0; i < N; i++) cin >> x[i] >> y[i];
for(int i = 0; i < N; i++) for(int j = i+1; j < N; j++){
if((x[i] <= x[j] && y[i] <= y[j]) || (x[i] >= x[j] && y[i] >= y[j])){
... | File "/tmp/tmpqyxxdize/tmpflf359s5.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s662938649 | p02540 | u711539583 | 1600637391 | Python | PyPy3 (7.3.0) | py | Runtime Error | 221 | 98488 | 932 | import sys
import heapq
input = sys.stdin.readline
class UnionFind():
def __init__(self, n):
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
de... | Traceback (most recent call last):
File "/tmp/tmpvbaakgaa/tmpzarsldbj.py", line 29, in <module>
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s824116917 | p02540 | u137226361 | 1600637374 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 49448 | 689 | n = int(input())
ls= []
par = [i for i in range(n)]
size = [1] * n
def find(x):
if par[x] == x:
return x
else:
a = find(par[x])
par[x] = a
return a
def unite(x, y):
x = find(x)
y = find(y)
sx = size[x]
sb= size[y]
if x!= y:
if sx >= sb:
... | Traceback (most recent call last):
File "/tmp/tmph94zg2hi/tmpxb9m7jd3.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s825366328 | p02540 | u711539583 | 1600637357 | Python | PyPy3 (7.3.0) | py | Runtime Error | 203 | 98660 | 930 | import sys
import heapq
input = sys.stdin.readline
class UnionFind():
def __init__(self, n):
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
de... | Traceback (most recent call last):
File "/tmp/tmpgqt66339/tmpox_1z2__.py", line 29, in <module>
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s042017879 | p02540 | u959682393 | 1600637336 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9316 | 1955 | N = int(input())
city=[]
x = []
y = []
for i in range(N):
a,b = map(int,input().split())
city.append((a,b))
x.append(a)
y.append(b)
dx.append(a)
dy.append(b)
x.sort()
y.sort()
for xi,yi in city:
cnt = 0
x_i = x.index(xi)
y_i = y.index(yi)
# print("index:",x[x_i],y[y_i])
... | Traceback (most recent call last):
File "/tmp/tmp05e7a8wj/tmpcfcoebex.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s967365760 | p02540 | u112629957 | 1600637331 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9128 | 8 | print(a) | Traceback (most recent call last):
File "/tmp/tmprpqizr2w/tmpnt0ityde.py", line 1, in <module>
print(a)
^
NameError: name 'a' is not defined
| |
s499460785 | p02540 | u504856568 | 1600637276 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8976 | 477 | a_list=[]
b_list=[]
cnt_list=[]
n = int(input())
# リスト作成
for i in range(n):
e, f = map(int, input().split())
a_list.append(e)
b_list.append(f)
for i in range(n):
cnt = 0
for m in range(n):
if n == m:
continue
if (a_list[i] > a_list[m] and b_list[i] > b_list[m]) or (a_lis... | File "/tmp/tmpiefw8e8j/tmp54p1ha4f.py", line 16
cnt = cnt + 1
^
IndentationError: expected an indented block after 'if' statement on line 15
| |
s019952988 | p02540 | u137226361 | 1600637266 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 176312 | 723 | n = int(input())
ls= []
par = [i for i in range(n)]
size = [1] * n
import sys
sys.setrecursionlimit(n)
def find(x):
if par[x] == x:
return x
else:
a = find(par[x])
par[x] = a
return a
def unite(x, y):
x = find(x)
y = find(y)
sx = size[x]
sb= size[y]
if x!= ... | Traceback (most recent call last):
File "/tmp/tmp0frc52pt/tmpjv9rvp5w.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s260409400 | p02540 | u504856568 | 1600637198 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9044 | 479 | a_list=[]
b_list=[]
cnt_list=[]
n = int(input())
# リスト作成
for i in range(n):
e, f = map(int, input().split())
a_list.append(e)
b_list.append(f)
for i in range(n):
cnt = 0
for m in range(n):
if n == m:
continue
if (a_list[i]) > a_list[m] and b_list[i] > b_list[m]) or (a_li... | File "/tmp/tmpm7io3gyy/tmpm92b7cvx.py", line 15
if (a_list[i]) > a_list[m] and b_list[i] > b_list[m]) or (a_list[i]) < a_list[m] and b_list[i] < b_list[m]):
^
SyntaxError: unmatched ')'
| |
s281687830 | p02540 | u141610915 | 1600636538 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2209 | 133928 | 2266 | import sys
input = sys.stdin.readline
N = int(input())
a = [tuple(map(int, input().split())) for _ in range(N)]
class UnionFind():
def __init__(self, n):
self.n = n
self.root = [-1] * (n + 1)
self.rnk = [0] * (n + 1)
def Find_Root(self, x):
if self.root[x] < 0:
return x
else:
self.... | Traceback (most recent call last):
File "/tmp/tmpupsam8ms/tmpgh5nq77l.py", line 3, in <module>
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s777170882 | p02540 | u695921487 | 1600636509 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9004 | 2678 | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#define eps 1e-8
#define zero(x) (((x)>0?(x):-(x))<eps)
#define pause cout << " press ansy key to continue...", cin >> chh
#define file_r(x) ... | File "/tmp/tmpwf60g01f/tmpzvaksh0v.py", line 49
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s974882935 | p02540 | u274811210 | 1600635427 | Python | PyPy3 (7.3.0) | py | Runtime Error | 1463 | 159320 | 3171 |
class SegTree: # モノイドに対して適用可能、Nが2冪でなくても良い
def __init__(self ,N ,seg_func ,unit):
self.N = 1 << ( N -1).bit_length()
self.func = seg_func
self.unit = unit
self.tree = [self.unit ] *( 2 *self.N)
def build(self ,init_value): # 初期値を[N,2N)に格納
for i in range(len(init_value)... | Traceback (most recent call last):
File "/tmp/tmp2w2e_73q/tmpyilwmb1n.py", line 87, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s636770891 | p02540 | u137226361 | 1600635398 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 176068 | 770 | n = int(input())
ls= []
par = [i for i in range(n)]
size = [1] * n
import sys
sys.setrecursionlimit(n)
def find(x):
if par[x] == x:
return x
else:
a = find(par[x])
par[x] = a
return a
def unite(x, y):
x = find(x)
y = find(y)
sx = size[x]
sb= size[y]
if x!= ... | Traceback (most recent call last):
File "/tmp/tmp1_9owfkg/tmpp_hdu7we.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s988197166 | p02540 | u137226361 | 1600635139 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 49536 | 734 | n = int(input())
ls= []
par = [i for i in range(n)]
size = [1] * n
def find(x):
if par[x] == x:
return x
else:
a = find(par[x])
par[x] = a
return a
def unite(x, y):
x = find(x)
y = find(y)
sx = size[x]
sb= size[y]
if x!= y:
if sx >= sb:
... | Traceback (most recent call last):
File "/tmp/tmpt_1thik3/tmp9ee73lf5.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s518781782 | p02540 | u137226361 | 1600634983 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 49528 | 724 | n = int(input())
ls= []
par = [i for i in range(n)]
size = [1] * n
def find(x):
if par[x] == x:
return x
else:
a = find(par[x])
par[x] = a
return a
def unite(x, y):
x = find(x)
y = find(y)
a = size[x]
b= size[y]
if x!= y:
if a >= b:
par[... | Traceback (most recent call last):
File "/tmp/tmpudolpldz/tmp5me9bcc0.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s182759563 | p02540 | u137226361 | 1600634835 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 49524 | 687 | n = int(input())
ls= []
par = [i for i in range(n)]
size = [1] * n
def find(x):
if par[x] == x:
return x
else:
a = find(par[x])
par[x] = a
return a
def unite(x, y):
x = find(x)
y = find(y)
a = size[x]
b= size[y]
if a >= b:
par[x] = y
size[y... | Traceback (most recent call last):
File "/tmp/tmp7qk1m8_f/tmp7hpdsxb6.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.