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
s457693497
p04021
u619819312
1555804880
Python
Python (3.4.3)
py
Runtime Error
211
8608
187
from collections import defaultdict as d a=[int(input()) for i in range(int(input()))] b=sorted(a) c=d(int) e=0 for i in range(0,n,2): d[b[i]]=1 for i in a[1::2]: e+=d[i] print(e)
Traceback (most recent call last): File "/tmp/tmphqkl3t1a/tmpm2gtdctf.py", line 2, in <module> a=[int(input()) for i in range(int(input()))] ^^^^^^^ EOFError: EOF when reading a line
s086483000
p04021
u785989355
1552970393
Python
Python (3.4.3)
py
Runtime Error
506
7272
678
def nibutan2(array,value,left,right,first = True): if first: if array[left]>value: return 0 elif array[right]<value: return len(array) if right-left<=1: return right else: i=(left+right)//2 if array[i]>value: return nibutan2(array,value,left,i,False) elif array[i]<value: return nibutan2(array,value,i,right,False) N=int(input()) A=[] B=[] for i in range(N): if i%2==0: A.append(int(input())) else: B.append(int(input())) A.sort() B.sort() count=0 for i in range(len(A)): c=nibutan2(B,A[i],0,len(B)-1) count+=abs(c-i) print(count)
Traceback (most recent call last): File "/tmp/tmpxfse14ox/tmph20t_l6y.py", line 19, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s081071926
p04021
u785989355
1552970249
Python
Python (3.4.3)
py
Runtime Error
235
7268
674
def nibutan2(array,value,left,right,first = True): if first: if array[left]>value: return 0 elif array[right]<value: return len(array) if right-left<=1: return right else: i=(left+right)//2 if array[i]>value: return nibutan(array,value,left,i,False) elif array[i]<value: return nibutan(array,value,i,right,False) N=int(input()) A=[] B=[] for i in range(N): if i%2==0: A.append(int(input())) else: B.append(int(input())) A.sort() B.sort() count=0 for i in range(len(A)): c=nibutan2(B,A[i],0,len(B)-1) count+=abs(c-i) print(count)
Traceback (most recent call last): File "/tmp/tmpf1hsnzj5/tmpyvf94_qw.py", line 17, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s298240560
p04021
u539402331
1545359467
Python
PyPy3 (2.4.0)
py
Runtime Error
179
38256
375
#include <bits/stdc++.h> using namespace std; int n, k[100005], mon[100005], ans; bool pre(int a, int b) { if(k[a]<k[b]){return true;} else{return false;} } int main() { cin>>n; for (int i = 0; i < n; ++i) { cin>>k[i]; mon[i+1] = i+1; } sort(mon,mon+n,pre); for (int i = 0; i < n; i += 2){ if (mon[i+1] % 2 == 0){++ans;} } cout<<ans<<endl; }
File "/tmp/tmpb2x95_88/tmpgiici3yr.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s713212475
p04021
u422104747
1539594056
Python
Python (3.4.3)
py
Runtime Error
272
7888
325
import bisect n=int(input()) l=[] e=[] for i in range(n//2): j=int(input()) e.append(j) l.append(j) j=int(input()) l.append(j) if n%2==1: j=int(input()) e.append(j) l.append(j) l.sort() e.sort() res=0 for i in range(0,n,2): if e[bisect.bisect_left(e,l[i])]!=l[i]: res+=1 print(res)
Traceback (most recent call last): File "/tmp/tmp4c5cnf9u/tmp8f4fne0o.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s032688578
p04021
u101225820
1500763870
Python
Python (3.4.3)
py
Runtime Error
2104
7084
387
N=int(input()) l=[int(input()) for _ in range(N)] cnt=0 if(N<3): if N==1:print("0") elif l[1]>l[2]:print("1") else:print("0") for _ in range(N): for i in range(N-2): if l[i]>l[i+2]: l[i], l[i + 2] = l[i + 2], l[i] for _ in range(N): for i in range(N-1): if(l[i]>l[i+1]): l[i],l[i+1]=l[i+1],l[i] cnt+=1 print(cnt)
Traceback (most recent call last): File "/tmp/tmpnpdd__if/tmp78cxexkh.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s767509184
p04021
u866746776
1472818233
Python
Python (3.4.3)
py
Runtime Error
528
14644
256
def solve(a): l = len(a) a1 = [a[2*i+1] for i in range((l+1)//2)] b = a.copy() b.sort() b1 = [b[2*i+1] for i in range((l+1)//2)] a1 = set(a1) b1 = set(b1) return len(a1 - b1) n = int(input()) a = [int(input()) for i in range(n)] print(solve(a))
Traceback (most recent call last): File "/tmp/tmp9d152bsi/tmpkl2l8m_a.py", line 12, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s739731205
p04021
u914627967
1472507592
Python
Python (3.4.3)
py
Runtime Error
548
8592
428
#coding: cp932 N = int(input()) inp =[] for s in range(N): inp.append(int(input())) check = inp[:] check.sort() flag=1 s,ans,lis2 = 0,0,[] while flag==1: #lis.append(check[s]) lis2.append(inp[s]) s+=2 if s>N-1: flag=0 num =len(lis) #print(lis) #print(lis2) for s in range(num): if s!=0: if check[s+2] not in lis2: ans+=1 lis[s] =-1 continue else: if check[s] not in lis2: ans+=1 lis[s]=-1 print(ans)
Traceback (most recent call last): File "/tmp/tmpulnkdb8_/tmpiss9_dov.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s426348718
p04022
u467736898
1596779730
Python
Python (3.8.2)
py
Runtime Error
82
55536
984
import sys from subprocess import Popen, PIPE from itertools import groupby from collections import Counter def main(): sys.stdin.readline() S = sys.stdin.read() T = [] inv_dict = {} Factors = Popen("factor " + S, stdout=PIPE).communicate()[0].split(b"\n") for factors in Factors: factors = map(int, factors.split()[1:]) t = 1 t_inv = 1 for f, group in groupby(factors): n = len(list(group)) % 3 if n == 1: t *= f elif n == 2: t_inv *= f t, t_inv = t * t_inv * t_inv, t * t * t_inv T.append(t) inv_dict[t] = t_inv counter_T = Counter(T) ans = 0 for t, t_cnt in counter_T.items(): if t == 1: ans += 1 continue t_inv = inv_dict[t] t_inv_cnt = counter_T[t_inv] if t_cnt > t_inv_cnt or (t_cnt == t_inv_cnt and t > t_inv): ans += t_cnt print(ans) main()
Traceback (most recent call last): File "/tmp/tmpgjrkby9y/tmpze8r93lr.py", line 38, in <module> main() File "/tmp/tmpgjrkby9y/tmpze8r93lr.py", line 11, in main Factors = Popen("factor " + S, stdout=PIPE).communicate()[0].split(b"\n") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/sandbox-runtime/lib/python3.11/subprocess.py", line 1026, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/root/miniconda3/envs/sandbox-runtime/lib/python3.11/subprocess.py", line 1955, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'factor '
s769508799
p04022
u638795007
1584505961
Python
PyPy3 (2.4.0)
py
Runtime Error
4399
178520
2787
def examA(): S = SI() if "W" in S and not "E" in S: print("No") elif "E" in S and not "W" in S: print("No") elif "N" in S and not "S" in S: print("No") elif "S" in S and not "N" in S: print("No") else: print("Yes") return def examB(): N = I() A = [I()for _ in range(N)] ans = 0 for i in range(N-1): ans += A[i]//2 if A[i]%2 and A[i+1]>=1: ans += 1 A[i+1] -= 1 ans += A[N-1]//2 print(ans) return def examC(): N = I() A = [I()for _ in range(N)] if N==1: print(0) return odd = set() for i in range(N): if i&1==0: odd.add(A[i]) A.sort() ans = 0 for i in range((N+1)//2): if A[i*2] in odd: continue ans += 1 print(ans) return def examD(): def factorization_(a): rep = [[]for _ in range(2)] pair = [] for i in range(2,int(10**(10*1/3))+2): cur = 0 while a%i==0: cur += 1 a //= i if cur>0: cur %= 3 if cur==0: continue rep[0].append((i,cur)) pair.append((i,3-cur)) if not rep[0]: rep[0].append((0,0)) rep[1] = a rep[0] = tuple(rep[0]) rep = tuple(rep) pair = tuple(pair) return rep, pair N = I() S = [I()for _ in range(N)] group = defaultdict(int) P = defaultdict(tuple) for s in S: g,p = factorization_(s) group[g] += 1 P[g[0]] = p #print(group) G2 = deepcopy(group) #print(P) ans = 0 for key,c in group.items(): rep, rest = key pair = rest**2 if rep==((0,0),) and rest==1: ans += 1 else: ans += max(c,G2[(P[rep],pair)]) G2[(rep,rest)] = 0 group[(P[rep], pair)] = 0 #print(ans) print(ans) return def examE(): ans = 0 print(ans) return def examF(): ans = 0 print(ans) return import sys,bisect,itertools,heapq,math,random from copy import deepcopy from heapq import heappop,heappush,heapify from collections import Counter,defaultdict,deque def I(): return int(sys.stdin.readline()) def LI(): return list(map(int,sys.stdin.readline().split())) def LSI(): return list(map(str,sys.stdin.readline().split())) def LS(): return sys.stdin.readline().split() def SI(): return sys.stdin.readline().strip() global mod,mod2,inf,alphabet,_ep mod = 10**9 + 7 mod2 = 998244353 inf = 10**18 _ep = 10**(-12) alphabet = [chr(ord('a') + i) for i in range(26)] sys.setrecursionlimit(10**6) if __name__ == '__main__': examD() """ """
Traceback (most recent call last): File "/tmp/tmpm2i8b8ke/tmpihx_9262.py", line 125, in <module> examD() File "/tmp/tmpm2i8b8ke/tmpihx_9262.py", line 71, in examD N = I() ^^^ File "/tmp/tmpm2i8b8ke/tmpihx_9262.py", line 110, in I def I(): return int(sys.stdin.readline()) ^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s625536631
p04023
u353919145
1553558463
Python
Python (2.7.6)
py
Runtime Error
10
2568
202
if self.buffInGod > 0 then if real == 2 or real == 3 then g_mvcNotify:notifyToRootView("playEffect", self.posXY, '00buff/wudi.json',self.posZ,0,self.faceTo,'effect1') end return false end
File "/tmp/tmpi5ey8kok/tmpiss9329g.py", line 1 if self.buffInGod > 0 then IndentationError: unexpected indent
s280612182
p04023
u089230684
1553558380
Python
Python (2.7.6)
py
Runtime Error
10
2568
122
function SignetBackpacker:refreshBag() g_asyncLoad:overFor(self) if self.signetTal[self.listSlotID] then return end
File "/tmp/tmpxjpxw1w4/tmpsg70_2r3.py", line 1 function SignetBackpacker:refreshBag() ^^^^^^^^^^^^^^^^ SyntaxError: invalid syntax
s616776013
p04023
u816631826
1553558228
Python
Python (2.7.6)
py
Runtime Error
10
2568
134
function SignetBackpacker:refreshBagData(data) if data then self.originData = data end self.signetTal = {} self:refreshBag() end
File "/tmp/tmpw7_2qbw_/tmp3_k2hoh7.py", line 1 function SignetBackpacker:refreshBagData(data) ^^^^^^^^^^^^^^^^ SyntaxError: invalid syntax
s881927993
p04023
u353919145
1553558026
Python
Python (2.7.6)
py
Runtime Error
10
2568
574
if attackObj and (real == 1 or real == 3) then if not args or args.from ~= 9 then -- 9表示来自反弹的 local nowRound = self._scene.nowRound attackObj.roundRecordTb[nowRound] = attackObj.roundRecordTb[nowRound] or {} local recordTb = attackObj.roundRecordTb[nowRound] local tdmg1 = recordTb["roundTotalDmg"] or 0 recordTb["roundTotalDmg"] = tdmg1 + damage if not args or args.from ~= "buff" then -- 非buff的伤害来源 local tdmg2 = recordTb["roundTotalDmgNoBuff"] or 0 recordTb["roundTotalDmgNoBuff"] = tdmg2 + damage end end end
File "/tmp/tmp_u8bjlq2/tmpteteajur.py", line 1 if attackObj and (real == 1 or real == 3) then IndentationError: unexpected indent
s058753073
p04023
u089230684
1553557560
Python
Python (2.7.6)
py
Runtime Error
10
2568
208
type Container struct { services sync.Map //map[string]IService remotes map[string]bool factory IFactory nsq *nsq.NSQRPCServer nsqClient *nsq.NSQRPCClient option ContainerOption inited bool }
File "/tmp/tmpfg20yo26/tmpr3a1q8ee.py", line 1 type Container struct { ^^^^^^^^^ SyntaxError: invalid syntax
s908900222
p04025
u762533651
1600211924
Python
PyPy3 (7.3.0)
py
Runtime Error
96
74716
410
n = int(input()) x = sorted(list(map(int, input().split())), reverse = True) x_2 = list(map(lambda x:x ** 2, x)) ichi = sum(x) jijou = sum(x_2) re = 10 ** 100 #def ji(p, x): # ans = p * (p - 2 * x) # return ans for p in range(x[n], x[0] + 1): second = n * (p ** 2) third = -2 * p * ichi summ = jijou + second + third if re > summ: re = summ print(re) #for i in range(x[i]):
Traceback (most recent call last): File "/tmp/tmp1ykxhec8/tmpislhha91.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s638410104
p04025
u973972117
1598830526
Python
Python (3.8.2)
py
Runtime Error
27
9184
243
N=int(input()) A=list(map(int,input().split())) Sum =0 for i in range(len(A)): Sum += (A[0]-A[i])**2 Answer = Sum for j in range(len(A)): Sum =0 for k in range(-100,101): Sum+= (A[k]-j)**2 Answer =min(Answer, Sum) print(Answer)
Traceback (most recent call last): File "/tmp/tmpngcz56w7/tmp88qjsc2z.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s184141885
p04025
u973972117
1598830461
Python
Python (3.8.2)
py
Runtime Error
33
9184
246
N=int(input()) A=list(map(int,input().split())) Sum =0 for i in range(len(A)): Sum += (A[0]-A[i])**2 Answer = Sum for j in range(-100,101): Sum =0 for k in range(len(A)): Sum+= (A[k]-A[j])**2 Answer =min(Answer, Sum) print(Answer)
Traceback (most recent call last): File "/tmp/tmp96mop32p/tmpn48ub38v.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s004766689
p04025
u973972117
1598830096
Python
Python (3.8.2)
py
Runtime Error
24
9184
243
N=int(input()) A=list(map(int,inout().split())) Sum =0 for i in range(len(N)): Sum += (A[0]-A[i])**2 Answer = Sum for j in range(len(N)): Sum =0 for k in range(len(N)): Sum+= (A[k]-A[j])**2 Answer =min(Answer, Sum) print(Answer)
Traceback (most recent call last): File "/tmp/tmpkxc20c2s/tmpki2gjnlw.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s131935523
p04025
u933650305
1598826682
Python
Python (3.8.2)
py
Runtime Error
31
9156
243
n=int(input()) a=list(map(int,input().split())) b=sorted(a) x=a[0] y=a[n-1] if x==y: print(0) else: d=[] for i in range(x,y+1): c=0 for v in range(n): c+=(i-a[v])**2 d.append(c) continue d=sorted(d) print(d[0])
Traceback (most recent call last): File "/tmp/tmpbispz6hi/tmpe9y1nlpx.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s926724554
p04025
u933650305
1598826444
Python
Python (3.8.2)
py
Runtime Error
32
9092
241
n=int(input()) a=list(map(int,input().split())) b=sorted(a) x=a[0] y=a[n-1] if x==y: print(0) else: d=[] for i in range(x,y): c=0 for v in range(n): c+=(i-a[v])**2 d.append(c) continue d=sorted(d) print(d[0])
Traceback (most recent call last): File "/tmp/tmpnaf8xzfs/tmpadgwpht6.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s426381456
p04025
u933650305
1598825530
Python
Python (3.8.2)
py
Runtime Error
28
9200
196
n=int(input()) a=list(map(int,input().split())) b=sorted(a) x=a[0] y=a[n-1] d=[] for i in range(x,y): c=0 for v in range(n): c+=(i-a[v])**2 d.append(c) continue d=sorted(d) print(d[0])
Traceback (most recent call last): File "/tmp/tmpi8qwdue5/tmpb7k9a3h_.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s172297488
p04025
u390727364
1592503675
Python
PyPy3 (2.4.0)
py
Runtime Error
179
38256
346
def main(): input = stdin.buffer.readline n = int(input()) a = list(map(int, input().split())) x1 = sum(a) // n x2 = x1 + 1 ans1 = 0 ans2 = 0 for ai in a: ans1 += (ai - x1) ** 2 ans2 += (ai - x2) ** 2 print(min(ans1, ans2)) if __name__ == "__main__": setrecursionlimit(10000) main()
Traceback (most recent call last): File "/tmp/tmp8ub1zgc1/tmperq0lgpm.py", line 17, in <module> setrecursionlimit(10000) ^^^^^^^^^^^^^^^^^ NameError: name 'setrecursionlimit' is not defined
s165916825
p04025
u597622207
1589909635
Python
PyPy3 (2.4.0)
py
Runtime Error
184
38512
320
from statistics import mean import math N = int(input()) A = list(map(int, input().split())) mean_num = mean(A) Ceil = math.ceil(mean_num) Floor = math.floor(mean_num) Ceil_sum = 0 Floor_sum = 0 for i in A: Ceil_sum += (Ceil - i) ** 2 for i in A: Floor_sum += (Floor - i) ** 2 print(min(Floor_sum, Ceil_sum))
Traceback (most recent call last): File "/tmp/tmpgxhtsvs_/tmp82ixg482.py", line 4, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s858668083
p04025
u114641312
1589340490
Python
Python (3.4.3)
py
Runtime Error
17
3060
246
from math import factorial,sqrt,ceil,gcd import numpy as np N = int(input()) lisA = list(map(int,input().split())) arrA = np.array(lisA) mean = np.mean(arrA) targetnum = round(mean) arrans = (arrA - targetnum)**2 ans = sum(arrans) print(ans)
Traceback (most recent call last): File "/tmp/tmpt7vf54gt/tmpzg9cr0ic.py", line 4, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s511423217
p04025
u197968862
1587089004
Python
PyPy3 (2.4.0)
py
Runtime Error
181
38768
169
import statistics n = int(input()) a = list(map(int,input().split())) mean = round(statistics.mean(a)) ans = 0 for i in range(n): ans += (a[i]-mean)**2 print(ans)
Traceback (most recent call last): File "/tmp/tmp5n4lcbhi/tmp6cufdvu7.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s552297504
p04025
u353895424
1585085523
Python
Python (3.4.3)
py
Runtime Error
17
2940
135
n = int(input()) a = list(map(int, input().split())) ave = round(sum(a)/n) ans = 0 for _a in a: ans += (_a - ave)**2 print(ans1)
Traceback (most recent call last): File "/tmp/tmp5cvgkg10/tmp5t6o42u_.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s825408271
p04025
u588558668
1584367934
Python
Python (3.4.3)
py
Runtime Error
17
3060
175
n=int(input()) a=list(map(int,input().split())) ma=max(a) mi=min(a) b=[0]*(ma-mi+1) for i in range(mi,ma+1): for j in range(n): b[j]+=(i-a[j])**2 print(min(b[j])
File "/tmp/tmp1pagqtbc/tmp8p9bmpx5.py", line 11 print(min(b[j]) ^ SyntaxError: '(' was never closed
s719325976
p04025
u588558668
1584367701
Python
Python (3.4.3)
py
Runtime Error
17
3060
181
n=int(input()) a=list(map(int,int,input().split())) b=[] ma=max(a) mi=min(a) for i in range(mi,ma+1): c=0 for j in range(n): c+=(i-a[j]**2) b.append(c) print(min(b))
Traceback (most recent call last): File "/tmp/tmp0sp22lzq/tmphvjmrkcq.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s591132174
p04025
u588558668
1584367657
Python
Python (3.4.3)
py
Runtime Error
17
3060
179
n=int(input()) a=list(map(int,int,input().split())) b=[] ma=max(a) mi=min(a) for i in range(b,a+1): c=0 for j in range(n): c+=(i-a[j]**2) b.append(c) print(min(b))
Traceback (most recent call last): File "/tmp/tmpaklz0dwl/tmpx9yi4450.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s739525014
p04025
u588558668
1584367630
Python
Python (3.4.3)
py
Runtime Error
17
3060
179
n=int(input()) a=list(map(int,int,input().split())) b=[] ma=max(a) mi=min(b) for i in range(b,a+1): c=0 for j in range(n): c+=(i-a[j]**2) b.append(c) print(min(b))
Traceback (most recent call last): File "/tmp/tmpd2qrf8ju/tmpkjedy2ti.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s096264902
p04025
u799443198
1577628792
Python
Python (3.4.3)
py
Runtime Error
18
2940
144
import math N, *a = map(int, open(0).read().split()) ave = math.round(sum(a) / N) ans = 0 for x in a: ans += (x - ave) * (x - ave) print(ans)
Traceback (most recent call last): File "/tmp/tmphgy_viyi/tmprnd4nrea.py", line 2, in <module> N, *a = map(int, open(0).read().split()) ^^^^^ ValueError: not enough values to unpack (expected at least 1, got 0)
s979081131
p04025
u580697892
1575466287
Python
Python (3.4.3)
py
Runtime Error
40
5276
275
# coding: utf-8 from math import ceil from statistics import median, mean N = int(input()) A = list(map(int, input().split())) A.sort() if N % 2 == 0: m = ceil((A[N//2] + A[N//2+1]) / 2) else: m = A[N//2] ans = 0 for i in range(N): ans += (A[i] - m)**2 print(ans)
Traceback (most recent call last): File "/tmp/tmpf4c0n4kp/tmpi2si7a0g.py", line 4, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s904935755
p04025
u977642052
1573177322
Python
Python (3.4.3)
py
Runtime Error
18
3056
230
def main(n, a): base = (max(a) + min(a)) / 2 ans = 0 for n in a: ans += (n - base)**2 print(round(ans)) if __name__ == '__main__': n = int(input()) a = map(int, input().split()) main(n, a)
Traceback (most recent call last): File "/tmp/tmpn02vpkbb/tmpfv1migw9.py", line 12, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s222752988
p04025
u215743476
1571530765
Python
Python (3.4.3)
py
Runtime Error
38
5144
154
from statistics import mean n = int(input()) a = list(map(int, input().split())) t = round(mean(a)) sum = 0 for t in a: sum += (i - t)**2 print(sum)
Traceback (most recent call last): File "/tmp/tmp8qe17ivt/tmpjlfpnnnv.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s057829753
p04025
u543954314
1571158650
Python
PyPy3 (2.4.0)
py
Runtime Error
180
38896
345
n = int(input()) s = len(input()) mod = 10**9+7 dp = [[0]*(n+1) for _ in range(n+1)] dp[0][0] = 1 for i in range(1,n+1): dp[i][0] = (dp[i-1][0] + dp[i-1][1])%mod for j in range(1,min(n,i+1)): dp[i][j] = (dp[i-1][j-1]*2 + dp[i-1][j+1])%mod dp[i][n] = dp[i-1][n-1]*2%mod s2 = pow(2,s,mod) rev = pow(s2,mod-2,mod) print(dp[n][s]*rev%mod)
Traceback (most recent call last): File "/tmp/tmpwpbcljgy/tmp4crzcf9o.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s090009797
p04025
u163320134
1555962108
Python
Python (3.4.3)
py
Runtime Error
17
3064
202
n=int(input().split()) arr=list(map(int,input().split())) l=min(arr) r=max(arr) ans=10**10 for i in range(l,r+1): tmp=0 for j in range(n): tmp+=(arr[j]-i)**2 if tmp<ans: ans=tmp print(ans)
Traceback (most recent call last): File "/tmp/tmp8p6j1dnz/tmp3_fzyluk.py", line 1, in <module> n=int(input().split()) ^^^^^^^ EOFError: EOF when reading a line
s705055040
p04025
u149752754
1555616361
Python
Python (3.4.3)
py
Runtime Error
25
3064
245
N = int(input()) NUM = list(map(int,input().split())) MAX = max(NUM) MIN = min(NUM) COSTLIST = [] for i in range (MIN,MAX): COST = 0 for j in NUM: COST += (j-i)**2 COSTLIST.append(COST) MINIMUM = min(COSTLIST) print(MINIMUM)
Traceback (most recent call last): File "/tmp/tmp8f2bqhb6/tmpkb518hjn.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s877723486
p04025
u859897687
1554494420
Python
Python (3.4.3)
py
Runtime Error
17
3060
159
n=int(input()) l=[int(input()) for i in range(n)] s=sum(l)/n if s-int(s)<int(s)+1-s: s=int(s) else: s=int(s)+1 ans=0 for i in l: ans+=(s-i)**2 print(ans)
Traceback (most recent call last): File "/tmp/tmp35798c3z/tmpcbuxxkrm.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s372838639
p04025
u785578220
1547387825
Python
Python (3.4.3)
py
Runtime Error
18
2940
529
#include <iostream> using namespace std; int N; int x[210]; bool t = true; int s = 0; int main(){ int ms = 10000000000; int t = 1; cin >> N; for (int i = 0; i < N; ++i)cin >> x[i]; for (int j = -100; j <= x[N-1]; ++j){ s = 0; for (int i = 0; i < N; ++i){ int p = x[i] - j; //cout << p << endl; s += p * p; } //cout << s << endl; if (s < ms){ ms = s; t = j; } } cout << ms << endl; }
File "/tmp/tmphdt4drm2/tmp2cr55384.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s160061779
p04025
u785989355
1541392164
Python
Python (3.4.3)
py
Runtime Error
17
3060
182
N=int(input()) a=list(map(int,input().split())) a=np.array(a) min_s = 10**29 for i in range(201): s=np.sum((a-np.ones(N)*(i-100))**2) min_s = min(int(s),min_s) print(min_s)
Traceback (most recent call last): File "/tmp/tmpvvmg1p64/tmpsilfqban.py", line 2, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s003888324
p04025
u218843509
1529731359
Python
Python (3.4.3)
py
Runtime Error
20
3188
340
MOD = (10 ** 9) + 7 N = int(input()) s = list(input()) dp = [[0 for i in range(N + 1)] for j in range(N + 1)] for i in range(N + 1): dp[i][i] = 1 for n in range(1, N + 1): dp[n][0] = (dp[n - 1][0] + 2 * dp[n - 1][1]) % MOD for l in range(1, n): dp[n][l] = (dp[n - 1][l - 1] + 2 * dp[n - 1][l + 1]) % MOD print(dp[N - 1][len(s)])
Traceback (most recent call last): File "/tmp/tmp_whxdekq/tmp27ysrig9.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s892744835
p04025
u218843509
1525712740
Python
PyPy2 (5.6.0)
py
Runtime Error
36
27884
376
MOD = (10 ** 9) + 7 N = int(input()) s = list(input()) dp = [[0 for i in range(N + 1)] for j in range(N + 1)] for i in range(N + 1): dp[i][i] = 1 for i in range(N): dp[i][i + 1] = 1 for n in range(1, N + 1): dp[n][0] = (dp[n - 1][0] + 2 * dp[n - 1][1]) % MOD for l in range(1, n): dp[n][l] = (dp[n - 1][l - 1] + 2 * dp[n - 1][l + 1]) % MOD print(dp[N - 1][len(s)])
Traceback (most recent call last): File "/tmp/tmpc89_oj62/tmp8jpyyh8b.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s049952429
p04025
u766407523
1525641627
Python
Python (3.4.3)
py
Runtime Error
18
3060
205
import math N = int(input()) a = list(map(int, input().split())) cost = math.inf for i in range(-100, 101): temp = 0 for a_i in a: temp += (a_i-i)**2 cost = min(cost, temp) print(cost)
Traceback (most recent call last): File "/tmp/tmporqddz1h/tmpbvpedstz.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s475318520
p04025
u835482198
1500852834
Python
Python (3.4.3)
py
Runtime Error
18
3060
227
N = int(input()) a = map(int, input().split()) total_cost = float('inf') for n in range(-100, 101): cost = 0 for i in range(N): cost += (a[i] - n) ** 2 total_cost = min(total_cost, cost) print(total_cost)
Traceback (most recent call last): File "/tmp/tmpw_8yk5xi/tmp1x9n4gq1.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s313620186
p04025
u357487020
1471139619
Python
PyPy2 (5.6.0)
py
Runtime Error
63
9072
506
s=raw_input() n=len(s) cnt=[[0]*26 for _ in xrange(n+1)] for i in xrange(n): for j in xrange(26): cnt[i+1][j]=cnt[i][j] cnt[i+1][ord(s[i])-ord("a")]+=1 if n==2: if s[0]==s[1]: print 1,2 quit() else: print -1,-1 quit() for i in xrange(n): for j in xrange(i+3,n+1): max_cnt=0 for k in xrange(26): max_cnt=max(max_cnt,cnt[j][k]-cnt[i][k]) if (j-i)/2<max_cnt: print i+1,j quit() print -1,-1
File "/tmp/tmppujk4ef4/tmp47nafs79.py", line 10 print 1,2 ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s917624038
p04025
u813098295
1471137748
Python
Python (2.7.6)
py
Runtime Error
25
2568
297
def cost(n, a, m): hihumi = 0 #hihumi => 滝本ひふみ for i in range(n): hihumi += (a[i] - m) ** 2 return hihumi N = int(raw_input()) a = map(int, raw_input().split()) ans = 100 for i in range(min(a), max(a) + 1): if (ans > cost(N, a, i)): ans = const(N, a, i) print ans
File "/tmp/tmpz04ks0up/tmpd4_u9gtm.py", line 19 print ans ^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s734769666
p04026
u706414019
1599733908
Python
Python (3.8.2)
py
Runtime Error
29
8856
270
import collections s = input() ls = len(s) if ls ==2 and s[0]=!s[1]: print(-1,-1) elif ls ==2 and s[0]==s[1]: print(1,2) for i in range(2,ls): tmp = collections.Counter(s[i-2:i+1]) if len(tmp.keys())<=2: print(i-1,i+1) exit() print(-1,-1)
File "/tmp/tmpzds5iml7/tmpvxmk9g0v.py", line 4 if ls ==2 and s[0]=!s[1]: ^ SyntaxError: invalid syntax
s831116991
p04026
u277236383
1597275386
Python
PyPy3 (7.3.0)
py
Runtime Error
81
74736
258
s = input() l = len(s) for i in range(l-2): temp = s[i] if s[i+1]==temp: print(str(i+1)+" "+str(i+2)) quit() if s[i+2]==temp: print(str(i+1)+" "+str(i+3)) quit() if s[i+1]==s[i+2]: print(str(i+2)+ " "+str(i+3)) quit() print("-1 -1")
Traceback (most recent call last): File "/tmp/tmp5e_oj5am/tmpn6kpgr91.py", line 1, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s766264059
p04026
u995062424
1595635712
Python
Python (3.8.2)
py
Runtime Error
56
9440
340
from collections import Counter s = input() flg = False lst = [] for i in range(len(s)-2): if(s[i] == s[i+1]): flg = True lst.append(i+1) lst.append(i+2) break elif(s[i] == s[i+2]): flg = True lst.append(list(i+1, i+3)) break if(flg): print(*lst) else: print(-1, -1)
Traceback (most recent call last): File "/tmp/tmp5p3aiymy/tmp911cd5c1.py", line 3, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s408416057
p04026
u223646582
1591581778
Python
Python (3.4.3)
py
Runtime Error
18
3188
186
s = input() if s[-2] == s[-1]: print(len(s)-1, len(s)) exit() for i in range(s-2): if s[i] == s[i+1] or s[i] == s[i+2]: print(i+1, i+3) exit() print(-1 - 1)
Traceback (most recent call last): File "/tmp/tmp0zzt2t5p/tmp_al9_k2a.py", line 1, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s849200204
p04026
u693933222
1584065860
Python
Python (3.4.3)
py
Runtime Error
53
3188
261
s = input() for i in range(len(s) - 2): if (s[i] == s[i + 1] or s[i] == s[i + 2]): print("{} {}".format(i + 1, i + 3)) break else: if (s[-2] == s[-1]): print("{} {}".format(len(n) - 1, len(n))) else: print("-1 -1")
Traceback (most recent call last): File "/tmp/tmpsnt3s5yn/tmpou2dicue.py", line 1, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s458318227
p04026
u888100977
1583891586
Python
Python (3.4.3)
py
Runtime Error
80
3188
239
s = input() # print(s) for i in range(len(s)-1): if s[i]==s[i+1]: print(i+1,i+2) break if i<=len(s)-2: if s[i]==s[i+2]: print(i+1,i+3) break if i == len(s)-3: print(-1,-1)
Traceback (most recent call last): File "/tmp/tmp3qypyczs/tmpst99b589.py", line 1, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s288542791
p04026
u852690916
1582763580
Python
PyPy3 (2.4.0)
py
Runtime Error
168
39536
226
s=input() for i in range(len(s)): if i>=1: if s[i]==s[i-1]: print(i-1 + ' ' + i) exit() if i>=2: if s[i]==s[i-2]: print(i-2 + ' ' + i) exit() print(-1 -1)
Traceback (most recent call last): File "/tmp/tmp8sjh5q_0/tmpyw91b0pf.py", line 1, in <module> s=input() ^^^^^^^ EOFError: EOF when reading a line
s535187290
p04026
u852690916
1582763434
Python
PyPy3 (2.4.0)
py
Runtime Error
168
39536
245
s=input() ''' - aa - aba ''' for i in range(len(s)): if i>=1: if s[i]==s[i-1]: print(i-1 + ' ' + i) exit() if i>=2: if s[i]==s[i-2]: print(i-2 + ' ' + i) exit() print(-1 -1)
Traceback (most recent call last): File "/tmp/tmphs3etl00/tmpq1fh_4ia.py", line 1, in <module> s=input() ^^^^^^^ EOFError: EOF when reading a line
s133213307
p04026
u018679195
1580540322
Python
Python (3.4.3)
py
Runtime Error
3502
3444
624
s=input() m=[] flag=0 for i in range(len(s)+1): for j in range(len(s)+1): m.append(s[i:j]) for i in range(m.count('')): m.remove('') #print(m) #print(len(m[2])) for i in range(len(m)): if len(m[i])>2: for j in m[i]: #print(j) if len(m[i])%2==0: y=len(m[i])/2 else: y=(len(m[i])+1)/2 if m[i].count(j)>y: h=m[i].index(j) y=m[i].index(j)+len(m[i])-1 flag=1 break if flag==1: break if flag==0: print("-1 -1") else: print(h, y)
Traceback (most recent call last): File "/tmp/tmp5omhjj6f/tmpmdzzhdl3.py", line 1, in <module> s=input() ^^^^^^^ EOFError: EOF when reading a line
s225240487
p04026
u816631826
1580539535
Python
Python (3.4.3)
py
Runtime Error
2622
4164
483
s=input() m=[] flag=0 for i in range(len(s)+1): for j in range(len(s)+1): m.append(s[i:j]) for i in range(m.count('')): m.remove('') print(m) #print(len(m[2])) for i in range(len(m)): if len(m[i])>2: for j in m[i]: if j.count()>len(j)/2: h=j.index() y=j.index()+len(m[i])-1 flag=1 break if flag==1: break if flag==0: print("-1 -1") else: print(h, y)
Traceback (most recent call last): File "/tmp/tmp56lhslh4/tmpardt44e4.py", line 1, in <module> s=input() ^^^^^^^ EOFError: EOF when reading a line
s039009484
p04026
u994988729
1579137838
Python
Python (3.4.3)
py
Runtime Error
187
17088
407
from collections import defaultdict import numpy as np S = input() d = defaultdict(list) for i, s in enumerate(S): d[s].append(i + 1) ans = (-1, -1) for _, v in d.items(): dif = np.diff(v).tolist() if 1 in dif: i = dif.index(1) ans = (v[i], v[i + 1]) break elif 2 in dif: i = dif.index(1) ans = (v[i], v[i + 1]) break print(*ans, sep=" ")
Traceback (most recent call last): File "/tmp/tmprv_5ngjw/tmpn9e5gx0h.py", line 3, in <module> S = input() ^^^^^^^ EOFError: EOF when reading a line
s011292225
p04026
u073852194
1575168094
Python
Python (3.4.3)
py
Runtime Error
63
3188
178
s = input() N = len(s) for i in range(N-1): if s[i]==s[i+1]: print(i+1,i+2) break if i<N-1 and s[i]==s[i+2]: print(i+1,i+3) else: print(-1,-1)
Traceback (most recent call last): File "/tmp/tmpz6h04phc/tmpf5tnuadj.py", line 1, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s264992273
p04026
u754022296
1574369310
Python
Python (3.4.3)
py
Runtime Error
17
3188
193
入力 = input() for i in range(len(入力)-1): if 入力[i]==入力[i+1]: print(i+1, i+2) exit() elif i<n-2 and 入力[i]==入力[i+2]: print(i+1, i+3) exit() print(-1, -1)
Traceback (most recent call last): File "/tmp/tmpafdhwhls/tmpba1c6hq_.py", line 1, in <module> 入力 = input() ^^^^^^^ EOFError: EOF when reading a line
s252469455
p04026
u802963389
1570885675
Python
Python (3.4.3)
py
Runtime Error
18
3064
237
# a*a と aaの2パターンを探せばよい? s = input() n = len(s) for i in range(n-2): if s[i] == s[i + 1]: print(i, i + 1) exit() for i in range(n-3): if s[i] == s[i + 2]: print(i, i + 2) exit() print(-1, -1)
File "/tmp/tmp612snul7/tmp28gdr16g.py", line 6 print(i, i + 1) ^ IndentationError: expected an indented block after 'if' statement on line 5
s474234331
p04026
u672220554
1570645531
Python
Python (3.4.3)
py
Runtime Error
52
3188
375
s=input() n=len(s) res = -1 leng = 0 for i in range(n-2): if s[i] == s[i+1]: res = i+1 leng = 2 break elif s[i] == s[i+2]: res = i+1 leng = 3 break if s[-2] == s[-1]: res = i+1 leng = 2 if res == -1: print("-1 -1") elif leng == 2: print(str(res)+" "+str(res+1)) else: print(str(res)+" "+str(res+2))
Traceback (most recent call last): File "/tmp/tmptngoe33h/tmpu_4_4r42.py", line 1, in <module> s=input() ^^^^^^^ EOFError: EOF when reading a line
s668548947
p04026
u708255304
1569422927
Python
Python (3.4.3)
py
Runtime Error
68
3188
324
S = str(input()) left = -2 right = -2 for i in range(max(1, len(S)-2)): if S[i] == S[i+1]: left = i right = i+1 break if S[i] == S[i+2]: left = i right = i+2 break if S[i+1] == S[i+2]: left = i+1 right = i+2 break print(left+1, right+1)
Traceback (most recent call last): File "/tmp/tmphhasx1su/tmp7u6hf0it.py", line 1, in <module> S = str(input()) ^^^^^^^ EOFError: EOF when reading a line
s388626195
p04026
u798818115
1568081252
Python
Python (3.4.3)
py
Runtime Error
62
3188
303
# coding: utf-8 # Your code here! s=input() judge=True if s[0]==s[1] or s[1]==s[2] or s[0]==s[1]: print(0,2) else: for i in range(3,len(s)): if s[i-2]==s[i-1] or s[i-2]==s[i]: print(i-2,i) judge=False break if judge: print(-1,-1)
Traceback (most recent call last): File "/tmp/tmpfzbr09su/tmplxt0k8z2.py", line 3, in <module> s=input() ^^^^^^^ EOFError: EOF when reading a line
s872720055
p04026
u131666536
1557002883
Python
Python (3.4.3)
py
Runtime Error
55
3188
295
# -*- coding: utf-8 -*- s = input() ans = '' for i in range(len(s)-1): if s[i] == s[i+1]: ans = ' '.join([str(i+1), str(i+2)]) for j in range(len(s)-2): if s[i] == s[i+1] == s[i+2]: ans = ' '.join([str(i+1), str(i+3)]) if ans: print(ans) else: print('-1 -1')
Traceback (most recent call last): File "/tmp/tmpfpa9tunq/tmp3t8hqdcj.py", line 3, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s074655319
p04026
u131666536
1557002477
Python
Python (3.4.3)
py
Runtime Error
55
3188
408
# -*- coding: utf-8 -*- s = input() double = [] triple = [] for i in range(len(s)-1): if s[i] == s[i+1]: double = [str(i+1), str(i+2)] for j in range(len(s)-2): if s[i] == s[i+1] == s[i+2]: triple = [str(i+1), str(i+3)] if double == [] and triple == []: print('-1 -1') else: if double: print(' '.join(double)) else: print(' '.join(triple))
Traceback (most recent call last): File "/tmp/tmpbirx8mi3/tmp6giza0y5.py", line 3, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s430118446
p04026
u131666536
1557002356
Python
Python (3.4.3)
py
Runtime Error
55
3188
388
# -*- coding: utf-8 -*- s = input() double = [] triple = [] for i in range(len(s)-1): if s[i] == s[i+1]: double = [str(i+1), str(i+2)] for j in range(len(s)-2): if s[i] == s[i+1] == s[i+2]: triple = [str(i+1), str(i+3)] if double == [] and triple == []: print('-1 -1') elif double: print(' '.join(double)) else: print(' '.join(triple))
Traceback (most recent call last): File "/tmp/tmphwojux0t/tmp3frrmi7k.py", line 3, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s783136015
p04026
u131666536
1557002094
Python
Python (3.4.3)
py
Runtime Error
57
3188
365
# -*- coding: utf-8 -*- s = input() double = [] triple = [] for i in range(len(s)-1): if s[i] == s[i+1]: double = [str(i+1), str(i+2)] for j in range(len(s)-2): if s[i] == s[i+1] == s[i+2]: triple = [str(i+1), str(i+3)] if double: print(' '.join(double)) elif triple: print(' '.join(triple)) else: print('-1 -1')
Traceback (most recent call last): File "/tmp/tmpyhpv78ii/tmp203o_m04.py", line 3, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s430021318
p04026
u131666536
1557001942
Python
Python (3.4.3)
py
Runtime Error
59
3188
339
# -*- coding: utf-8 -*- s = input() double = [] triple = [] for i in range(len(s)-1): if s[i] == s[i+1]: double = [str(i+1), str(i+2)] if s[i] == s[i+1] == s[i+2]: triple = [str(i+1), str(i+3)] if double: print(' '.join(double)) elif triple: print(' '.join(triple)) else: print('-1 -1')
Traceback (most recent call last): File "/tmp/tmp8xpaya2j/tmpgmbencti.py", line 3, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s404089815
p04026
u977389981
1556405132
Python
Python (3.4.3)
py
Runtime Error
41
3188
192
S = input() if S[0] == S[2]: print(1, 3) else: for i in range(1, len(S)): if S[i] == S[i - 1]: print(i, i + 1) break else: print(-1, -1)
Traceback (most recent call last): File "/tmp/tmp3jwe917v/tmpxqf5vbzp.py", line 1, in <module> S = input() ^^^^^^^ EOFError: EOF when reading a line
s121414412
p04026
u785578220
1553673243
Python
PyPy3 (2.4.0)
py
Runtime Error
165
38384
10
print(2 3)
File "/tmp/tmpxew1vkp0/tmpb9ym13v5.py", line 1 print(2 3) ^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma?
s327489682
p04026
u852038767
1550129741
Python
Python (3.4.3)
py
Runtime Error
1094
3956
401
S = list(input()) S.append("A") for i in range(26): if S.count(chr(97 + i)) >= 2: for j in range(len(S) - 1): if (S[j] == chr(97 + i)) and (S[j + 1] == chr(97 + i)): print((j+1), (j+2)) exit() if (S[j] == chr(97 + i)) and (S[j + 2] == chr(97 + i)): print((j+1), (j+3)) exit() else: print("-1 -1")
Traceback (most recent call last): File "/tmp/tmpz5bs51qt/tmptiqwqs_6.py", line 1, in <module> S = list(input()) ^^^^^^^ EOFError: EOF when reading a line
s735419770
p04026
u852038767
1550129479
Python
Python (3.4.3)
py
Runtime Error
1063
3956
393
S = list(input()) S.append("A") for i in range(26): if S.count(chr(97 + i)) >= 2: for j in range(len(S) - 1): if (S[j] == chr(97 + i)) and (S[j + 1] == chr(97 + i)): print(j+1, j+2) exit() if (S[j] == chr(97 + i)) and (S[j + 2] == chr(97 + i)): print(j+1, j+3) exit() else: print("-1 -1")
Traceback (most recent call last): File "/tmp/tmpey5_cfkj/tmphfeqnavm.py", line 1, in <module> S = list(input()) ^^^^^^^ EOFError: EOF when reading a line
s796899639
p04026
u852038767
1550129054
Python
Python (3.4.3)
py
Runtime Error
1035
3956
391
S = list(input()) S.append(1) for i in range(26): if S.count(chr(97 + i)) >= 2: for j in range(len(S) - 1): if (S[j] == chr(97 + i)) and (S[j + 1] == chr(97 + i)): print(j+1, j+2) exit() if (S[j] == chr(97 + i)) and (S[j + 2] == chr(97 + i)): print(j+1, j+3) exit() else: print("-1 -1")
Traceback (most recent call last): File "/tmp/tmpedod3130/tmpv10k_erp.py", line 1, in <module> S = list(input()) ^^^^^^^ EOFError: EOF when reading a line
s333378161
p04026
u423585790
1547771462
Python
PyPy3 (2.4.0)
py
Runtime Error
178
39280
198
s = input() for i in range(len(s)): if s[i] == s[i + 1] and (s[i + 1] == s[i + 2] or (s[i + 1] != s[i + 2] and s[i + 2] == s[i])): print(i+1, i + 4) quit() print(-1,-1)
Traceback (most recent call last): File "/tmp/tmpfi3vwhso/tmpzdsnhjl4.py", line 1, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s986151713
p04026
u423585790
1547771423
Python
PyPy3 (2.4.0)
py
Runtime Error
179
39280
196
s = input() for i in range(len(s)): if s[i] == s[i + 1] and (s[i + 1] == s[i + 2] or (s[i + 1] != s[i + 2] and s[i + 2] == s[i])): print(i, i + 3) quit() print(-1,-1)
Traceback (most recent call last): File "/tmp/tmp9bp1fula/tmpio7wat04.py", line 1, in <module> s = input() ^^^^^^^ EOFError: EOF when reading a line
s317300108
p04026
u337802798
1538703869
Python
Python (3.4.3)
py
Runtime Error
17
2940
3286
#pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC optimize(3) #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC target("sse3","sse2","sse") #pragma GCC target("avx","sse4","sse4.1","sse4.2","ssse3") #pragma GCC target("f16c") #pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector") #pragma GCC diagnostic error "-fwhole-program" #pragma GCC diagnostic error "-fcse-skip-blocks" #pragma GCC diagnostic error "-funsafe-loop-optimizations" #pragma GCC diagnostic error "-std=c++14" #include "bits/stdc++.h" //#include "ext/pb_ds/tree_policy.hpp" //#include "ext/pb_ds/assoc_container.hpp" #define PB push_back #define PF push_front #define LB lower_bound #define UB upper_bound #define fr(x) freopen(x,"r",stdin) #define fw(x) freopen(x,"w",stdout) #define iout(x) printf("%d\n",x) #define lout(x) printf("%lld\n",x) #define REP(x,l,u) for(ll x = l;x<u;x++) #define RREP(x,l,u) for(ll x = l;x>=u;x--) #define complete_unique(a) a.erase(unique(a.begin(),a.end()),a.end()) #define mst(x,a) memset(x,a,sizeof(x)) #define all(a) a.begin(),a.end() #define PII pair<int,int> #define PLL pair<ll,ll> #define MP make_pair #define sqr(x) ((x)*(x)) #define lowbit(x) (x&(-x)) #define lson (ind<<1) #define rson (ind<<1|1) #define se second #define fi first #define dbg(x) cerr<<#x<<" = "<<(x)<<endl; #define sz(x) ((int)x.size()) #define EX0 exit(0); typedef long long ll; typedef unsigned long long ull; typedef double db; typedef long double ld; using namespace std; typedef vector<ll> VLL; typedef vector<int> VI; const int block_size = 320; typedef complex<ll> point; const ll mod = 1e9+7; const ll inf = 1e9+7; const ld eps = 1e-9; const db PI = atan(1)*4; template<typename T> inline int sign(const T&a) { if(a<0)return -1; if(a>0)return 1; return 0; } template<typename T,typename S>inline bool upmin(T&a,const S&b){return a>b?a=b,1:0;} template<typename T,typename S>inline bool upmax(T&a,const S&b){return a<b?a=b,1:0;} template<typename T> inline void in(T &x) { x = 0; T f = 1; char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); } while (isdigit(ch)) { x = x * 10 + ch - '0'; ch = getchar(); } x *= f; } ll twop(int x) { return 1LL<<x; } template<typename A,typename B > inline void in(A&x,B&y) { in(x); in(y); } template<typename A,typename B,typename C>inline void in(A&x,B&y,C&z) { in(x); in(y); in(z); } template<typename A,typename B,typename C,typename D> inline void in(A&x,B&y,C&z,D&d) { in(x); in(y); in(z); in(d); } ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);} namespace SOLVE { void main(){ } } bool unb(string s){ if(sz(s) == 2)return s[0]==s[1]; else{ sort(all(s)); return s[0]==s[1]||s[1]==s[2]; } } int main() { string s; cin>>s; REP(len,2,4){ REP(i,0,sz(s)-len+1){ if(unb( s.substr(i,len))){ cout<<i+1<<" "<<i+1+len;return 0; } } } cout<<"-1 -1"; return 0; }
File "/tmp/tmpepvev3bp/tmpoid5l3js.py", line 81 return 1LL<<x; ^ SyntaxError: invalid decimal literal
s324679690
p04026
u909643606
1506785171
Python
Python (3.4.3)
py
Runtime Error
62
3188
138
S=input() a=0 for i in range(len(S)-1): if S[i]==S[i+1] or S[i]==S[i+2] : a=1 print(i+1,i+3) break if a==0: print(-1,-1)
Traceback (most recent call last): File "/tmp/tmpcoqv2pbj/tmp14egnm5w.py", line 1, in <module> S=input() ^^^^^^^ EOFError: EOF when reading a line
s145844101
p04026
u813098295
1471144328
Python
Python (2.7.6)
py
Runtime Error
28
2692
449
# coding: utf-8 def count_char_max(text): a = "abcdefghijklmnopqrstuvwxyz" l = [0] * 26 for i in text: ascNum = ord(i.lower()) - 97 if ascNum < 0 or 25 < ascNum: continue l[ascNum] += 1 return max(l) s = raw_input() for i in len(s): if (s[i] == s[i + 1]): print "%d %d" % (i + 1, i + 2) quit() elif (count_char_max(s[i:i+3]) == 2): print "%d %d" % (i + 1, i + 3) quit() print "-1 -1"
File "/tmp/tmpcnodsvl0/tmpnbi1atf5.py", line 24 print "%d %d" % (i + 1, i + 2) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s019638442
p04026
u237168895
1471139763
Python
Python (3.4.3)
py
Runtime Error
37
3064
355
import re tar = input() foo = [0 for i in range(26)] tmp = "abcdefghijklmnopqrstuvwxyz" for i in tmp: b = re.search(i+"."+i,tar) if b: print (str(b.start()+1)+” " + str(b.start() + 3)) quit() b = re.search(str(i)+str(i),tar) if b: print (str(b.start()+1)+ " " + str(b.start() + 3)) quit() print("-1 -1")
File "/tmp/tmphy1y4ydd/tmpadg6s57t.py", line 9 print (str(b.start()+1)+” " + str(b.start() + 3)) ^ SyntaxError: invalid character '”' (U+201D)
s506142701
p04026
u509661905
1471139458
Python
PyPy3 (2.4.0)
py
Runtime Error
514
51688
655
#!/usr/bin/env pypy3 import collections import itertools MAX_S = 100 NO_SOL = (-1, -1) def is_unbalanced(s): ctr = collections.Counter(s) total = sum(ctr.values()) m = max(ctr.values()) return m >= total // 2 + 1 def find_unbalanced_substr(s): l = len(s) for start, end in itertools.combinations(range(l), 2): if is_unbalanced(s[start:end + 1]): return start, end return NO_SOL def main(): s = input() assert len(s) <= MAX_S ans = find_unbalanced_substr(s) if ans == NO_SOL: print(*ans) else: print(*(x + 1 for x in ans)) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmp763k0hj3/tmpciyut3k8.py", line 37, in <module> main() File "/tmp/tmp763k0hj3/tmpciyut3k8.py", line 27, in main s = input() ^^^^^^^ EOFError: EOF when reading a line
s295566105
p04026
u707500405
1471138681
Python
PyPy2 (5.6.0)
py
Runtime Error
159
12272
402
from collections import deque S = [ord(a)-97 for a in raw_input()] N = len(S) for c in xrange(26): ls = deque() for i in xrange(N-1): if S[i] == c: l = i break else: continue cnt = 1 for r in xrange(l+1,N): if S[r] == c: cnt += 1 ls.append(r) if cnt * 2 > r - l + 1: print l+1,r+1 quit() else: if cnt * 2 < r - l + 1: l = ls.popleft() cnt -= 1 print -1,-1
File "/tmp/tmpid157k7e/tmp4pw_tv94.py", line 18 print l+1,r+1 ^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s102782653
p04026
u315078622
1471137157
Python
Python (3.4.3)
py
Runtime Error
228
4024
275
import string S = input() N = len(S) assert(len(S) <= 100) for i in range(N): for j in range(i, N): s = S[i:j+1] if len(s) > 1 and any(s.count(a) * 2 > j-i+1 for a in string.ascii_lowercase): print(i+1, j+1) quit(0) print(-1, -1)
Traceback (most recent call last): File "/tmp/tmpykd2ah21/tmp60bwgfst.py", line 2, in <module> S = input() ^^^^^^^ EOFError: EOF when reading a line
s762314167
p04027
u368780724
1574999688
Python
PyPy3 (2.4.0)
py
Runtime Error
165
38256
611
for _ in range(test_case): import sys from itertools import accumulate readline = sys.stdin.readline MOD = 10**9+7 N, C = map(int, readline().split()) A = [0] + list(map(int, readline().split())) B = [0] + list(map(int, readline().split())) acsq = [list(accumulate([pow(i, j, MOD) for i in range(max(B)+1)])) for j in range(C+1)] dp = [[0]*(C+1) for _ in range(N+1)] dp[0][0] = 1 for i in range(1, N+1): a, b = A[i], B[i] for c in range(C+1): res = 0 for j in range(c+1): res = (res + (acsq[c-j][b] - acsq[c-j][a-1])*dp[i-1][j]) % MOD dp[i][c] = res print(dp[N][C])
File "/tmp/tmp6u86aykc/tmph0cg2l7x.py", line 2 import sys ^ IndentationError: expected an indented block after 'for' statement on line 1
s289512363
p04027
u892251744
1574880737
Python
PyPy3 (2.4.0)
py
Runtime Error
2333
44012
664
N, C = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) mod = 10**9+7 acc = [[0] for _ in range(401)] for i in range(401): for j in range(1, C+2): acc[i].append(((acc[i][-1] + pow(j, i, mod)) % mod)) dp = [[0 for _ in range(C+1)] for _ in range(N+1)] dp[0][0] = 1 for i in range(N): for candy_cur in range(C+1): for candy_plus in range(C - candy_cur+1): dp[i+1][candy_cur + candy_plus] = (dp[i+1][candy_cur + candy_plus] + (dp[i][candy_cur]\ * ((acc[candy_plus][B[i]] - acc[candy_plus][A[i]-1])%mod)%mod)) % mod print(dp[-1][C])
Traceback (most recent call last): File "/tmp/tmpd95b802e/tmpoyuw82rw.py", line 1, in <module> N, C = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s550205619
p04027
u892251744
1574863766
Python
PyPy3 (2.4.0)
py
Runtime Error
4209
96448
634
N, C = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) mod = 10**9+7 acc = [[0] for _ in range(401)] for i in range(401): for j in range(1, C+2): acc[i].append(acc[i][-1] + j ** i) dp = [[0 for _ in range(C+1)] for _ in range(N+1)] dp[0][0] = 1 for i in range(N): for candy_cur in range(C+1): for candy_plus in range(C - candy_cur+1): dp[i+1][candy_cur + candy_plus] = (dp[i+1][candy_cur + candy_plus] + dp[i][candy_cur]\ * (acc[candy_plus][B[i]] - acc[candy_plus][A[i]-1])) % mod print(dp[-1][C])
Traceback (most recent call last): File "/tmp/tmpozs0pnys/tmphqeve5o5.py", line 1, in <module> N, C = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s231205491
p04027
u077337864
1570885896
Python
PyPy3 (2.4.0)
py
Runtime Error
1348
43124
811
import sys input = sys.stdin.readline sys.setrecursionlimit(pow(10, 6)) MOD = pow(10, 9) + 7 def main(): n, c = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) assert(a==b) dp = [[0 for _ in range(c+1)] for _ in range(n+1)] for i in range(n+1): dp[i][0] = 1 pow_table = [[1 for _ in range(401)] for _ in range(n)] for i in range(1, 401): for j in range(n): pow_table[j][i] = pow_table[j][i-1]*a[j]%MOD for i in range(1, n+1): for j in range(1, c+1): for k in range(j+1): dp[i][j] += dp[i-1][j-k] * pow_table[i-1][k] % MOD if dp[i][j] >= MOD: dp[i][j] -= MOD print(dp[n][c]) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmp6u9f54tp/tmpogpcg47d.py", line 30, in <module> main() File "/tmp/tmp6u9f54tp/tmpogpcg47d.py", line 8, in main n, c = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s781945277
p04027
u077337864
1570885723
Python
PyPy3 (2.4.0)
py
Runtime Error
4207
60508
747
import sys input = sys.stdin.readline sys.setrecursionlimit(pow(10, 6)) MOD = pow(10, 9) + 7 def main(): n, c = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) assert(a==b) dp = [[0 for _ in range(c+1)] for _ in range(n+1)] for i in range(n+1): dp[i][0] = 1 pow_table = [[1 for _ in range(401)] for _ in range(n)] for i in range(1, 401): for j in range(n): pow_table[j][i] = pow_table[j][i-1]*a[j]%MOD for i in range(1, n+1): for j in range(1, c+1): for k in range(j+1): dp[i][j] += (dp[i-1][j-k] * pow_table[i-1][k] % MOD) % MOD print(dp[n][c]) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmp7m68eqgn/tmpicbrhlol.py", line 28, in <module> main() File "/tmp/tmp7m68eqgn/tmpicbrhlol.py", line 8, in main n, c = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s767872777
p04027
u077337864
1570885117
Python
PyPy3 (2.4.0)
py
Runtime Error
4207
50560
571
import sys input = sys.stdin.readline sys.setrecursionlimit(pow(10, 6)) MOD = pow(10, 9) + 7 def main(): n, c = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) assert(a==b) dp = [[0 for _ in range(c+1)] for _ in range(n+1)] for i in range(n+1): dp[i][0] = 1 for i in range(1, n+1): for j in range(1, c+1): for k in range(j+1): dp[i][j] += (dp[i-1][j-k] * pow(a[i-1], k, MOD)) % MOD print(dp[n][c]) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmppkm53lth/tmp68m17a4k.py", line 24, in <module> main() File "/tmp/tmppkm53lth/tmp68m17a4k.py", line 8, in main n, c = map(int, input().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s384905524
p04027
u415905784
1568649872
Python
Python (3.4.3)
py
Runtime Error
17
2940
1116
package main import ( "fmt" "math" ) func max(M *[]int) (ret int) { ret = (*M)[0] for _, m := range (*M) { if ret < m { ret = m } } return } func main() { var N, C int fmt.Scan(&N, &C) A := make([]int, N) B := make([]int, N) p := int64(math.Pow(10, 9) + 7) var x int for i := 0; i < N; i++ { fmt.Scan(&x) A[i] = x } for i := 0; i < N; i++ { fmt.Scan(&x) B[i] = x } B_max := max(&B) X := make([][]int64, C + 2) for i := 0; i < C + 2; i++ { X[i] = make([]int64, B_max + 1) } for j := 1; j < B_max + 1; j++ { X[0][j] = 1 } for i := 0; i < C + 1; i++ { for j := 1; j < B_max + 1; j++ { X[i + 1][j] = (X[i][j] * int64(j)) % p X[i][j] += X[i][j - 1] } } DP := make([][]int64, N + 1) for i := 0; i < N + 1; i++ { DP[i] = make([]int64, C + 1) } DP[0][0] = 1 for i := 1; i < N + 1; i++ { for j := 0; j < C + 1; j++ { for k := 0; k < j + 1; k++ { DP[i][j] += (DP[i - 1][j - k] * (X[k][B[i - 1]] - X[k][A[i - 1] - 1])) % p } DP[i][j] %= p } } fmt.Println(DP[N][C]) }
File "/tmp/tmpne_528oy/tmpr6efbw7m.py", line 1 package main ^^^^ SyntaxError: invalid syntax
s832379031
p04027
u102461423
1562859438
Python
Python (3.4.3)
py
Runtime Error
166
22044
1011
import sys input = sys.stdin.readline import numpy as np MOD = 10 ** 9 + 7 N,C = map(int,input().split()) A = [int(x) for x in input().split()] B = [int(x) for x in input().split()] # (i,j) に j^i を入れる kth_pow = np.ones((1024, 401), dtype=np.int64) rng = np.arange(401, dtype=np.int64) for i in range(1,C+1): kth_pow[i] = kth_pow[i-1] * rng % MOD kth_pow_cum = kth_pow.cumsum(axis = 1) % MOD kth_pow_cum[C+1:] = 0 def convolve(A,B,n=32): if n == 8: return np.rint(np.fft.irfft(np.fft.rfft(A) * np.fft.rfft(B))).astype(np.int64) n //= 2 M = 1 << n A1,A2 = np.divmod(A,M) B1,B2 = np.divmod(B,M) X = convolve(A1,B1,n) Y = convolve(A1-A2,B1-B2,n) Z = convolve(A2,B2,n) return (X * (M * M % MOD) + (X + Z - Y) * M + Z) % MOD dp = np.zeros(1024, dtype=np.int64) # これまで配った個数、合計点 dp[0] = 1 for a,b in zip(A,B): arr = kth_pow_cum[:,b] - kth_pow_cum[:,a-1] dp = convolve(dp,arr) dp[C+1:] = 0 answer = dp[C] print(answer)
Traceback (most recent call last): File "/tmp/tmpza4y95wt/tmp59byxua8.py", line 7, in <module> N,C = map(int,input().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s797412608
p04027
u102461423
1562859338
Python
Python (3.4.3)
py
Runtime Error
167
22044
1011
import sys input = sys.stdin.readline import numpy as np MOD = 10 ** 9 + 7 N,C = map(int,input().split()) A = [int(x) for x in input().split()] B = [int(x) for x in input().split()] # (i,j) に j^i を入れる kth_pow = np.ones((1024, 401), dtype=np.int64) rng = np.arange(401, dtype=np.int64) for i in range(1,C+1): kth_pow[i] = kth_pow[i-1] * rng % MOD kth_pow_cum = kth_pow.cumsum(axis = 1) % MOD kth_pow_cum[C+1:] = 0 def convolve(A,B,n=32): if n == 8: return np.rint(np.fft.irfft(np.fft.rfft(A) * np.fft.rfft(B))).astype(np.int64) n //= 2 M = 1 << n A1,A2 = np.divmod(A,M) B1,B2 = np.divmod(B,M) X = convolve(A1,B1,n) Y = convolve(A1-A2,B1-B2,n) Z = convolve(A2,B2,n) return (X * (M * M % MOD) + (X + Z - Y) * M + Z) % MOD dp = np.zeros(1024, dtype=np.int64) # これまで配った個数、合計点 dp[0] = 1 for a,b in zip(A,B): arr = kth_pow_cum[:,b] - kth_pow_cum[:,a-1] dp = convolve(dp,arr) dp[C+1:] = 0 answer = dp[C] print(answer)
Traceback (most recent call last): File "/tmp/tmpmivwx1i9/tmpppjjwp92.py", line 7, in <module> N,C = map(int,input().split()) ^^^ ValueError: not enough values to unpack (expected 2, got 0)
s350858596
p04027
u726693690
1471717852
Python
Python (3.4.3)
py
Runtime Error
244
12248
676
import numpy as np import sys import itertools # スペース区切りの整数の入力 n, c = [int(i) for i in sys.stdin.readline().split()] a = [int(i) for i in sys.stdin.readline().split()] b = [int(i) for i in sys.stdin.readline().split()] memo = {} def f_i(x, c): global memo if len(x) == 1: return x[0]**c if str((x, c)) not in memo: memo[str((x, c))] = sum([ (x[0]**i) * f_i(x[1:], c-i) for i in xrange(c + 1)]) return memo[str((x, c))] def f(x, c): return f_i(x, c) ranges = [ [ i for i in xrange(a_i, b_i + 1)] for a_i, b_i in zip(a, b)] print(sum([f(x, c) for x in itertools.product(*ranges)]) % (1000000000+7))
Traceback (most recent call last): File "/tmp/tmp6p02bcv5/tmpoh5it1la.py", line 6, in <module> n, c = [int(i) for i in sys.stdin.readline().split()] ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s313330535
p04028
u218843509
1525712752
Python
PyPy2 (5.6.0)
py
Runtime Error
38
28652
376
MOD = (10 ** 9) + 7 N = int(input()) s = list(input()) dp = [[0 for i in range(N + 1)] for j in range(N + 1)] for i in range(N + 1): dp[i][i] = 1 for i in range(N): dp[i][i + 1] = 1 for n in range(1, N + 1): dp[n][0] = (dp[n - 1][0] + 2 * dp[n - 1][1]) % MOD for l in range(1, n): dp[n][l] = (dp[n - 1][l - 1] + 2 * dp[n - 1][l + 1]) % MOD print(dp[N - 1][len(s)])
Traceback (most recent call last): File "/tmp/tmprsjll2a3/tmp4be9awpa.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s454681828
p04028
u218843509
1525581986
Python
Python (3.4.3)
py
Runtime Error
2124
281972
364
MOD = (10 ** 9) + 7 N = int(input()) s = list(input()) dp = [[0 for i in range(N)] for j in range(N)] for i in range(N): dp[i][i] = 1 for i in range(N - 1): dp[i][i + 1] = 1 for n in range(1, N): dp[n][0] = (dp[n - 1][0] + 2 * dp[n - 1][1]) % MOD for l in range(1, n): dp[n][l] = (dp[n - 1][l - 1] + 2 * dp[n - 1][l + 1]) % MOD print(dp[N - 1][len(s)])
Traceback (most recent call last): File "/tmp/tmpmtzamx1p/tmp7zsrrh1_.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s326128023
p04028
u526532903
1513795601
Python
Python (3.4.3)
py
Runtime Error
17
2940
950
#include<bits/stdc++.h> #define range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) for(int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; //const int INF = 1e8; using namespace std; const long long M = 1000000007; //x^n mod M typedef long long ull; ull power(ull x, ull n){ ull res = 1; if(n > 0){ res = power(x, n / 2); if(n % 2 == 0) res = (res * res) % M; else res = (((res * res) % M) * x ) %M; } return res; } int main(){ int n; string s; cin >> n >> s; vector<long long> dp(n + 1, 0); dp[0] = 1; rep(i,n){ vector<long long> _dp(n + 1, 0); rep(j,n + 1){ if(j == 0) (_dp[j] += dp[j]) %= M; else (_dp[j - 1] += dp[j]) %= M; (_dp[j + 1] += dp[j] * 2LL) %= M; } dp = _dp; //for(auto j : dp){ for(auto k : j){ cout << k << ' '; } cout << endl; } cout << endl; } cout << dp[s.size()] * power(power(2,s.size()), M - 2) % M << endl; }
File "/tmp/tmprb3j0qyb/tmpmhfpaxcj.py", line 35 (_dp[j + 1] += dp[j] * 2LL) %= M; ^ SyntaxError: invalid decimal literal
s976082587
p04029
u401183062
1601222574
Python
Python (3.8.2)
py
Runtime Error
24
8904
160
def iroha(): count = int(input()) result = 0 for i in range(count+1): result += i print(result) if __name__ == "__main__": iroha(
File "/tmp/tmpf46lna8i/tmp3kyyw0_t.py", line 11 iroha( ^ SyntaxError: '(' was never closed
s280702683
p04029
u401183062
1601222428
Python
Python (3.8.2)
py
Runtime Error
26
8948
121
count = int(input()) result = 0 for i in range(count+1): print(i) result += i print(result
File "/tmp/tmp8ga1ouhl/tmp8giiigpe.py", line 1 count = int(input()) IndentationError: unexpected indent
s763647030
p04029
u847033024
1599833494
Python
Python (3.8.2)
py
Runtime Error
20
8844
34
n = input() print(n * (n + 1) / 2)
Traceback (most recent call last): File "/tmp/tmpt4laman4/tmpag0rj4q_.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s268787857
p04029
u918422508
1599811224
Python
Python (3.8.2)
py
Runtime Error
23
8892
26
N=input() print(N*(N+1)/2)
Traceback (most recent call last): File "/tmp/tmph3g6wyuc/tmpx01ez1lh.py", line 1, in <module> N=input() ^^^^^^^ EOFError: EOF when reading a line