s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
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: ...
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...
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...
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...
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...
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: ...
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() ...
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() ...
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....
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_...
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) ...
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: ...
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: ...
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)
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)
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: ...
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...
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...
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]...
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...
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)
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...
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 _...
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...
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-...
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)
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: ...
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)
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)
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)
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...
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) """ ...
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-...
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)
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)
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] ...
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] ...
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)
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)
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)
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)
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)
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))
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)
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)
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)
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 ...
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(...
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)
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)
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...
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...
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)
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)
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)
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...
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...
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]...
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...
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...
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...
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...
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>...
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>...
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...
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...
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) ...
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) ...
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 ...
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) ...
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) ...
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...
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): ...
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%...
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...
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]: ...
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...
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 ==...
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...
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 ...
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...
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...
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...
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...
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])){ ...
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...
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: ...
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...
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]) ...
s967365760
p02540
u112629957
1600637331
Python
Python (3.8.2)
py
Runtime Error
29
9128
8
print(a)
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...
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!= ...
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...
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....
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) ...
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)...
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!= ...
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: ...
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[...
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...