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
s578175401
p02537
u602740328
1601267812
Python
Python (3.8.2)
py
Runtime Error
2206
23592
938
class SegTree(object): def __init__(self,op,e,n,init_val): self.num = 1<<(n-1).bit_length() self.S = [e]*self.num*2 self.op = op self.e = e for i,v in enumerate(init_val): self.S[self.num+i] = v for i in range(self.num-1,0,-1): self.S[i] = self.op(self.S[i*2], self.S[i*2+1]) de...
Traceback (most recent call last): File "/tmp/tmpbugxv2d9/tmpg0h52or4.py", line 32, in <module> N,K = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s640597153
p02537
u602740328
1601267360
Python
PyPy3 (7.3.0)
py
Runtime Error
788
82644
929
class SegTree(object): def __init__(self,op,e,n,init_val): self.num = 1<<(300000-1).bit_length() self.S = [e]*self.num*2 self.op = op self.e = e for i,v in enumerate(init_val): self.S[self.num+i] = v for i in range(self.num-1,0,-1): self.S[i] = self.op(self.S[i*2], self.S[i*2+1]) def ...
Traceback (most recent call last): File "/tmp/tmpuwro832f/tmppeytqlwa.py", line 30, in <module> N,K = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s267781979
p02537
u602740328
1601267298
Python
PyPy3 (7.3.0)
py
Runtime Error
718
82588
927
class SegTree(object): def __init__(self,op,e,n,init_val): self.num = 1<<(300000-1).bit_length() self.S = [e]*self.num*2 self.op = op self.e = e for i,v in enumerate(init_val): self.S[self.num+i] = v for i in range(self.num-1,0,-1): self.S[i] = self.op(self.S[i*2], self.S[i*2+1]) def ...
Traceback (most recent call last): File "/tmp/tmp6xlqw316/tmpj7jv2h_i.py", line 30, in <module> N,K = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s364765408
p02537
u692657167
1601262696
Python
PyPy3 (7.3.0)
py
Runtime Error
170
109488
222
n, k, *al = map(int, open(0).read().split()) d = [0] * 300000 for a in al: l = max(0, a-k) r = min(a+k, 300000) m = 0 for i in range(l, r+1): m = max(m, d[i]) d[a] = max(d[a], m+1) print(max(d))
Traceback (most recent call last): File "/tmp/tmpicd8omj3/tmpuzobbmuy.py", line 1, in <module> n, k, *al = map(int, open(0).read().split()) ^^^^^^^^^ ValueError: not enough values to unpack (expected at least 2, got 0)
s607297081
p02537
u520276780
1601260084
Python
PyPy3 (7.3.0)
py
Runtime Error
170
83532
960
## https://atcoder.jp/contests/abc170/submissions/14416787 import sys input=sys.stdin.readline 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 ...
Traceback (most recent call last): File "/tmp/tmpi9ta9h_n/tmp6u285wow.py", line 31, in <module> n,k=map(int,input().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s595124777
p02537
u520276780
1601260044
Python
PyPy3 (7.3.0)
py
Runtime Error
483
110308
951
## https://atcoder.jp/contests/abc170/submissions/14416787 import sys input=sys.stdin.readline 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 ...
Traceback (most recent call last): File "/tmp/tmp0eqo89tc/tmpiyt9rki9.py", line 30, in <module> n,k=map(int,input().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s879811580
p02537
u520276780
1601259910
Python
PyPy3 (7.3.0)
py
Runtime Error
465
110984
964
## https://atcoder.jp/contests/abc170/submissions/14416787 import heapq import sys input=sys.stdin.readline 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.of...
Traceback (most recent call last): File "/tmp/tmp3x5qy6hx/tmpskcxxpi3.py", line 31, in <module> n,k=map(int,input().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s321934481
p02537
u647999897
1601259409
Python
PyPy3 (7.3.0)
py
Runtime Error
2668
3531800
609
def solve(): N,K = map(int,input().split()) A = [int(input()) for _ in range(N)] A_max = max(A) dp = [[0] * (A_max+1) for _ in range(N)] dp[0][A[0]] = 1 for i in range(1,N): for j in range(A_max+1): dp[i][j] = dp[i-1][j] mx = 0 if j == A[i]: ...
Traceback (most recent call last): File "/tmp/tmpm4__8vtn/tmprq3ni3_6.py", line 26, in <module> solve() File "/tmp/tmpm4__8vtn/tmprq3ni3_6.py", line 2, in solve N,K = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s046484934
p02537
u758815106
1601245747
Python
PyPy3 (7.3.0)
py
Runtime Error
350
92664
2385
#!/usr/bin/env python3 class SegTree: def __init__(self, segfunc, e, v, init_val = None): """ segfunc: function 区間にしたい操作\n e: Any 単位元\n v: int or List 要素数か格納する配列\n init_val: Any 初期値 """ self.segfunc = segfunc self.e = e self.init_val = init_val...
Traceback (most recent call last): File "/tmp/tmpwnfg8las/tmppyuaspq5.py", line 80, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s053241857
p02537
u758815106
1601245541
Python
PyPy3 (7.3.0)
py
Runtime Error
351
92552
2363
#!/usr/bin/env python3 class SegTree: def __init__(self, segfunc, e, v, init_val = None): """ segfunc: function 区間にしたい操作\n e: Any 単位元\n v: int or List 要素数か格納する配列\n init_val: Any 初期値 """ self.segfunc = segfunc self.e = e self.init_val = init_val...
Traceback (most recent call last): File "/tmp/tmp5kjbncjd/tmp0baj268p.py", line 80, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s397892105
p02537
u805332733
1601236176
Python
PyPy3 (7.3.0)
py
Runtime Error
92
68704
2005
#####segfunc##### def segfunc(x, y): return max(x, y) ################# #####ide_ele##### ide_ele = 0 ################# class SegTree: """ init(init_val, ide_ele): 配列init_valで初期化 O(N) update(k, x): k番目の値をxに更新 O(logN) query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN) """ def __init__(self, init_val, segfunc, ...
Traceback (most recent call last): File "/tmp/tmptwxa5_u8/tmpfriwl5_e.py", line 84, in <module> resolve() File "/tmp/tmptwxa5_u8/tmpfriwl5_e.py", line 70, in resolve N, K = map(int, input().split(" ")) ^^^^^^^ EOFError: EOF when reading a line
s957864071
p02537
u545368057
1601233087
Python
PyPy3 (7.3.0)
py
Runtime Error
130
88204
1416
# セグメント木 # segment tree import sys input = sys.stdin.readline class segmented_tree: X_unit = 0 X_f = lambda self, a, b: max(a,b) def __init__(self, N): self.N = N self.X = [self.X_unit] * (2*N) def build(self, seq): for i, x in enumerate(seq, self.N): self.X...
Traceback (most recent call last): File "/tmp/tmpjirji4st/tmpg_7oub06.py", line 46, in <module> n,k = map(int, input().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s654206768
p02537
u820729059
1601232915
Python
PyPy3 (7.3.0)
py
Runtime Error
89
68648
168
n, k = input().split() k = int(k) + 1 m = 0 f = int(input()) n = int(n) - 1; for i in range(n): s = int(input()) if abs(f-s) < k: m += 1 f = s print(m)
File "/tmp/tmp9nk4en_a/tmpt1cq4txz.py", line 8 if abs(f-s) < k: ^ IndentationError: unindent does not match any outer indentation level
s071766390
p02537
u820729059
1601232766
Python
PyPy3 (7.3.0)
py
Runtime Error
82
68728
167
n, k = input().split() k = int(k) + 1 m = 0 f = int(input()) n = int(n) + 1; for i in range(n): s = int(input()) if abs(f-s) < k: m += 1 f = s print(m)
File "/tmp/tmpijxi8px6/tmpg8yzz9zm.py", line 8 if abs(f-s) < k: ^ IndentationError: unindent does not match any outer indentation level
s895975043
p02537
u820729059
1601232711
Python
PyPy3 (7.3.0)
py
Runtime Error
83
68680
158
n, k = input().split() k = int(k) + 1 m = 0 f = int(input()) n = int(n) + 1; for i in range(n): s = int(input()) if abs(f-s) < k: m += 1 f = s
File "/tmp/tmpxebbg_pz/tmpqqx49ii1.py", line 8 if abs(f-s) < k: ^ IndentationError: unindent does not match any outer indentation level
s955542496
p02537
u888337853
1601232415
Python
Python (3.8.2)
py
Runtime Error
2207
36856
5424
import typing import sys # import re import math import collections # import decimal import bisect import itertools import fractions # import functools import copy import heapq import decimal # import statistics import queue # import numpy as np # sys.setrecursionlimit(10000001) INF = 10 ** 16 # MOD = 10 ** 9 + 7 MOD...
Traceback (most recent call last): File "/tmp/tmpkegiol_v/tmpd23e19wa.py", line 188, in <module> main() File "/tmp/tmpkegiol_v/tmpd23e19wa.py", line 173, in main n, k = ns() ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s068071442
p02537
u888337853
1601232406
Python
PyPy3 (7.3.0)
py
Runtime Error
545
116904
5424
import typing import sys # import re import math import collections # import decimal import bisect import itertools import fractions # import functools import copy import heapq import decimal # import statistics import queue # import numpy as np # sys.setrecursionlimit(10000001) INF = 10 ** 16 # MOD = 10 ** 9 + 7 MOD...
Traceback (most recent call last): File "/tmp/tmp_0n4v6x7/tmp6iuwgxcz.py", line 188, in <module> main() File "/tmp/tmp_0n4v6x7/tmp6iuwgxcz.py", line 173, in main n, k = ns() ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s732618529
p02537
u576432509
1601227783
Python
PyPy3 (7.3.0)
py
Runtime Error
694
108732
2513
class SegmentTree(): def __init__(self, n, oper, e): self.n = n self.oper = oper self.e = e self.log = (n - 1).bit_length() self.size = 1 << self.log self.data = [e] * (2 * self.size) def update(self, k): self.data[k] = self.oper(self.data[2 * k], self.data[2 * k + 1]) def build(self...
Traceback (most recent call last): File "/tmp/tmp25my4i60/tmpgvhp0uhm.py", line 93, in <module> n,k=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s718806571
p02537
u576432509
1601227214
Python
PyPy3 (7.3.0)
py
Runtime Error
656
108992
2506
class SegmentTree(): def __init__(self, n, oper, e): self.n = n self.oper = oper self.e = e self.log = (n - 1).bit_length() self.size = 1 << self.log self.data = [e] * (2 * self.size) def update(self, k): self.data[k] = self.oper(self.data[2 * k], self.data[2 * k + 1]) def build(sel...
Traceback (most recent call last): File "/tmp/tmpyg0cwkx1/tmpg30gw0be.py", line 94, in <module> n,k=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s160195327
p02537
u792720861
1601226514
Python
Python (3.8.2)
py
Runtime Error
373
21736
331
N,K = map(int, input().split()) A = [int(input()) for _ in range(N)] ans = 0 def dfs(idx, lastB, length): global ans if idx == N: ans = max(ans, length) return dfs(idx+1, lastB, length) if abs(lastB-A[idx]) <= K: dfs(idx+1, A[idx], length+1) dfs(0, A[0], 1) dfs(0, A[1], 0) pr...
Traceback (most recent call last): File "/tmp/tmpwqqf1l8c/tmpigd4keqw.py", line 1, in <module> N,K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s200716277
p02537
u156815136
1601225619
Python
PyPy3 (7.3.0)
py
Runtime Error
542
137400
2596
#from statistics import median #import collections #aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] from math import gcd from itertools import combinations,permutations,accumulate, product # (string,3) 3回 #from collections import deque from collections import deque,defaultdict,Counter ...
Traceback (most recent call last): File "/tmp/tmp6q3qrpu6/tmpmwpodgvt.py", line 90, in <module> n,k = readInts() ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s628181178
p02537
u156815136
1601225483
Python
PyPy3 (7.3.0)
py
Runtime Error
468
98008
2568
#from statistics import median #import collections #aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] from math import gcd from itertools import combinations,permutations,accumulate, product # (string,3) 3回 #from collections import deque from collections import deque,defaultdict,Counter ...
Traceback (most recent call last): File "/tmp/tmptzs67mo2/tmp5wyk_wby.py", line 90, in <module> n,k = readInts() ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s712142382
p02537
u156815136
1601225269
Python
Python (3.8.2)
py
Runtime Error
2206
33652
2574
#from statistics import median #import collections #aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] from math import gcd from itertools import combinations,permutations,accumulate, product # (string,3) 3回 #from collections import deque from collections import deque,defaultdict,Counter ...
Traceback (most recent call last): File "/tmp/tmpi7nuoykt/tmp38rbppc7.py", line 90, in <module> n,k = readInts() ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s767768933
p02537
u169138653
1601221438
Python
PyPy3 (7.3.0)
py
Runtime Error
994
120560
1521
n,k=map(int,input().split()) class SegmentTree: def __init__(self,n,ele): self.ide_ele = ele self.num =2**(n-1).bit_length() self.seg=[self.ide_ele]*2*self.num #####segfunc###### #クエリに応じて変える def segfunc(self,x,y): return max(x,y) def init(self,init_val): ...
Traceback (most recent call last): File "/tmp/tmp6d8i6f4l/tmp3e23xnbu.py", line 1, in <module> n,k=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s169534466
p02537
u189479417
1601218386
Python
Python (3.8.2)
py
Runtime Error
2206
22592
2117
#####segfunc##### def segfunc(x, y): return max(x, y) ################# #####ide_ele##### ide_ele = 0 ################# class SegTree: """ init(init_val, ide_ele): 配列init_valで初期化 O(N) update(k, x): k番目の値をxに更新 O(logN) query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN) """ def __init__(self, init_...
Traceback (most recent call last): File "/tmp/tmp0plof5iu/tmpg987mlr_.py", line 69, in <module> N, K = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s403508696
p02537
u623819879
1601215181
Python
PyPy3 (7.3.0)
py
Runtime Error
653
147864
7522
import sys,bisect,string,math,time,functools,random,fractions from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter from itertools import permutations,combinations,groupby rep=range;R=range def Golf():n,*t=map(int,open(0).read().split()) def I():return int(input()) def S_():return...
Traceback (most recent call last): File "/tmp/tmplod5c84x/tmpjdjhyyh5.py", line 240, in <module> n,k=LI() ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s321916248
p02537
u358254559
1601213281
Python
PyPy3 (7.3.0)
py
Runtime Error
633
105076
1314
n,k = map(int, input().split()) a=[int(input()) for i in range(n)] ide_ele = 0 def segfunc(x, y): return max(x,y) class SegTree: def __init__(self, init_val, segfunc, ide_ele): n = len(init_val) self.segfunc = segfunc self.ide_ele = ide_ele self.num = 1 << (n - 1).bit_length()...
Traceback (most recent call last): File "/tmp/tmp23y4_6qk/tmp1ji_emri.py", line 1, in <module> n,k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s191819779
p02537
u102655885
1601204506
Python
Python (3.8.2)
py
Runtime Error
433
21644
1246
n, k = map(lambda x: int(x), input().split()) list_a = [] for _ in range(n): list_a.append(int(input())) memo = dict() # i番目以降の要素からなるsublistの長さとして最長のものの長さを返す def sublist_max_length(current_value, i): # if (current_value, i) in memo.keys(): # return memo[(current_value, i)] if i == n-1: ...
Traceback (most recent call last): File "/tmp/tmpdnv_d_wh/tmp17tz5qz9.py", line 1, in <module> n, k = map(lambda x: int(x), input().split()) ^^^^^^^ EOFError: EOF when reading a line
s174051053
p02537
u216928054
1601195343
Python
PyPy3 (7.3.0)
py
Runtime Error
429
87360
4490
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**6) INF = 10 ** 9 + 1 # sys.maxsize # float("inf") MOD = 10 ** 9 + 7 def debug(*x): print(*x, file=sys.stderr) def solve_0_WA(N, K, AS): candidates = [[0]] for i in range(1, N): A = AS[i] new_candidates = [] for c in can...
Traceback (most recent call last): File "/tmp/tmp6je9065t/tmp2j8e1kho.py", line 233, in <module> main() File "/tmp/tmp6je9065t/tmp2j8e1kho.py", line 148, in main N, K = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s752758548
p02537
u729133443
1601191209
Python
PyPy3 (7.3.0)
py
Runtime Error
951
109440
145
n,k,*a=map(int,open(0).read().split()) d=[0]*n i=n while i:i-=1;d[i]=max(d[j]for j in range(i,min(i+99,n))if abs(a[~i]-a[-j])<=k)+1 print(max(d))
Traceback (most recent call last): File "/tmp/tmpysqurj3m/tmp8xy95z9j.py", line 1, in <module> n,k,*a=map(int,open(0).read().split()) ^^^^^^ ValueError: not enough values to unpack (expected at least 2, got 0)
s077310018
p02537
u738898077
1601189970
Python
Python (3.8.2)
py
Runtime Error
2206
18580
1105
class SegTree: X_unit = 0 X_f = max def __init__(self, N): self.N = N self.X = [self.X_unit] * (N + N) def build(self, seq): for i, x in enumerate(seq, self.N): self.X[i] = x for i in range(self.N - 1, 0, -1): self.X[i] = self.X_f(self.X[i << 1...
Traceback (most recent call last): File "/tmp/tmp0migscj1/tmpdla_xmgu.py", line 40, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s207180878
p02537
u738898077
1601189686
Python
Python (3.8.2)
py
Runtime Error
2206
18476
1101
class SegTree: X_unit = 0 X_f = max def __init__(self, N): self.N = N self.X = [self.X_unit] * (N + N) def build(self, seq): for i, x in enumerate(seq, self.N): self.X[i] = x for i in range(self.N - 1, 0, -1): self.X[i] = self.X_f(self.X[i << 1...
Traceback (most recent call last): File "/tmp/tmpewqpn92k/tmp_n5r2h0y.py", line 40, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s358473053
p02537
u197956883
1601189503
Python
PyPy3 (7.3.0)
py
Runtime Error
91
68720
2070
import sys, re from math import ceil, floor, sqrt, pi, factorial, gcd from copy import deepcopy from collections import Counter, deque from heapq import heapify, heappop, heappush from itertools import accumulate, product, combinations, combinations_with_replacement from bisect import bisect, bisect_left, bisect_right ...
File "/tmp/tmp_ovt11w1/tmppon4scf6.py", line 68 l = max(0, a - k) TabError: inconsistent use of tabs and spaces in indentation
s688143024
p02537
u729133443
1601189347
Python
PyPy3 (7.3.0)
py
Runtime Error
1302
275560
142
d=[0]*6**8 n,k,*a=map(int,open(0).read().split()+d) for i in range(n):d[i]=max(d[j]for j in range(i-99,i)if abs(a[i]-a[j])<=k)+1 print(max(d))
0
s273785105
p02537
u729133443
1601189248
Python
PyPy3 (7.3.0)
py
Runtime Error
133
110836
144
d=[0]*6**8 n,k,*a=map(int,open(0).read().split())+d for i in range(n):d[i]=max(d[j]for j in range(i-99,i+1)if abs(a[i]-a[j])<=k)+1 print(max(d))
Traceback (most recent call last): File "/tmp/tmp642s68_b/tmptj2zwwq2.py", line 2, in <module> n,k,*a=map(int,open(0).read().split())+d ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ TypeError: unsupported operand type(s) for +: 'map' and 'list'
s150206248
p02537
u729133443
1601189144
Python
PyPy3 (7.3.0)
py
Runtime Error
1227
109356
139
n,k,*a=map(int,open(0).read().split()) d=[0]*n for i in range(n):d[i]=max(d[j]for j in range(i-99,i+1)if abs(a[i]-a[j])<=k)+1 print(max(d))
Traceback (most recent call last): File "/tmp/tmpvupdygv0/tmp_5ojszrk.py", line 1, in <module> n,k,*a=map(int,open(0).read().split()) ^^^^^^ ValueError: not enough values to unpack (expected at least 2, got 0)
s624719990
p02537
u729133443
1601189115
Python
PyPy3 (7.3.0)
py
Runtime Error
1200
120076
142
n,k,*a=map(int,open(0).read().split()) d=[0]*6**8 for i in range(n):d[i]=max(d[j]for j in range(i-99,i+1)if abs(a[i]-a[j])<=k)+1 print(max(d))
Traceback (most recent call last): File "/tmp/tmpc99ngtxs/tmpwemhcok1.py", line 1, in <module> n,k,*a=map(int,open(0).read().split()) ^^^^^^ ValueError: not enough values to unpack (expected at least 2, got 0)
s412302176
p02537
u729133443
1601188837
Python
PyPy3 (7.3.0)
py
Runtime Error
162
109184
150
n,k,*a=map(int,open(0).read().split()) d=[1]*n for i in range(n):d[i]=max((d[i],d[j]+1)[abs(a[i]-a[j])<=k]for j in range(max(0,i-99),i)) print(max(d))
Traceback (most recent call last): File "/tmp/tmpqonj6k0z/tmp50ykp5cd.py", line 1, in <module> n,k,*a=map(int,open(0).read().split()) ^^^^^^ ValueError: not enough values to unpack (expected at least 2, got 0)
s993878152
p02537
u391725895
1601188634
Python
PyPy3 (7.3.0)
py
Runtime Error
640
142104
963
# Segment Treeを使う。一点更新,区間最大値 N, K = map(int, input().split()) seglen = 1 << 19 segtree = [0 for _ in range(seglen * 2)] # segtree[seglen + i] = Bの最後の値に i を使う時のlongest len def segset(ind, val): segtree[ind] = val ind //= 2 while ind != 0: segtree[ind] = max(segtree[ind*2], segtree[ind*2 + 1]) ...
Traceback (most recent call last): File "/tmp/tmpy9xa8972/tmppwd7zehq.py", line 3, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s205562856
p02537
u729133443
1601188633
Python
PyPy3 (7.3.0)
py
Runtime Error
207
109348
144
n,k,*a=map(int,open(0).read().split()) d=[1]*n for i in range(n):d[i]=max(d[j]for j in range(max(0,i-99),i)if abs(a[i]-a[j])<=k)+1 print(max(d))
Traceback (most recent call last): File "/tmp/tmpvkao_31n/tmp1z6w5frt.py", line 1, in <module> n,k,*a=map(int,open(0).read().split()) ^^^^^^ ValueError: not enough values to unpack (expected at least 2, got 0)
s910660168
p02537
u437351386
1601186151
Python
PyPy3 (7.3.0)
py
Runtime Error
104
94424
935
n,m=map(int,input().split()) #Union-Find木 #par[i]:iの親 deep[i]:iの深さ size[i]:iの大きさ par=[i for i in range(n)] deep=[1]*n size=[1]*n #親を見つける def find(x): if par[x]==x: return x else: return find(par[x]) #二つのグループを統合する def unite(x,y): x=find(x) y=find(y) if x==y: return if deep[x]<deep[y]: par[x...
Traceback (most recent call last): File "/tmp/tmpw006k29d/tmpbkzjycmj.py", line 1, in <module> n,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s865216010
p02537
u602500004
1601184418
Python
PyPy3 (7.3.0)
py
Runtime Error
2211
172488
980
import math import sys import os sys.setrecursionlimit(10**7) def _S(): return sys.stdin.readline().rstrip() def I(): return int(_S()) def LS(): return list(_S().split()) def LI(): return list(map(int,LS())) if os.getenv("LOCAL"): inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]...
Traceback (most recent call last): File "/tmp/tmpvbvoh5z1/tmpn278d9le.py", line 18, in <module> N,K = LI() ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s894124979
p02537
u994521204
1601183313
Python
PyPy3 (7.3.0)
py
Runtime Error
99
73468
995
import sys input = sys.stdin.buffer.readline n, k = map(int, input().split()) max_n = 300000 + 10 keta = max_n.bit_length() num = 1 << (keta - 1) SEG = [0] * (2 * num) func = max ele = 0 def update(idx, val): idx += num SEG[idx] = val for i in reversed(range(1, num)): SEG[i] = func(SEG[2 * i],...
Traceback (most recent call last): File "/tmp/tmpj0dhlb49/tmpfqf1j1lj.py", line 5, in <module> n, k = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s640536341
p02537
u255898796
1601183074
Python
PyPy3 (7.3.0)
py
Runtime Error
670
122008
2219
#####segfunc##### def segfunc(x, y): return max(x, y) ################# #####ide_ele##### ide_ele = 0 ################# class SegTree: """ init(init_val, ide_ele): 配列init_valで初期化 O(N) update(k, x): k番目の値をxに更新 O(logN) query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN) """ def __init__(self, ini...
Traceback (most recent call last): File "/tmp/tmpbvs1uefi/tmpz0hcx064.py", line 70, in <module> a = input().split() ^^^^^^^ EOFError: EOF when reading a line
s740070808
p02537
u994521204
1601182923
Python
PyPy3 (7.3.0)
py
Runtime Error
119
74448
999
import sys input = sys.stdin.buffer.readline n, k = map(int, input().split()) max_n = 300000 + 10 SEG = [0] * (2 * max_n) func = max ele = 0 def update(idx, val): idx += max_n SEG[idx] = val for i in reversed(range(1, max_n)): SEG[i] = func(SEG[2 * i], SEG[2 * i + 1]) def query(left, right):...
Traceback (most recent call last): File "/tmp/tmp0j3ve_jj/tmpiv5kgdf6.py", line 5, in <module> n, k = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s614367162
p02537
u255898796
1601182883
Python
PyPy3 (7.3.0)
py
Runtime Error
603
122140
2219
#####segfunc##### def segfunc(x, y): return max(x, y) ################# #####ide_ele##### ide_ele = 0 ################# class SegTree: """ init(init_val, ide_ele): 配列init_valで初期化 O(N) update(k, x): k番目の値をxに更新 O(logN) query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN) """ def __init__(self, ini...
Traceback (most recent call last): File "/tmp/tmpml2nnzk_/tmpf8pxjsda.py", line 70, in <module> a = input().split() ^^^^^^^ EOFError: EOF when reading a line
s516639128
p02537
u571969099
1601182841
Python
PyPy3 (7.3.0)
py
Runtime Error
151
153772
3496
from typing import Callable, TypeVar, List T = TypeVar('T') class SegTree: def __init__(self, v: List[T], op: Callable[[T, T], T], e: Callable[[], T]) -> None: self.__dict__["_n"] = len(v) self.__dict__["log"] = (self.__dict__["_n"] - 1).bit_length() self.__dict__["size"] = 1 << self.log ...
Traceback (most recent call last): File "/tmp/tmpgkvbsb0b/tmpvbtodg3_.py", line 103, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s576339634
p02537
u255898796
1601182258
Python
Python (3.8.2)
py
Runtime Error
2207
34308
2212
#####segfunc##### def segfunc(x, y): return max(x, y) ################# #####ide_ele##### ide_ele = 0 ################# class SegTree: """ init(init_val, ide_ele): 配列init_valで初期化 O(N) update(k, x): k番目の値をxに更新 O(logN) query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN) """ def __init__(self, init_...
Traceback (most recent call last): File "/tmp/tmpj9htxqvd/tmpv7pylrqd.py", line 70, in <module> a = input().split() ^^^^^^^ EOFError: EOF when reading a line
s523315181
p02537
u255898796
1601181625
Python
Python (3.8.2)
py
Runtime Error
2206
34196
2250
#####segfunc##### def segfunc(x, y): return max(x, y) ################# #####ide_ele##### ide_ele = 0 ################# class SegTree: """ init(init_val, ide_ele): 配列init_valで初期化 O(N) update(k, x): k番目の値をxに更新 O(logN) query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN) """ def __init__(self, init_...
Traceback (most recent call last): File "/tmp/tmp2kkvp_ms/tmpwjgezqgg.py", line 70, in <module> a = input().split() ^^^^^^^ EOFError: EOF when reading a line
s893058866
p02537
u923270446
1601180285
Python
PyPy3 (7.3.0)
py
Runtime Error
106
84848
1388
class SegmentTree: def __init__(self, lis, ele, op): self.len = len(lis) self.n = 1 << ((self.len - 1).bit_length()) self.op = op self.ele = ele self.tree = self._build(lis) def _build(self, lis): res_tree = [self.ele] * (self.n - 1) + lis + [self.ele] * (self.n -...
Traceback (most recent call last): File "/tmp/tmpka3bpoyw/tmpzt1ipezb.py", line 38, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s390755516
p02537
u571969099
1601179366
Python
PyPy3 (7.3.0)
py
Runtime Error
188
80000
3183
from typing import Callable, TypeVar, List T = TypeVar('T') class SegTree: def __init__(self, v: List[T], op: Callable[[T, T], T], e: Callable[[], T]) -> None: self._n = len(v) self.log = (self._n - 1).bit_length() self.size = 1 << self.log self.d = [e() for _ in range(2 * self.si...
Traceback (most recent call last): File "/tmp/tmp9jabwja1/tmp5gl4esx1.py", line 103, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s567827166
p02537
u551909378
1601178344
Python
Python (3.8.2)
py
Runtime Error
34
13212
991
import math N, K = map(int, input().split()) Amax = 300000 # seg_leaf : seg_tree の葉で [0:0) に当たるノードのインデックス seg_leaf_0 = 2**int(math.log2(Amax+1)) # seg_tree : 1-indexed のセグ木 seg_tree = [0]*(seg_leaf_0 * 2) def get_max(check_min, check_max, area_min, area_max, node_ind): if area_max < check_min or check_max < area_...
Traceback (most recent call last): File "/tmp/tmphuou16u8/tmp5jhw0mo9.py", line 3, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s486397808
p02537
u729133443
1601177857
Python
Python (3.8.2)
py
Runtime Error
34
9096
1541
code = r""" # distutils: language=c++ # distutils: include_dirs=/opt/atcoder-stl from libcpp cimport bool from libcpp.vector cimport vector cdef extern from "<atcoder/segtree>" namespace "atcoder" nogil: cdef cppclass segtree[S, OP, E]: segtree(vector[S] v) void set(int p, S x) S get(int p) ...
Traceback (most recent call last): File "/tmp/tmp_wghb0zb/tmp0kdo3b5g.py", line 56, in <module> import solve ModuleNotFoundError: No module named 'solve'
s020220953
p02537
u551909378
1601177830
Python
Python (3.8.2)
py
Runtime Error
39
13092
989
import math N, K = map(int, input().split()) Amax = 300000 # seg_leaf : seg_tree の葉で [0:0} に当たるノードのインデックス seg_leaf_0 = 2**int(math.log2(Amax+1)) # seg_tree : 1-indexed のセグ木 seg_tree = [0]*(seg_leaf_0 * 2) def get_max(check_min, check_max, area_min, area_max, node_ind): if area_max < check_min or check_max < area_...
Traceback (most recent call last): File "/tmp/tmpnk6dnhi3/tmpvblar8ew.py", line 3, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s230294611
p02537
u852690916
1601177740
Python
PyPy3 (7.3.0)
py
Runtime Error
162
123684
2297
# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..) import sys def main(N, K, A): tree = SegmentTree(300_300) for a in A: p = tree.query(a - K, a + K + 1) tree.modify(a, p + 1) print(tree.query(0, 300_300)) class SegmentTree: __slots__ = ('__n', '__d', '__f', '__e') def __init__(self, n...
Traceback (most recent call last): File "/tmp/tmpyivuuzhn/tmph7pq3slr.py", line 62, in <module> N, K = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s063055369
p02537
u111822487
1601177023
Python
PyPy3 (7.3.0)
py
Runtime Error
85
68704
484
import numpy l = input().split(' ') N = int(l[0]) K = int(l[1]) A = [] for i in range(N): A.append(int(input())) dp = [-1]*(N+1) dp[0] = 0 for i in range(N): flg = False n = numpy.amax(dp) #print('a'+str(n)) for j in range(n,-1,-1): arr = [k for k, x in enumerate(dp) if x == j] #print(arr) for ...
Traceback (most recent call last): File "/tmp/tmp7069nb40/tmp5ri55w1z.py", line 3, in <module> l = input().split(' ') ^^^^^^^ EOFError: EOF when reading a line
s191383609
p02537
u111365362
1601175627
Python
PyPy3 (7.3.0)
py
Runtime Error
165
68676
848
n,k = map(int,input().split()) scale = 21 scale = 3 seg = [0 for _ in range(2**scale)] db = [2**i for i in range(scale)] rdb = list(reversed(db)) #print(db) #print(rdb) #print(db) for _ in range(n): c = int(input()) l = max(c-k,0) r = min(c+k+1,2**(scale-1)) maxi = 0 now = [[l,r]] #print(now) for i in ran...
Traceback (most recent call last): File "/tmp/tmpv8tjy91t/tmpufajieov.py", line 1, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s331805527
p02537
u960080897
1601175295
Python
PyPy3 (7.3.0)
py
Runtime Error
494
96392
3277
# Date [ 2020-09-26 21:43:42 ] # Problem [ d.py ] # Author Koki_tkg 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(): return list(sys.stdin.readline().stri...
Traceback (most recent call last): File "/tmp/tmp8wnju9ik/tmpnetf9jrr.py", line 105, in <module> Main() File "/tmp/tmp8wnju9ik/tmpnetf9jrr.py", line 96, in Main n, k = read_ints() ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s768973856
p02537
u993808866
1601175048
Python
PyPy3 (7.3.0)
py
Runtime Error
377
95392
256
n, k = map(int, input().split()) a_list = [int(input()) for _ in range(n)] dp = [1] * n for i in range(n): for j in range(max(0, i-N), i): if abs(a_list[i] - a_list[j]) <= k: dp[i] = max(dp[i], dp[j] + 1) ans = max(dp) print(ans)
Traceback (most recent call last): File "/tmp/tmp873otcfy/tmpp6h9d8vj.py", line 1, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s048287650
p02537
u401686269
1601174964
Python
PyPy3 (7.3.0)
py
Runtime Error
733
123492
1415
N,K=map(int,input().split()) class SegTree: """ segment tree with point modification and range product. """ # # https://yukicoder.me/submissions/452850 def __init__(self, N, data_f = min, data_unit=1<<30): self.N = N self.data_f = data_f self.data_unit = data_unit self.data ...
Traceback (most recent call last): File "/tmp/tmpjbbrmsxw/tmpoaar9ytf.py", line 1, in <module> N,K=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s114650609
p02537
u240444124
1601174952
Python
PyPy3 (7.3.0)
py
Runtime Error
166
79732
1612
import sys z=sys.stdin.readline class SegmentTree: def __init__(self, data, default=0, func=max): self._default = default self._func = func self._len = len(data) self._size = _size = 1 << (self._len - 1).bit_length() self.data = [default] * (2 * _size) self.data[_size...
Traceback (most recent call last): File "/tmp/tmpngzlad5d/tmp0lbj5nna.py", line 43, in <module> n,k=map(int,z().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s792737377
p02537
u240444124
1601174918
Python
PyPy3 (7.3.0)
py
Runtime Error
121
79760
1616
import sys z=sys.stdin.readline class SegmentTree: def __init__(self, data, default=0, func=max): self._default = default self._func = func self._len = len(data) self._size = _size = 1 << (self._len - 1).bit_length() self.data = [default] * (2 * _size) self.data[_size...
Traceback (most recent call last): File "/tmp/tmp12vcwz0x/tmpt6xfcqz2.py", line 43, in <module> n,k=map(int,z().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s838057762
p02537
u724687935
1601174887
Python
PyPy3 (7.3.0)
py
Runtime Error
1118
178148
2042
class SegmentTree(): """ update, get を提供するSegmentTree Attributes ---------- __n : int 葉の数。2 ^ i - 1 __dot : Segment function __e: int 単位元 __node: list Segment Tree """ def __init__(self, A, dot, e): """ Parameters ---------...
Traceback (most recent call last): File "/tmp/tmpxae_sc1t/tmphxp6a88b.py", line 61, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s913408628
p02537
u240444124
1601174882
Python
PyPy3 (7.3.0)
py
Runtime Error
768
82232
1602
import sys z=sys.stdin.readline class SegmentTree: def __init__(self, data, default=0, func=max): self._default = default self._func = func self._len = len(data) self._size = _size = 1 << (self._len - 1).bit_length() self.data = [default] * (2 * _size) self.data[_size...
Traceback (most recent call last): File "/tmp/tmp25jcet0f/tmp38u1_lzo.py", line 43, in <module> n,k=map(int,z().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s097017941
p02537
u050157681
1601174859
Python
Python (3.8.2)
py
Runtime Error
43
20652
832
N,M = map(int, input().split()) notcalled=list(range(1,N+1)) nets=[] for _ in range(M): a,b=map(int, input().split()) if a in notcalled and b in notcalled: nets.append([a,b]) del notcalled[notcalled.index(a)] del notcalled[notcalled.index(b)] elif a in notcalled: for net in ...
Traceback (most recent call last): File "/tmp/tmpyph2o4sb/tmp0qqyhte4.py", line 1, in <module> N,M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s418059533
p02537
u240444124
1601174840
Python
PyPy3 (7.3.0)
py
Runtime Error
100
85576
1641
import sys,io,os z=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline class SegmentTree: def __init__(self, data, default=0, func=max): self._default = default self._func = func self._len = len(data) self._size = _size = 1 << (self._len - 1).bit_length() self.data = [default...
Traceback (most recent call last): File "/tmp/tmph6oeru7p/tmpncfwqmk7.py", line 43, in <module> n,k=map(int,z().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s264810209
p02537
u129019798
1601174830
Python
PyPy3 (7.3.0)
py
Runtime Error
575
73568
488
def main(): import sys from bisect import bisect_left N,K=list(map(int,sys.stdin.readline().split())) A=[0]*N for i in range(N): A[i]=int(sys.stdin.readline()) dp=[0]*(N+1) dp[0]=1 if abs(A[0]-A[1])<=K: dp[1]=2 else: dp[1]=1 for i in range(2,N): ...
Traceback (most recent call last): File "/tmp/tmpqt26elqg/tmp_4yeyinn.py", line 27, in <module> main() File "/tmp/tmpqt26elqg/tmp_4yeyinn.py", line 4, in main N,K=list(map(int,sys.stdin.readline().split())) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s770028671
p02537
u401686269
1601174586
Python
Python (3.8.2)
py
Runtime Error
2206
31432
1417
N,K=map(int,input().split()) class SegTree: """ segment tree with point modification and range product. """ # # https://yukicoder.me/submissions/452850 def __init__(self, N, data_f = min, data_unit=1<<30): self.N = N self.data_f = data_f self.data_unit = data_unit self.data ...
Traceback (most recent call last): File "/tmp/tmp1tr4inah/tmpxrz0nh2w.py", line 1, in <module> N,K=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s935273810
p02537
u486094752
1601174471
Python
Python (3.8.2)
py
Runtime Error
373
20804
252
N, K = map(int, input().split()) A = [int(input()) for i in range(N)] ans = [] i = 0 while(i<=N-2): a = A[i] T = 1 while (j<=N-1): if ( abs(a-A[j]) <= K ): T += 1 a = A[j] j += 1 ans.append(T) i += 1 print(max(ans))
Traceback (most recent call last): File "/tmp/tmpxbbuy57f/tmpxomas0f6.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s316137349
p02537
u931769295
1601174404
Python
Python (3.8.2)
py
Runtime Error
117
27148
257
import numpy as np a=np.array(a) n,k = map(int,input().split()) a = [] for i in range(n): a.append(list(map(int,input().split()))) for i in range(n-1): b = list(map(lambda x,y: x-y, a, a)) if abs(b) >= 3: count += 1 print(count)
Traceback (most recent call last): File "/tmp/tmpsmqyd5ir/tmp6tppwdu2.py", line 2, in <module> a=np.array(a) ^ NameError: name 'a' is not defined
s527679666
p02537
u316152477
1601174395
Python
Python (3.8.2)
py
Runtime Error
644
84664
329
row = input().split() N = int(row[0]) K = int(row[1]) An = [] for i in range(0, N): An.append(input().split()) print(An) for i in range(0, N-2): Bn = abs(An[i] - An[i+1]) cnt = 0 Cn = [] for i in range (len(Bn)): if Bn[i] <= K: cnt += 1 Cn.append(cnt) else: cnt = 0 print(m...
Traceback (most recent call last): File "/tmp/tmpulxl3l1s/tmpbgfwzw0e.py", line 1, in <module> row = input().split() ^^^^^^^ EOFError: EOF when reading a line
s773728286
p02537
u487767879
1601174393
Python
Python (3.8.2)
py
Runtime Error
129
53228
404
import numpy as np N, K = list(map(int, input().split())) dp = np.ones((N+1, 300000+1)) * -1 for i in range(N): A = int(input()) if dp[i, A] < 0: dp[i, A] = 0 for j in np.where(dp[i,:] > -1)[0]: if dp[i+1, j] < 0: dp[i+1, j] = dp[i, j] if (abs(A - j) <= K) and (dp[i+1, A...
Traceback (most recent call last): File "/tmp/tmpwrds_4pt/tmpqje351_6.py", line 2, in <module> N, K = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s427590232
p02537
u592826944
1601174391
Python
PyPy3 (7.3.0)
py
Runtime Error
146
87456
703
import sys try:sys.stdin,sys.stdout=open('in.txt','r'),open('out.txt','w') except:pass ii1=lambda:int(sys.stdin.readline().strip()) # for interger is1=lambda:sys.stdin.readline().strip() # for str iia=lambda:list(map(int,sys.stdin.readline().strip().split())) # for List[int] isa=lambda:sys.stdin.readline().strip().spli...
Traceback (most recent call last): File "/tmp/tmp20423p8q/tmpvxo6wd1o.py", line 12, in <module> n , k = iia() ^^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s185024598
p02537
u102655885
1601174386
Python
Python (3.8.2)
py
Runtime Error
416
21724
902
n, k = map(lambda x: int(x), input().split()) list_a = [] for _ in range(n): list_a.append(int(input())) memo = dict() def subilst_max_length(current_value, i): if (current_value, i) in memo.keys(): return memo[(current_value, i)] if i == n-1: if (current_value is None) or (abs(...
Traceback (most recent call last): File "/tmp/tmphiukv16a/tmpdrgdsjhy.py", line 1, in <module> n, k = map(lambda x: int(x), input().split()) ^^^^^^^ EOFError: EOF when reading a line
s565071341
p02537
u516079739
1601174375
Python
Python (3.8.2)
py
Runtime Error
73
9412
214
n,q = input().split(' ') n = int(n) q=int(q) s='' a =[] for i in range(n): s+='1' c='' for _ in range(q): a,b,c=input().split(' ') a=int(a) b=int(b) for i in range(a,b): s+=c; print(s)
Traceback (most recent call last): File "/tmp/tmpttzpfxlk/tmpr1cd0drs.py", line 1, in <module> n,q = input().split(' ') ^^^^^^^ EOFError: EOF when reading a line
s700410354
p02537
u879921371
1601174340
Python
Python (3.8.2)
py
Runtime Error
34
8996
646
n,k=map(int,input().split()) a=[None]*n m=0 lian=0 a0=int(input()) a[0]=a0 for i in range(1,n): a1=int(input()) a[i]=a1 if a1-a0 >k: pass elif a0-a1>k: pass else: lian+=1 if lian>m: m=lian a0=int(a1) m1=0 lian=0 a0=a[n-1] for i in range(2,n+1): a1=a[n-i] if a1-a0 >k: pass e...
File "/tmp/tmp240crgc_/tmp9vzeixqe.py", line 52 m1=m2 ^ IndentationError: expected an indented block after 'if' statement on line 51
s897048354
p02537
u487767879
1601174336
Python
Python (3.8.2)
py
Runtime Error
163
52972
402
import numpy as np N, K = list(map(int, input().split())) dp = np.ones((N+1, 300000)) * -1 for i in range(N): A = int(input()) if dp[i, A] < 0: dp[i, A] = 0 for j in np.where(dp[i,:] > -1)[0]: if dp[i+1, j] < 0: dp[i+1, j] = dp[i, j] if (abs(A - j) <= K) and (dp[i+1, A] ...
Traceback (most recent call last): File "/tmp/tmp8dqbfxnz/tmpnjz8a_pa.py", line 2, in <module> N, K = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s950872008
p02537
u216928054
1601174312
Python
PyPy3 (7.3.0)
py
Runtime Error
2210
170776
4059
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**6) INF = 10 ** 9 + 1 # sys.maxsize # float("inf") MOD = 10 ** 9 + 7 def debug(*x): print(*x, file=sys.stderr) def solve_0_WA(N, K, AS): candidates = [[0]] for i in range(1, N): A = AS[i] new_candidates = [] for c in can...
Traceback (most recent call last): File "/tmp/tmpclwj7tra/tmprhcmkngj.py", line 216, in <module> main() File "/tmp/tmpclwj7tra/tmprhcmkngj.py", line 131, in main N, K = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s675156585
p02537
u235376569
1601174262
Python
Python (3.8.2)
py
Runtime Error
2206
32876
299
n,k=map(int,input().split()) l=[] for i in range(n): a=int(input()) l.append(a) sa=[] ss=[] for i in range(n-1): sa.append(l[i]-l[i+1]) for i in range(len(sa)-1): if len(sa)<=i: break if k<abs(sa[i]) and abs(sa[i]+sa[i+1])<=k: sa[i]=l[i]-l[i+2] sa.pop(i+1) print(len(sa)+1)
Traceback (most recent call last): File "/tmp/tmpkcghpgp1/tmp5jz6bz3d.py", line 1, in <module> n,k=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s369347011
p02537
u738257898
1601174225
Python
Python (3.8.2)
py
Runtime Error
373
20968
667
import sys sys.setrecursionlimit(1000000) def recursion(arr, length, idx, value, criteria, counta): if idx >= length: return counta if abs(arr[idx] - value) <= criteria: result_skip = recursion(arr, length, idx + 1, value, criteria, counta) result_process = recursion(arr, length, idx +...
Traceback (most recent call last): File "/tmp/tmp8vqzp1jo/tmpafjfwzja.py", line 15, in <module> n, k = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s640713762
p02537
u363421241
1601174220
Python
Python (3.8.2)
py
Runtime Error
2206
29676
414
def main(): n, k = map(int, input().split()) a = [0] for _ in range(n): a.append(int(input())) table = [0]*(n+1) dp = [0]*(n+1) for i in range(1, n+1): down = a[i]-k up = a[i]+k if down < 0: down = 0 if up > n: up = n ...
Traceback (most recent call last): File "/tmp/tmp2p57u0uw/tmp83gt829b.py", line 22, in <module> main() File "/tmp/tmp2p57u0uw/tmp83gt829b.py", line 3, in main n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s088910178
p02537
u754869388
1601174183
Python
Python (3.8.2)
py
Runtime Error
394
21732
809
#input n, k = map(int,input().split()) a = [int(input()) for i in range(n)] def input_2(n,k): n, k = map(int,input().split()) a = [randint(1, k) for i in range(n)] return n,k,a def connect(i,d,p,q): if i+d >= n: if p > q: q = p #print("bbbb {} {}".format(p,q)) retu...
Traceback (most recent call last): File "/tmp/tmp3hr6zc77/tmpvou2lvxu.py", line 3, in <module> n, k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s133270140
p02537
u364774090
1601174139
Python
Python (3.8.2)
py
Runtime Error
494
20764
217
N, K = [int(i) for i in input().split()] A = [0] * N for i in range(N): A[i] = int(input()) ans = 0 i, j = 0, 1 while i < N - 2: if abs(A[i] - A[j]) <= K: ans += 1 i = j j += 1 if ans > 0: ans += 1 print(ans)
Traceback (most recent call last): File "/tmp/tmp2ffwvc_4/tmpakyuwtl_.py", line 1, in <module> N, K = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s124050338
p02537
u924241064
1601174130
Python
PyPy3 (7.3.0)
py
Runtime Error
523
129664
268
N, K = map(int, input().split()) list = [int(input()) for _ in range(N)] print(list) new_list = [] new_list.append(list[0]) for i in range(N): did = new_list[-1] - list[i] if did <= K: new_list.append(list[i + 1]) print(len(new_list))
Traceback (most recent call last): File "/tmp/tmpu4lrekdw/tmpvvcm9m_u.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s762303311
p02537
u738257898
1601174084
Python
Python (3.8.2)
py
Runtime Error
585
51800
1063
def solve(city_arr, road_arr): # points = [road_arr[0][0],road_arr[0][1]] starts = [road[0] for road in road_arr] ends = [road[1] for road in road_arr] points = starts points.extend(ends) set_cities = set(points) used = [False for road in road_arr] is_end = True counta = 0 idx = ...
Traceback (most recent call last): File "/tmp/tmpvntuyq1h/tmpjwhyqx6h.py", line 31, in <module> num_cities, num_roads = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s403889499
p02537
u919235786
1601174058
Python
Python (3.8.2)
py
Runtime Error
430
21728
275
n,k=map(int,input().split()) a=[] for i in range(n): ai=int(input()) a.append(ai) def rec(x): ans=1 for i in range(x+1,n): if abs(a[i]-a[x])<=k: ans=max(rec(i)+1,ans) return ans b=0 for i in range(n): b=max(b,rec(i)) print(b)
Traceback (most recent call last): File "/tmp/tmp_x_gsb_z/tmp7gcxmpnc.py", line 1, in <module> n,k=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s937442130
p02537
u289288647
1601174048
Python
PyPy3 (7.3.0)
py
Runtime Error
415
114360
714
def FlatSub(): n, k = map(int, input().split()) a = [int(input()) for _ in range(n)] diff = [] ans, count = 0, 0 for i in range(n-1): num = a[i+1]-a[i] diff.append(num) if abs(num) <= k: count += 1 else: ans = max(ans, count) count...
Traceback (most recent call last): File "/tmp/tmp2ek1i_7k/tmpg0ubqi54.py", line 30, in <module> FlatSub() File "/tmp/tmp2ek1i_7k/tmpg0ubqi54.py", line 2, in FlatSub n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s356065802
p02537
u260370057
1601174043
Python
Python (3.8.2)
py
Runtime Error
412
21544
247
def flat(a,k): if len(a) == 1: return a ab = a.pop(-1) b = flat(a,k) if abs(b[-1] - ab) <= k: b.append(ab) return b n,k = map(int,input().split()) a = [] for i in range(n): ain = int(input()) a.append(ain) b = flat(a,k) print(len(b))
Traceback (most recent call last): File "/tmp/tmp1fmdbe1o/tmpmuj031sf.py", line 12, in <module> n,k = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s050100457
p02537
u642012866
1601174001
Python
PyPy3 (7.3.0)
py
Runtime Error
749
80368
1147
N, K = map(int, input().split()) def init_max(init_max_val): #set_val for i in range(N): seg_max[i+num_max-1]=init_max_val[i] #built for i in range(num_max-2,-1,-1) : seg_max[i]=max(seg_max[2*i+1],seg_max[2*i+2]) def update_max(k,x): k += num_max-1 seg_max[k] = x w...
Traceback (most recent call last): File "/tmp/tmpypl4_x29/tmpt3crjx19.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s247284584
p02537
u363421241
1601173911
Python
Python (3.8.2)
py
Runtime Error
2206
29864
329
n, k = map(int, input().split()) a = [0] for _ in range(n): a.append(int(input())) a.append(0) table = [0]*(n+1) dp = [0]*(n+1) for i in range(1, n+1): down = a[i]-k up = a[i]+k if down < 1: down = 1 if up > n: up = n dp[i] = max(table[down:up+1])+1 table[a[i]] = dp[i] prin...
Traceback (most recent call last): File "/tmp/tmpq1yrmmqe/tmpsq87eh00.py", line 1, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s953374878
p02537
u367701763
1601173844
Python
PyPy3 (7.3.0)
py
Runtime Error
1371
95684
8732
class LazySegmentTree(): def __init__(self, n, f, g, h, ef, eh): """ :param n: 配列の要素数 :param f: 取得半群の元同士の積を定義 :param g: 更新半群の元 xh が配列上の実際の値にどのように作用するかを定義 :param h: 更新半群の元同士の積を定義 (更新半群の元を xh と表記) :param x: 配列の各要素の値。treeの葉以外は xf(x1,x2,...) """ self.n = ...
Traceback (most recent call last): File "/tmp/tmp6zpf01ws/tmp85t4_m4k.py", line 238, in <module> N, K = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s727786185
p02537
u069125420
1601173836
Python
Python (3.8.2)
py
Runtime Error
2216
408480
584
import sys sys.setrecursionlimit(100000) N, K = map(int, input().split()) A = [int(input()) for i in range(N)] memo = {} def solve(n, v): if (n, v) in memo: return memo[(n, v)] if n == N - 1: if abs(v - A[n]) <= K: return 1 else: return 0 else: if ...
Traceback (most recent call last): File "/tmp/tmpu_5cb141/tmpsa64pjay.py", line 3, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s257808073
p02537
u661764795
1601173786
Python
Python (3.8.2)
py
Runtime Error
675
49752
456
N, Q = map(int, input().split()) LRD = [list(map(int, input().split())) for _ in range(Q)] mod = 998244353 l = [] t = '' for i in range(20000): t += '1' for i in range(1, 10): l.append(str(int(t) * i)) S = '' for i in range(N): S += '1' for i in range(Q): t = l[LRD[i][2] - 1] while len(t) < LRD[...
Traceback (most recent call last): File "/tmp/tmp_ca6u9um/tmpx37div4t.py", line 1, in <module> N, Q = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s914366597
p02537
u661764795
1601173775
Python
PyPy3 (7.3.0)
py
Runtime Error
2211
251280
456
N, Q = map(int, input().split()) LRD = [list(map(int, input().split())) for _ in range(Q)] mod = 998244353 l = [] t = '' for i in range(20000): t += '1' for i in range(1, 10): l.append(str(int(t) * i)) S = '' for i in range(N): S += '1' for i in range(Q): t = l[LRD[i][2] - 1] while len(t) < LRD[...
Traceback (most recent call last): File "/tmp/tmpz6b5oxp2/tmpacgsb8gj.py", line 1, in <module> N, Q = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s048909387
p02537
u069125420
1601173768
Python
Python (3.8.2)
py
Runtime Error
396
21732
544
N, K = map(int, input().split()) A = [int(input()) for i in range(N)] memo = {} def solve(n, v): if (n, v) in memo: return memo[(n, v)] if n == N - 1: if abs(v - A[n]) <= K: return 1 else: return 0 else: if abs(v - A[n]) <= K: res = ma...
Traceback (most recent call last): File "/tmp/tmp4vfhnsua/tmp3jreu7xw.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s687308024
p02537
u666550725
1601173618
Python
PyPy3 (7.3.0)
py
Runtime Error
89
68820
189
N, K = map(int, input().split()) M = 20 P = [0 for k in range(M+1)] for i in range(N): a = int(input()) c = max(P[max(a - K, 0):min(a+K+1, M+1)]) + 1 P[a] = max(P[a], c) print(max(P))
Traceback (most recent call last): File "/tmp/tmpwakndxno/tmpxsgn7qpq.py", line 1, in <module> N, K = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s978664224
p02537
u163393400
1601173600
Python
Python (3.8.2)
py
Runtime Error
594
23164
433
N,K=map(int,input().split()) l=[] for i in range(N): l.append(int(input())) ll=[] def s(n,l,ll,K): for i in range(n+1,len(l)): if abs(l[n]-l[i]) <= K: ll.append(l[n]) return(i) else: continue return i=0 while True: j=s(i,l,ll,K) i=j ...
Traceback (most recent call last): File "/tmp/tmpt3wvhc0s/tmpgu81w3z3.py", line 1, in <module> N,K=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s748118976
p02537
u506910932
1601173531
Python
Python (3.8.2)
py
Runtime Error
528
23360
318
n, k = map(int, input().split()) N = [] for i in range(n): N.append(int(input())) # 隣同士がいくつ離れているかをカウント dist = [0 for _ in range(n + 3)] for i in range(1, n): dist[abs(N[i] - N[i - 1])] += 1 ans = 0 for i in range(k + 1): ans += dist[i] # print(dist) print(ans + 1)
Traceback (most recent call last): File "/tmp/tmpl_c1q2bc/tmp1wzrjbbz.py", line 1, in <module> n, k = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s790641556
p02537
u441575327
1601173529
Python
PyPy3 (7.3.0)
py
Runtime Error
359
95008
512
from collections import deque N,K = list(map(int,input().split())) A = [int(input()) for i in range(N)] if N == 1: print(1) exit() lst = [-1]*(N+1) queue = deque() queue.append((A[0],1,1)) while queue: # print(queue) r,size,i = queue.popleft() if i == N: continue if lst[r] <= size: ...
Traceback (most recent call last): File "/tmp/tmpacc92rc6/tmpelomj8ee.py", line 3, in <module> N,K = list(map(int,input().split())) ^^^^^^^ EOFError: EOF when reading a line
s089436793
p02537
u476225888
1601173479
Python
PyPy3 (7.3.0)
py
Runtime Error
1132
113760
3739
import sys, math import io, os #data = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline from bisect import bisect_left as bl, bisect_right as br, insort from heapq import heapify, heappush, heappop from collections import defaultdict as dd, deque, Counter # from itertools import permutations,combinations def data():...
Traceback (most recent call last): File "/tmp/tmpmjvecndu/tmpl5251_d3.py", line 106, in <module> n,k=mdata() ^^^ ValueError: not enough values to unpack (expected 2, got 0)