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
s162517109
p02572
u806988802
1598730469
Python
Python (3.8.2)
py
Runtime Error
88
31332
193
n = input() max = 10**9 + 7 a_list = [int(a) % max for a in input().split(" ")] sum = 0 for i in range(0, len(a_list)-1): sum += a_list[i] * sum(a_list[i+1:]) sum = sum % max print(sum)
Traceback (most recent call last): File "/tmp/tmp008wn4ds/tmph2ul5pc7.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s239837668
p02572
u454649802
1598730441
Python
Python (3.8.2)
py
Runtime Error
2232
1004520
284
import sys input = sys.stdin.readline n = int(input()) num = list(map(int, input().split())) mod = 10**9+7 def rec(num): if len(num) == 2: return num[0] * num[1] else: sum_ = num[0] * sum(num[1:]) return sum_ + rec(num[1:]) print(pow(rec(num),1, mod))
Traceback (most recent call last): File "/tmp/tmp7ib8oct8/tmpwett5uj4.py", line 3, in <module> n = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s177532843
p02572
u329730886
1598730416
Python
Python (3.8.2)
py
Runtime Error
1569
1822420
323
import numpy as np N = int(input()) A = np.asarray(input().split()).astype(np.int) ''' ans = 0 for i in range(N): pA = A[i] * A[i+1:] ans += pA.sum() print(int(ans % (1e9+7))) ''' a = np.tile(A,(N, 1)) a = a * a.T a_diag = np.diag(a).sum() a = ((a.sum()-a_diag)/2) #print(a/10e9+7) print(int(np.mod(a, 10**9+7...
Traceback (most recent call last): File "/tmp/tmpzfov5p68/tmpmchrweap.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s318999496
p02572
u199201328
1598730408
Python
Python (3.8.2)
py
Runtime Error
24
8812
496
#include<bits/stdc++.h> using namespace std; #define lli long long int #define p push_back #define fast ios_base::sync_with_stdio(false);cin.tie(NULL); #define endl "\n" void solve(){ lli n; cin>>n; vector<lli>a; for(lli i=0;i<n;i++){ lli s; cin>>s; a.p(s); } lli sum=0...
File "/tmp/tmp3g44rpvj/tmpb4rlr_t5.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s371691472
p02572
u060505280
1598730382
Python
Python (3.8.2)
py
Runtime Error
1728
2720204
238
import numpy as np N = int(input()) numbers = np.array(list(map(int, input().split())), dtype=int) xx, yy = np.meshgrid(numbers, numbers) times = xx * yy eye = (np.eye(3) + 1) % 2 times_sum = (times * eye / 2).sum() print(int(times_sum))
Traceback (most recent call last): File "/tmp/tmp9y0dkg9l/tmp10pnalt2.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s562164723
p02572
u359641414
1598730381
Python
PyPy3 (7.3.0)
py
Runtime Error
2208
94304
308
n = int(input()) a = list(map(int,input().split())) max = (10 ** 9) + 7 sum = 0 for i in range (n-1): for j in range (n): if i > j: continue if i != j: sum += a[i]*a[j] # if sum > max: # sum - max if sum > max: ans = sum % max print(ans)
Traceback (most recent call last): File "/tmp/tmpzjyaqrsl/tmpy6trfa87.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s236280230
p02572
u059238013
1598730357
Python
Python (3.8.2)
py
Runtime Error
2224
1689756
296
#C import numpy as np n = int(input()) a_ls = list(map(int, input().split())) a_ls = (np.array([a_ls]))%(10**9+7) a_ls2 = (np.array(a_ls).T) tmp = np.dot(a_ls2, a_ls)%(10**9+7) tmp = np.tril(tmp) ans = (np.sum(tmp)%(10**9+7) - np.sum(np.diag(tmp))%(10**9+7)) % 10**9+7 ans = int(ans) print(ans)
Traceback (most recent call last): File "/tmp/tmpb4n7mceo/tmpccxxkd1g.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s564766460
p02572
u454649802
1598730292
Python
Python (3.8.2)
py
Runtime Error
2239
960936
246
n = int(input()) num = list(map(int, input().split())) mod = 10**9+7 def rec(num): if len(num) == 2: return num[0] * num[1] else: sum_ = num[0] * sum(num[1:]) return sum_ + rec(num[1:]) print(pow(rec(num),1, mod))
Traceback (most recent call last): File "/tmp/tmp7crp3t2x/tmpvsp4_qn9.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s941543944
p02572
u878739773
1598730275
Python
Python (3.8.2)
py
Runtime Error
37
13152
340
def findProductSum(A,n): product = 0 for i in range (n): for j in range ( i+1,n): product = product + A[i]*A[j] return product # Driver code if __name__=="__main__": A=[] n = int(input()) for i in range(n): a=int(input()) A.append(a) print( fi...
Traceback (most recent call last): File "/tmp/tmpjhfx5sl8/tmp2n2hj4ns.py", line 13, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s466739927
p02572
u352513183
1598730272
Python
PyPy3 (7.3.0)
py
Runtime Error
103
92032
155
n = int(input()) a = map(int, input().split()) m = (10**9 + 7) result = [(a[i]*a[j])%m for i in range(n) for j in range(n) if i < j] print(sum(result)%m)
Traceback (most recent call last): File "/tmp/tmpm7o5sdgj/tmpa9ezf1c2.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s335296644
p02572
u454656015
1598730260
Python
Python (3.8.2)
py
Runtime Error
29
8952
147
N=int(int(input)) A=list(map(int,input().split())) sum=sum[A] b=0 c=0 for i in range(N-1): b+=A[i] c=(c+(A[i]*(sum-b))) %(10**9+7) print(c)
Traceback (most recent call last): File "/tmp/tmp0and67s4/tmpmdij8t8i.py", line 1, in <module> N=int(int(input)) ^^^^^^^^^^ TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'
s292705130
p02572
u506422818
1598730255
Python
Python (3.8.2)
py
Runtime Error
29
8852
518
import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = Integer.parseInt(sc.nextLine()),sm = 0; String[] a = sc.nextLine().split(" "); for (int i = 0;i < a.length;i++){ for (int j...
File "/tmp/tmp6lvjijrd/tmpfiscbolk.py", line 1 import java.util.*; ^ SyntaxError: invalid syntax
s121816752
p02572
u474461530
1598730179
Python
Python (3.8.2)
py
Runtime Error
41
13320
468
def findProductSum(A, n): array_sum = 0 for i in range(n): array_sum = array_sum + A[i] array_sum_square = array_sum * array_sum individual_square_sum = 0 for i in range(n): individual_square_sum += A[i] * A[i] return ((array_sum_square-individual_square_sum)/2)%1000000007 if...
Traceback (most recent call last): File "/tmp/tmpxgnhcz6x/tmpg2fxzx4a.py", line 12, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s581453302
p02572
u392331162
1598730163
Python
Python (3.8.2)
py
Runtime Error
39
13296
736
def findProductSum(A, n): # calculating array sum (a1 + a2 ... + an) array_sum = 0 for i in range(0, n, 1): array_sum = array_sum + A[i] # calcualting square of array sum # (a1 + a2 + ... + an)^2 array_sum_square = array_sum * array_sum # calcualting a1^2 + a2^2 +...
Traceback (most recent call last): File "/tmp/tmpll12mhub/tmplb6ae4dz.py", line 31, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s565546941
p02572
u970082363
1598730162
Python
Python (3.8.2)
py
Runtime Error
22
9220
559
n,m = (int(x) for x in input().split()) friendlist = [0]*n classes = 1 for i in range(m): a,b = (int(x)-1 for x in input().split()) if friendlist[a]!=0 and friendlist[b]!=0: continue elif friendlist[a]!=0: friendlist[b] = friendlist[a] elif friendlist[b]!=0: friendlist[a] = frien...
Traceback (most recent call last): File "/tmp/tmpz9gxe3aq/tmpehxrmoxb.py", line 1, in <module> n,m = (int(x) for x in input().split()) ^^^^^^^ EOFError: EOF when reading a line
s628300700
p02572
u105290050
1598730117
Python
PyPy3 (7.3.0)
py
Runtime Error
134
94340
168
n=int(input()) l=list(map(int, input().split())) ans=sum(l)**2 sq=0 for i in range(n): sq+=l[i]**2 ans=(ans-sq)/2 import numpy as np print(int(np.mod(ans, 10**9+7)))
Traceback (most recent call last): File "/tmp/tmp1xwuvjk3/tmpntigbfgo.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s105384168
p02572
u531456543
1598730112
Python
Python (3.8.2)
py
Runtime Error
2206
31864
488
n= int(input()) lst = [int(i) for i in input().split()] lst = sorted(lst) count = 0 d_lst = [] for i in range(len(lst)): for j in range(i+1,len(lst)): # print(i,j) a = lst[i] * lst[j] if lst[j] in d_lst: continue else: if lst[i] == lst[j]: d_lst.ap...
Traceback (most recent call last): File "/tmp/tmpwyv932tz/tmpb6j_h274.py", line 1, in <module> n= int(input()) ^^^^^^^ EOFError: EOF when reading a line
s492393192
p02572
u013864607
1598730105
Python
Python (3.8.2)
py
Runtime Error
72
31736
140
N = input() As = list(map(int, input().split())) result = 0 for i in range(N-1): result+=As[i]*sum(As[i+1:]) print(result%(1*10**9+7))
Traceback (most recent call last): File "/tmp/tmpfci7aunz/tmpsn5b523z.py", line 1, in <module> N = input() ^^^^^^^ EOFError: EOF when reading a line
s234982725
p02572
u054416810
1598730090
Python
Python (3.8.2)
py
Runtime Error
27
9012
444
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; using ll = long long; int solve(const vector<ll>& A, ll n) { ll sum = A[0]; ll res = 0; for(int i=1; i<n; i++) { res = (res + (sum * A[i]) % mod) % mod; sum = (sum + A[i]) % mod; } return res; } int32_t mai...
File "/tmp/tmpc7gg6uab/tmpnvsvqy9h.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s596404326
p02572
u454656015
1598730088
Python
Python (3.8.2)
py
Runtime Error
31
9068
147
N=int(int(input)) A=list(map(int,input().split())) sum=sum[A] b=0 c=0 for i in range(N-1): b+=A[i] c=(c+(A[i]*(sum-b))) %(10**9+7) print(c)
Traceback (most recent call last): File "/tmp/tmpr6xok76_/tmpi8w7imhm.py", line 1, in <module> N=int(int(input)) ^^^^^^^^^^ TypeError: int() argument must be a string, a bytes-like object or a real number, not 'builtin_function_or_method'
s780673367
p02572
u054966391
1598730060
Python
Python (3.8.2)
py
Runtime Error
71
31468
147
n=int(input()) l=list(map(int,input().split())) for i in range(len(l)): for j in range(i+1,len(l)): s=s+(l[i]*l[j]) print(s%((10**9)+7))
Traceback (most recent call last): File "/tmp/tmpwvplmo5s/tmpc3_b81na.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s809247186
p02572
u372501464
1598730044
Python
Python (3.8.2)
py
Runtime Error
2213
925200
227
import numpy as np N = int(input()) A_list = list(map(int,input().split())) np_al = np.array(A_list) dot = np.outer(np_al, np_al) s = 0 for i in range(N): for j in range(i+1, N): s += dot[i, j] print(s%(10**9+7))
Traceback (most recent call last): File "/tmp/tmpqumn7yz4/tmprq5cf0m6.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s544464601
p02572
u347502437
1598730024
Python
Python (3.8.2)
py
Runtime Error
22
8996
176
ut()) A = list(input().split()) B = [int(a) for a in A] x = 10**9+7 summation = sum((B[i] * (sum(B[j] for j in range(i+1,N)) % x)) % x for i in range(N-1)) % x print(summation)
File "/tmp/tmpoqamy8tu/tmpac6nq7gi.py", line 1 ut()) ^ SyntaxError: unmatched ')'
s570528838
p02572
u454649802
1598730018
Python
Python (3.8.2)
py
Runtime Error
2240
959208
219
n = int(input()) num = list(map(int, input().split())) def rec(num): if len(num) == 2: return num[0] * num[1] sum_ = num[0] * sum(num[1:]) return sum_ + rec(num[1:]) print(rec(num) % 1000000007)
Traceback (most recent call last): File "/tmp/tmpdy6dkwo5/tmp1d0n8f2r.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s330448843
p02572
u777800738
1598729982
Python
Python (3.8.2)
py
Runtime Error
117
27176
161
import numpy as np t=np.array(input().split(' ')) num=np.zeros(n) for a in range(n): num[a]=int(t[a]) a=np.sum(num)**2 b=np.sum(num**2) x=(a-b)/2 print(int(x))
Traceback (most recent call last): File "/tmp/tmpov83p6ml/tmpgcbfn_hv.py", line 2, in <module> t=np.array(input().split(' ')) ^^^^^^^ EOFError: EOF when reading a line
s562188362
p02572
u054416810
1598729981
Python
Python (3.8.2)
py
Runtime Error
22
8996
444
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; using ll = long long; int solve(const vector<ll>& A, ll n) { ll add = A[0]; ll res = 0; for(int i=1; i<n; i++) { res = (res + (add * A[i]) % mod) % mod; add = (add + A[i]) % mod; } return res; } int32_t mai...
File "/tmp/tmp285yifgc/tmp3aghroq1.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s407102450
p02572
u258355189
1598729975
Python
Python (3.8.2)
py
Runtime Error
2482
153048
465
s = int(input()) num = input() num = num.split() for i in range(s): num[i] = int(num[i]) ans = [] count = 0 while count != s-1: print("count is " + str(count) + "s is" + str(s)) print("now k : " + str(num[0])) k = num[0] for j in range(s - count -1): print(num[j+1]) ans.append( k...
Traceback (most recent call last): File "/tmp/tmp4i0irhbj/tmpdh0e44vf.py", line 1, in <module> s = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s991879988
p02572
u328179275
1598729947
Python
Python (3.8.2)
py
Runtime Error
1911
923920
307
def sum_a(array): total = 0 for i in range(len(array)): total += array[i]**2 return(total) n = int(input()) a = list(map(int,input().split())) import numpy as np b = a.copy() c = np.array(a) d = np.array(b) e = np.outer(c,d) f = np.sum(e) g = sum_a(a) print((int((f-g)/2)%(10**9+7)))
Traceback (most recent call last): File "/tmp/tmpuo2sgotr/tmpyh5l68xh.py", line 7, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s299534438
p02572
u474461530
1598729927
Python
Python (3.8.2)
py
Runtime Error
38
13168
486
def findProductSum(A, n): array_sum = 0 for i in range(0, n, 1): array_sum = array_sum + A[i] array_sum_square = array_sum * array_sum individual_square_sum = 0 for i in range(0, n, 1): individual_square_sum += A[i] * A[i] return ((array_sum_square-individual_square_sum)/2)%10...
Traceback (most recent call last): File "/tmp/tmpsj1daxb3/tmpnry6zx3o.py", line 12, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s585087564
p02572
u213497190
1598729870
Python
Python (3.8.2)
py
Runtime Error
29
9084
115
sum_ = 0 temp = 0 for i in range(len(a)-1): temp += a[-i-1] sum_ += temp * a[-i-2] print(sum_%(10**9 + 7))
Traceback (most recent call last): File "/tmp/tmptlygk3ho/tmpss53g93_.py", line 3, in <module> for i in range(len(a)-1): ^ NameError: name 'a' is not defined
s891246359
p02572
u631521893
1598729833
Python
Python (3.8.2)
py
Runtime Error
23
8964
469
def sum(a, n): cnt = dict() ans = 0 pre_sum = 0 for i in range(n): ans += (i * a[i]) - pre_sum pre_sum += a[i] if (a[i] - 1) in cnt: ans -= cnt[a[i] - 1] if (a[i] + 1) in cnt: ans += cnt[a[i] + 1] if a[i] not in cnt: ...
File "/tmp/tmp4bka9i8e/tmp6g1h8anf.py", line 21 n = int(input()) ^ IndentationError: unindent does not match any outer indentation level
s261141085
p02572
u059238013
1598729801
Python
Python (3.8.2)
py
Runtime Error
2223
1812256
251
#C import numpy as np n = int(input()) a_ls = list(map(int, input().split())) a_ls = (np.array([a_ls]))%(10**9+7) a_ls2 = (np.array(a_ls).T) tmp = np.dot(a_ls2, a_ls)%(10**9+7) ans = int(((np.sum(tmp) - np.sum(np.diag(tmp)))/2)%(10**9+7)) print(ans)
Traceback (most recent call last): File "/tmp/tmpp3gtzdfw/tmpeo3z4v0h.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s868826234
p02572
u446250610
1598729785
Python
Python (3.8.2)
py
Runtime Error
27
8896
820
# Efficient python 3 program to find sum # pair products in an array. # required function def findProductSum(A, n): # calculating array sum (a1 + a2 ... + an) array_sum = 0 for i in range(0, n, 1): array_sum = array_sum + A[i] # calcualting square of array sum # (a1 + a2 + ... + an)^2 array_sum_squ...
File "/tmp/tmp7eeso5f4/tmpx04mgfyh.py", line 29 A = list(map(int,input().strip().split()))[:n] TabError: inconsistent use of tabs and spaces in indentation
s659361978
p02572
u328179275
1598729758
Python
Python (3.8.2)
py
Runtime Error
983
924160
305
def sum_a(array): total = 0 for i in range(len(array)): total += array[i]**2 return(total) n = int(input()) a = list(map(int,input().split())) import numpy as np c = np.array(a) d = np.array(a) e = np.outer(c,d) f = np.sum(e) g = sum_a(a) h = int((f-g)/2) p = h%(10**9+7) print(p)
Traceback (most recent call last): File "/tmp/tmpji5259_l/tmp4jts22bu.py", line 7, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s207721462
p02572
u696824876
1598729754
Python
PyPy3 (7.3.0)
py
Runtime Error
107
74588
165
n=int(input()) s=input() p=list(s.split()) s1=0 s2=0 for i in range(0,n) s1=s1+int(p[i]) s2=s2+(int(p[i])*int(p[i])) k= ((s1**2)-s2)//2 k=k%1000000007 print(k)
File "/tmp/tmpqotna7e4/tmpdusirhni.py", line 6 for i in range(0,n) ^ SyntaxError: expected ':'
s291375110
p02572
u806988802
1598729752
Python
Python (3.8.2)
py
Runtime Error
23
9056
230
n = input() a_list = input().split(" ") b = [int(a) for a in a_list] max = 10**9 + 7 sum = 0 for i in range(0, len(b)-2): for j in range(i+1, len(b)-1): sum += b[i] * b[j] while sum => max: sum -= max print(sum)
File "/tmp/tmpub76sso3/tmp5fz6049e.py", line 11 while sum => max: ^ SyntaxError: invalid syntax
s049190481
p02572
u446250610
1598729733
Python
Python (3.8.2)
py
Runtime Error
23
8776
809
# Efficient python 3 program to find sum # pair products in an array. # required function def findProductSum(A, n): # calculating array sum (a1 + a2 ... + an) array_sum = 0 for i in range(0, n, 1): array_sum = array_sum + A[i] # calcualting square of array sum # (a1 + a2 + ... + an)^2 array_sum_squ...
File "/tmp/tmp85amm5uv/tmp69t7zvf0.py", line 29 A = list(map(int,input().strip().split()))[:n] TabError: inconsistent use of tabs and spaces in indentation
s654568836
p02572
u059238013
1598729726
Python
Python (3.8.2)
py
Runtime Error
1362
924500
241
#C import numpy as np n = int(input()) a_ls = list(map(int, input().split())) a_ls = (np.array([a_ls]))%(10**9+7) a_ls2 = (np.array(a_ls).T) tmp = np.dot(a_ls2, a_ls) ans = int(((np.sum(tmp) - np.sum(np.diag(tmp)))/2)%(10**9+7)) print(ans)
Traceback (most recent call last): File "/tmp/tmpw_34l7yj/tmp9etmiw0d.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s387081622
p02572
u696824876
1598729701
Python
Python (3.8.2)
py
Runtime Error
26
9032
173
n=int(input()) s=input() p=list(s.split()) s1=0 s2=0 for i in range(0,n) s1=s1+int(p[i]) s2=s2+(int(p[i])*int(p[i])) k= ((s1**2)-s2)//2 k=k%1000000007 //abcdef print(k)
File "/tmp/tmp22drnxk2/tmprrfksf5f.py", line 6 for i in range(0,n) ^ SyntaxError: expected ':'
s095609651
p02572
u346266986
1598729693
Python
PyPy3 (7.3.0)
py
Runtime Error
87
68684
204
import numpy as np n = int(input()) a = np.array(list(map(int, input().split()))) mod = 10**9 + 7 result = 0 for i in range(n - 1): result += a[i] * np.sum(a[i+1::]) result = result % mod print(result)
Traceback (most recent call last): File "/tmp/tmp3qddl7d8/tmpl1lqu9e0.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s373893556
p02572
u216035099
1598729647
Python
Python (3.8.2)
py
Runtime Error
24
9008
189
N = int(input()) numbers = list(map(int, input().split())) modulo = 1000000007 S = 0 for i in range(N-1): for j in range(i+1, N): S += numbers[i]*numbers[j] print(S%modulo)
File "/tmp/tmp5hhj5lor/tmpdyk1h2sm.py", line 10 S += numbers[i]*numbers[j] ^ IndentationError: unindent does not match any outer indentation level
s018903056
p02572
u059440653
1598729636
Python
PyPy3 (7.3.0)
py
Runtime Error
101
68608
419
#include<iostream> using namespace std; int main() { // 整数の入力 int N; cin >> N;   vector<int> vec(N); for (int i = 0; i < N; i++) { cin >> vec.at(i); } long long ans = 0; for (int i=0; i < N; i++){ for (int j=i; j < N; j++){ if(i!=N) sum_ans = N.at(i)*N.at(j) % ...
File "/tmp/tmpql2u48vr/tmp9lxg3hms.py", line 8   ^ SyntaxError: invalid non-printable character U+3000
s707745598
p02572
u938785734
1598729629
Python
Python (3.8.2)
py
Runtime Error
163
50024
164
import numpy as np ans=0 n=int(input()) li=list(map(int,input().split())) for i in range(1,n): L=li k=np.cumsum(L[:i]) ans+=k*li[i] print(ans%(10**9+7))
Traceback (most recent call last): File "/tmp/tmpm4dkf3fv/tmp5zgp2omz.py", line 3, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s036198696
p02572
u474461530
1598729594
Python
Python (3.8.2)
py
Runtime Error
35
13216
761
def findProductSum(A, n): # calculating array sum (a1 + a2 ... + an) array_sum = 0 for i in range(0, n, 1): array_sum = array_sum + A[i] # calcualting square of array sum # (a1 + a2 + ... + an)^2 array_sum_square = array_sum * array_sum # calcualting a1^2 + a2^2 +...
Traceback (most recent call last): File "/tmp/tmpoaxcks95/tmplw_vry25.py", line 23, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s884963042
p02572
u383894162
1598729589
Python
Python (3.8.2)
py
Runtime Error
24
8880
629
#include <bits/stdc++.h> using namespace std; #define ll long long int #define fi first #define se second #define MOD 1000000007 int main(){ ll a, cnt=0, ans=0; cin>>a; ll arr[a]; for (ll i=0; i<a; i++) cin>>arr[i], cnt+=arr[i]; for (ll i=0; i<a-1; i++){ cnt-=arr[i]; ans+=arr[i]*cnt; ans%=MOD; } cout<<ans<...
File "/tmp/tmp84rrzcy3/tmpl3ocmnhj.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s969543826
p02572
u152858291
1598729588
Python
Python (3.8.2)
py
Runtime Error
108
26872
174
import numpy as np n = input() a = numpy.array([n]) s = 0 t = 0 for i in range(n): a[i] = input() s += a[i] t += a[i]*a[i] l = ((s*s - t) // 2) % 1000000007 print(l)
Traceback (most recent call last): File "/tmp/tmpxbskvmbu/tmpiabehjna.py", line 2, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s061817794
p02572
u773081031
1598729584
Python
Python (3.8.2)
py
Runtime Error
29
9012
131
N = int(input()) A = list(map(int, input().split())) prod = [A[i]*A[j] i for in range(N-1) j for in range(i+1, N)] print(sum(prod))
File "/tmp/tmpadqilh3o/tmpkchj7m_v.py", line 3 prod = [A[i]*A[j] i for in range(N-1) j for in range(i+1, N)] ^^^^^^^^^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma?
s895088148
p02572
u663404111
1598729572
Python
PyPy3 (7.3.0)
py
Runtime Error
134
94080
204
N = int(input()) A = list(map(int,input().split())) sum = 0 for i in range(1, N): sum +=A[i-1] sum = sum % (10**9 + 7) ans = ans + (sum * A[i]) % (10**9 + 7) ans = ans % (10**9 + 7) print(ans)
Traceback (most recent call last): File "/tmp/tmpu_nai9x5/tmp1vopg_5r.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s398639268
p02572
u152858291
1598729569
Python
Python (3.8.2)
py
Runtime Error
127
27148
157
import numpy as np n = input() a = numpy.array([n]) s = 0 t = 0 for i in range(n): s += a[i] t += a[i]*a[i] l = ((s*s - t) // 2) % 1000000007 print(l)
Traceback (most recent call last): File "/tmp/tmpma799k7b/tmpvioq7z28.py", line 2, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s954279165
p02572
u328179275
1598729536
Python
Python (3.8.2)
py
Runtime Error
1977
925244
295
def sum_a(array): total = 0 for i in range(len(array)): total += array[i]**2 return(total) n = int(input()) a = list(map(int,input().split())) import numpy as np c = np.array(a) d = np.array(a) e = np.outer(c,d) f = np.sum(e) g = sum_a(a) print((int((f-g)/2)%(10**9+7)))
Traceback (most recent call last): File "/tmp/tmppb223l3c/tmpexot_cze.py", line 7, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s334463587
p02572
u663404111
1598729522
Python
PyPy3 (7.3.0)
py
Runtime Error
178
94300
172
N = int(input()) A = list(map(int,input().split())) sum = 0 for i in range(1, N): sum +=A[i-1] sum = sum % (10**9 + 7) ans += (sum * A[i]) % (10**9 + 7) print(ans)
Traceback (most recent call last): File "/tmp/tmpbsoer8r8/tmpnfidm8a0.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s319007448
p02572
u474461530
1598729519
Python
Python (3.8.2)
py
Runtime Error
42
12984
756
def findProductSum(A, n): # calculating array sum (a1 + a2 ... + an) array_sum = 0 for i in range(0, n, 1): array_sum = array_sum + A[i] # calcualting square of array sum # (a1 + a2 + ... + an)^2 array_sum_square = array_sum * array_sum # calcualting a1^2 + a2^2 +...
Traceback (most recent call last): File "/tmp/tmprq77_ex0/tmpyqg0tq4w.py", line 23, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s136586587
p02572
u555311916
1598729506
Python
PyPy3 (7.3.0)
py
Runtime Error
129
94224
259
n = int(input()) a = list(map(int,input().split())) mod = 10**9+7 sum_a = sum(a)%mod sum_a2 = sum_a**2%mod for i in range(n): sum_a2 -= (a[i]**2) sum_a2 %= mod if sum_a2%2 == 0: ans = sum_a2//2 else: ans = ((ans+mod)//2)%mod print(ans)
Traceback (most recent call last): File "/tmp/tmpybfm2xx7/tmp94nysvfy.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s912880723
p02572
u137226361
1598729471
Python
Python (3.8.2)
py
Runtime Error
2206
31392
350
import sys stdin = sys.stdin def main(): n = int(stdin.readline().rstrip()) ls = list(map(int, stdin.readline().split())) lsm = list(set(ls)) m = len(lsm) ans = 0 for i in range(n-1): for j in range(i+1, n): ans = (ans + lsm[i] * lsm[j]) % (10**9 + 7) print(ans) if __na...
Traceback (most recent call last): File "/tmp/tmp7vthbhyz/tmp72mb4_2l.py", line 16, in <module> main() File "/tmp/tmp7vthbhyz/tmp72mb4_2l.py", line 5, in main n = int(stdin.readline().rstrip()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s934187629
p02572
u009885900
1598729435
Python
Python (3.8.2)
py
Runtime Error
109
27132
181
import numpy as np N = int(input()) A = numpy.array(list(map(int, input().split()))) ans = 0 for i in range(N): ans = (ans + A[i] * numpy.sum(A[i+1:N])) % (10**9+7) print(ans)
Traceback (most recent call last): File "/tmp/tmp6_wvhd73/tmp9nppq6s3.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s618675000
p02572
u389530753
1598729433
Python
Python (3.8.2)
py
Runtime Error
92
32492
129
N=int(input()) S=list(input().split()) A=[int(n) for n in S] ans=int(0) for i in A: for j in B: ans += i*j print(ans)
Traceback (most recent call last): File "/tmp/tmpzzz8xgim/tmp64ovy5c4.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s130288371
p02572
u788061153
1598729432
Python
Python (3.8.2)
py
Runtime Error
79
31828
273
n= int(input()) a= [int(i) for i in input().split()] pref=[0]*n pref[0] = a[0]%m for i in range(1,n): pref[i] = (pref[i-1]+a[i])%m m = 10**9+7 ans = 0 #print(pref) for i in range(n-1): ans+= (a[i]%m *((pref[n-1]-pref[i])%m))%m ans = ans%m print(ans) #437235829
Traceback (most recent call last): File "/tmp/tmphw21bjmg/tmpkf4otyqo.py", line 1, in <module> n= int(input()) ^^^^^^^ EOFError: EOF when reading a line
s117023236
p02572
u059238013
1598729406
Python
Python (3.8.2)
py
Runtime Error
1377
923128
227
#C import numpy as np n = int(input()) a_ls = list(map(int, input().split())) a_ls = np.array([a_ls]) a_ls2 = np.array(a_ls).T tmp = np.dot(a_ls2, a_ls) ans = int(((np.sum(tmp) - np.sum(np.diag(tmp)))/2)%(10**9+7)) print(ans)
Traceback (most recent call last): File "/tmp/tmpawgdz0y8/tmp8tdu3amc.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s281525967
p02572
u813993459
1598729395
Python
Python (3.8.2)
py
Runtime Error
25
9104
154
a=input() a = np.array(list(map(int, input().split()))) count=1 tmp=0 for i in a[:-1]: tmp=(tmp+i*(a[count:]).sum())%(10**9+7) count+=1 print(tmp)
Traceback (most recent call last): File "/tmp/tmp0pbys0qn/tmp74f5gc03.py", line 1, in <module> a=input() ^^^^^^^ EOFError: EOF when reading a line
s717439670
p02572
u907676137
1598729379
Python
PyPy3 (7.3.0)
py
Runtime Error
122
94284
203
counter = 0 lis = [] N = int(input()) A = list(map(int, input().split())) for pair in itertools.combinations(A, 2): lis.append(pair) for n in lis: counter += n[0] * n[1] print(counter%1000000007)
Traceback (most recent call last): File "/tmp/tmp33tvb8xz/tmpu4dbukkv.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s920619758
p02572
u312666261
1598729319
Python
PyPy3 (7.3.0)
py
Runtime Error
127
94276
224
n = int(input()) alist=list(map(int,input().split())) mod = (10**9 + 7) ans = 0 import numpy alistsum = numpy.cumsum(alist) for i in range(n-1): ans += alist[i]*(alistsum[-1]-alistsum[i]) ans = ans%mod print(ans)
Traceback (most recent call last): File "/tmp/tmprwuslivf/tmphjc4_6dl.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s489171041
p02572
u346395915
1598729241
Python
PyPy3 (7.3.0)
py
Runtime Error
191
94056
292
n = int(input()) li = list(map(int, input().split())) mod = 10**9 + 7 ans = 0 for i in range(1, n): ans += li[0]*li[i] check = ans check = ans for i in range(1, n): check -= li[i] * li[i-1] check /= li[i-1] check *= li[i] ans += check ans %= mod print(int(ans))
Traceback (most recent call last): File "/tmp/tmp57m_gdcs/tmpie8n2p3e.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s492106257
p02572
u468972478
1598729224
Python
Python (3.8.2)
py
Runtime Error
42
13124
192
n = int(input()) a = [int(input()) for i in range(n)] b = [] for i in range(n): for j in range(n): b.append((a[i] % (10 ** 9 + 7)) * (a[j] % (10 ** 9 + 7))) print(sum(b) % (10 ** 9 + 7))
Traceback (most recent call last): File "/tmp/tmpoi3bg0lv/tmpy6y8e5oq.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s785415477
p02572
u944396627
1598729183
Python
Python (3.8.2)
py
Runtime Error
26
9004
36
4 141421356 17320508 22360679 244949
File "/tmp/tmpwd3pk2k_/tmp0dhxsttd.py", line 2 141421356 17320508 22360679 244949 ^^^^^^^^ SyntaxError: invalid syntax
s590171961
p02572
u882950355
1598729105
Python
Python (3.8.2)
py
Runtime Error
1368
924736
231
import numpy as np n = int(input()) a = list(map(int,input().split())) sum = 0 aa = np.array(a).reshape(1,n) mat = np.dot(aa.T,aa) s = np.sum(mat) for i in range(n): s -= a[i]*a[i] sum = int(s/2) sum = sum % (10**9+7) print(sum)
Traceback (most recent call last): File "/tmp/tmpg77_gtlu/tmpb691o1bh.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s243186014
p02572
u264395947
1598729097
Python
Python (3.8.2)
py
Runtime Error
27
9020
202
A = list(map(int, input().split())) B = [0]*N num = 0 for i in reversed(range(N)): B[i] = A[i] + num num = B[i] ans = 0 for i in range(N-1): ans += A[i]*B[i+1] print(ans%1000000007)
Traceback (most recent call last): File "/tmp/tmpuk_joqrz/tmp4pj9bk36.py", line 1, in <module> A = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s060658639
p02572
u395478557
1598729073
Python
PyPy3 (7.3.0)
py
Runtime Error
136
68584
1537
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define JAM(x) cout<< #x <<" = "<<x<<"\n" #define II() ( { int a ; read(a) ; a; } ) #define LL() ( { ll a ; read(a) ; a; } ) #define DD() ({double a; scanf("%lf", &a); a;}) //Fast Reader template<class T>inline bool read(T &x){ int c=getchar()...
File "/tmp/tmpq2a4p3us/tmpc97qp67z.py", line 3 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s475801125
p02572
u260370057
1598728941
Python
Python (3.8.2)
py
Runtime Error
76
31384
147
n = int(input()) a = list(map(int,input().split())) count = 0 su = sum[a] for i in range(n-1): su -= a[i] count += a[i]*su print(count%(10**9+7))
Traceback (most recent call last): File "/tmp/tmpbv1zg0h5/tmpxnzojlac.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s501618191
p02572
u945200821
1598728918
Python
Python (3.8.2)
py
Runtime Error
2217
1822256
408
import sys import numpy as np def main(): def readline() -> str: s = sys.stdin.readline() return s.rstrip() n: int = int(readline()) a: np.ndarray = np.array(tuple(int(a_i) for a_i in readline().split())).reshape((1, -1)) prime: int = 10**9 + 7 a_up: np.ndarray = np.triu(a.T @ ...
Traceback (most recent call last): File "/tmp/tmpx3uizltm/tmpi_rrvoq8.py", line 21, in <module> main() File "/tmp/tmpx3uizltm/tmpi_rrvoq8.py", line 11, in main n: int = int(readline()) ^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s980647011
p02572
u469281291
1598728914
Python
PyPy2 (7.3.0)
py
Runtime Error
97
110176
233
import math import itertools import sys n = int(input()) a = list(map(int, input().split())) ans = 0 all = 0 for i in a: all += i for i in a: all -= i ans += i*all if(ans > 10**9+7): ans %= 10**9+7 print(ans)
Traceback (most recent call last): File "/tmp/tmp3l_ll1s4/tmp11cpeiil.py", line 4, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s509991605
p02572
u185405877
1598728902
Python
Python (3.8.2)
py
Runtime Error
75
31628
172
n=int(input()) i = list(map(int, input().split())) ans=0 for k in range(n-1): for j in range(i+1,n): ans+=(i[k]*i[j])%(10**9+7) ans=ans%(10**9+7) print(ans)
Traceback (most recent call last): File "/tmp/tmpm5o7z7px/tmpy2i7exmo.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s797740317
p02572
u061835391
1598728898
Python
Python (3.8.2)
py
Runtime Error
26
9020
133
n=int(input()) l=list(map(int,input().split())) s=0 for i in range(0,n-1): for j in range(i+1,n+1): x=l[i]*l[j] s=s+x print(s)
File "/tmp/tmpscr8yfyt/tmp0x_ri0wm.py", line 6 x=l[i]*l[j] ^ IndentationError: expected an indented block after 'for' statement on line 5
s053660032
p02572
u061835391
1598728858
Python
Python (3.8.2)
py
Runtime Error
29
8956
131
n=int(input()) l=list(map(int,input().split())) s=0 for i in range(0,n-1): for j in range(i+1,n): x=l[i]*l[j] s=s+x print(s)
File "/tmp/tmp3vzkjgqo/tmpr3ruf96g.py", line 6 x=l[i]*l[j] ^ IndentationError: expected an indented block after 'for' statement on line 5
s196016351
p02572
u036065030
1598728803
Python
Python (3.8.2)
py
Runtime Error
188
31604
381
N = int(input()) As = list(map(int, input().split())) total = 0 before = 0 for i in range(len(As) - 1): if i == 0: total = total + As[i] * sum(As[i+1:]) before = As[i] * sum(As[i+1:]) else: total = total + (((before / As[i-1]) - As[i]) * As[i]) before = (((before / As[i-1]) - As...
Traceback (most recent call last): File "/tmp/tmpd3x6eym7/tmpsk0cgl4q.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s859797599
p02572
u878739773
1598728796
Python
Python (3.8.2)
py
Runtime Error
43
13320
159
n=int(input()) a=[] for i in range(n): num=int(input()) a.append(num) ans=0 for i in range(0,n-1): for j in range(i+1,n): ans+=a[i]*a[j] print(ans)
Traceback (most recent call last): File "/tmp/tmpylkter6v/tmpfl08t8ye.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s654191347
p02572
u061835391
1598728749
Python
Python (3.8.2)
py
Runtime Error
22
9028
131
n=int(input()) l=list(map(int,input().split())) s=0 for i in range(0,n-1): for j in range(i+1,n): x=l[i]*l[j] s=s+x print(s)
File "/tmp/tmph7hm7066/tmpu6a60mm7.py", line 6 x=l[i]*l[j] ^ IndentationError: expected an indented block after 'for' statement on line 5
s184905955
p02572
u995109095
1598728748
Python
PyPy3 (7.3.0)
py
Runtime Error
96
68444
220
34I=lambda:list(map(int,input().split())) mod=10**9+7 n,=I() l=I() pre=l.copy() suf=l.copy() for i in range(n-2,-1,-1): suf[i]+=suf[i+1] ans=0 #print(suf) for i in range(n-1): ans+=(l[i]*suf[i+1]) ans%=mod print(ans)
File "/tmp/tmp3iop7u88/tmp7996c4tj.py", line 1 34I=lambda:list(map(int,input().split())) ^ SyntaxError: invalid decimal literal
s890998348
p02572
u653041271
1598728744
Python
PyPy3 (7.3.0)
py
Runtime Error
170
75108
974
import sys, bisect, math, itertools, string, queue, copy import numpy as np import scipy from collections import Counter,defaultdict,deque from itertools import permutations, combinations from heapq import heappop, heappush # input = sys.stdin.readline sys.setrecursionlimit(10**8) mod = 10**9+7 def inp(): return int(in...
Traceback (most recent call last): File "/tmp/tmpmb9q5hwe/tmpk46okz8g.py", line 21, in <module> n = inp() ^^^^^ File "/tmp/tmpmb9q5hwe/tmpk46okz8g.py", line 10, in inp def inp(): return int(input()) ^^^^^^^ EOFError: EOF when reading a line
s113481344
p02572
u945200821
1598728744
Python
Python (3.8.2)
py
Runtime Error
1531
1939180
364
import sys import numpy as np def main(): def readline() -> str: s = sys.stdin.readline() return s.rstrip() n: int = int(readline()) a: np.ndarray = np.array(tuple(int(a_i) for a_i in readline().split())).reshape((1, -1)) a_up: np.ndarray = np.triu(a.T @ a, k=1) print(np.sum(a_u...
Traceback (most recent call last): File "/tmp/tmpe00xs82s/tmpyof2fph2.py", line 19, in <module> main() File "/tmp/tmpe00xs82s/tmpyof2fph2.py", line 11, in main n: int = int(readline()) ^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s182747866
p02572
u736470924
1598728708
Python
PyPy3 (7.3.0)
py
Runtime Error
161
68668
205
def resolve(): import itertools import numpy as np n = int(input()) A = np.asarray(list(map(int, input().split()))) s = sum(A) print((s**2 - sum(A**2))//2 % (10**9 + 7)) resolve()
Traceback (most recent call last): File "/tmp/tmpue2rv9re/tmppbmdsj2c.py", line 10, in <module> resolve() File "/tmp/tmpue2rv9re/tmppbmdsj2c.py", line 5, in resolve n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s911034543
p02572
u854931881
1598728676
Python
Python (3.8.2)
py
Runtime Error
22
9112
143
n=int(inoput()) a=list(map(int,input())) total=0 for i in range(0,n-1): for j in range(1,n): total+=a[i]*a[j] print(total%(10**9+7))
Traceback (most recent call last): File "/tmp/tmp_ujzggm_/tmp7n0x5ofx.py", line 1, in <module> n=int(inoput()) ^^^^^^ NameError: name 'inoput' is not defined. Did you mean: 'input'?
s735555054
p02572
u869820398
1598728642
Python
Python (3.8.2)
py
Runtime Error
81
31744
154
n = int(input()) a = [int(i) for i in input().split()] sum1 = 0 sum2 = 0 for _ in a: sum1 += _ sum2 += (a*a) sum1 = (sum1 * sum1) print(sum1 - sum2)
Traceback (most recent call last): File "/tmp/tmpx_nhq6gf/tmpncif8pzs.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s388345397
p02572
u018538342
1598728611
Python
Python (3.8.2)
py
Runtime Error
25
8900
148
n = int(input()) lis = list(map(int, input().split()) sum = 0 for i in lis: for j in lis: sum += i * j print(sum % 1000000009)
File "/tmp/tmp2js74gt4/tmp098g_czc.py", line 2 lis = list(map(int, input().split()) ^ SyntaxError: '(' was never closed
s146760793
p02572
u828738107
1598728537
Python
Python (3.8.2)
py
Runtime Error
155
31760
872
mod = int(1e9 + 7) def pw(b, ex): if ex == 0: return 1 if ex == 1: return b if ex & 1: return b % mod * pw((b*b) % mod, ex >> 1) % mod return pw((b*b) % mod, ex >> 1) % mod n = int(input()) x = list(map(int,input().split())) st = 0 en = 0 for i in x: st = (st + i) % mod en = (en + (i * i) % m...
Traceback (most recent call last): File "/tmp/tmpxvs__ri2/tmpgn8b9ue6.py", line 9, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s469326461
p02572
u153047519
1598728517
Python
Python (3.8.2)
py
Runtime Error
68
31752
201
n = int(input()) a = list(map(int, input().split())) for i in range(n): for j in range(i + 1, n): result += (a[i] % (10**9 + 7)) * (a[i] % (10**9 + 7)) result = result % (10**9 + 7) print(result)
Traceback (most recent call last): File "/tmp/tmphjd_a7cm/tmpkntwsgwh.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s141759667
p02572
u957149382
1598728433
Python
Python (3.8.2)
py
Runtime Error
76
31544
188
n=input() n=int(n) arr=list(map(int,input().rstrip().split())) for i in range(len(arr)): for j in range(i+1,len(arr)): Sum=(Sum+(arr[i]*arr[j]))%1000000007 print(Sum)
Traceback (most recent call last): File "/tmp/tmpvb6bj7tl/tmpd9pegp9h.py", line 1, in <module> n=input() ^^^^^^^ EOFError: EOF when reading a line
s666212546
p02572
u726927868
1598728430
Python
Python (3.8.2)
py
Runtime Error
69
31428
165
num = int(input()) ar = list(map(int,input().split())) mod = 10**9 + 7 somee = sum(arr) ans = 0 for i in range(num): ans+=(somee-ar[i])*ar[i] print((ans//2)%mod)
Traceback (most recent call last): File "/tmp/tmpy4g_v5qt/tmptc8emb_i.py", line 1, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s089301567
p02572
u310381103
1598728371
Python
Python (3.8.2)
py
Runtime Error
1088
923348
149
import numpy as np n=int(input()) a=list(map(int,input().split())) aa=[x*x for x in a] c=sum(sum(np.outer(a,a))) c-=sum(aa) c=c//2 print(c%(10**9+7))
Traceback (most recent call last): File "/tmp/tmpn03_9ao6/tmpnmcsu2_i.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s959386120
p02572
u694273049
1598728366
Python
PyPy3 (7.3.0)
py
Runtime Error
131
68512
172
n = int(input()) p = input().split() product = 0 for i in range(n): for j in range(i+1,n): product = product + int(p[i])*int(p[j]) print(product)
File "/tmp/tmp8r3c6_wo/tmpzycuadxx.py", line 4 for i in range(n): IndentationError: unexpected indent
s628344386
p02572
u468972478
1598728341
Python
Python (3.8.2)
py
Runtime Error
42
13460
176
n = int(input()) a = [int(input()) for i in range(n)] b = [] for i in range(n): for j in range(n): b.append((a[i] % (10 ** 9 + 7)) * (a[j] % (10 ** 9 + 7))) print(sum(b))
Traceback (most recent call last): File "/tmp/tmp5rd0bznb/tmpo6n9er1s.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s386924365
p02572
u860002137
1598728311
Python
Python (3.8.2)
py
Runtime Error
80
31440
158
n = int(input()) arr = list(map(int, input().split())) ans = 0 sum_arr = sum(arr) for x in arr: ans += x * (sum_arr - x) // 2 ans %= MOD print(ans)
Traceback (most recent call last): File "/tmp/tmpis1_w16w/tmp_fc071zo.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s430014094
p02572
u989364230
1598728302
Python
PyPy3 (7.3.0)
py
Runtime Error
186
68688
183
import numpy n = int(input()) a = [int(x) for x in input().split()] MOD = 10**9 +7 x = numpy.array(a) result = ((x.sum()**2 - x.dot(x)) // 2)%MOD print(result) # print(s%MOD)
Traceback (most recent call last): File "/tmp/tmpj01366dj/tmp0k2rw34m.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s771610157
p02572
u034128150
1598728018
Python
PyPy3 (7.3.0)
py
Runtime Error
136
94320
188
N = int(input()) As = list(map(int, input().split())) sA = sum(As) % (10 ** 9 + 7) print((sA * sA - sum( (A * A % (10 ** 9 + 7) for A in As) ) ) * pow(2, -1, 10 ** 9 + 7) % (10 ** 9 + 7))
Traceback (most recent call last): File "/tmp/tmp9lud1drp/tmpxnd2vg4n.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s820871280
p02572
u077296371
1598728012
Python
Python (3.8.2)
py
Runtime Error
71
31564
148
n=int(input()) l=list(map(int,input().split())) su=l[0] ans=0 for i in range(1,n): ans+=su*l[i] ans%=mod su+=l[i] su%=mod print(ans)
Traceback (most recent call last): File "/tmp/tmpgk6n9wqz/tmpt_yhgx0p.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s005496500
p02572
u145600939
1598727904
Python
PyPy3 (7.3.0)
py
Runtime Error
131
94192
155
mod = 10**9 + 7 n = int(input()) A = list(map(int,input().split())) S = sum(A)%mod ans = 0 for a in A: ans += a * (S - a) print(ans*pow(2,-1,mod)%mod)
Traceback (most recent call last): File "/tmp/tmp91ro9i_b/tmpletxh9i1.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s543978454
p02573
u829999015
1600723632
Python
Python (3.8.2)
py
Runtime Error
836
132244
394
from collections import Counter n, m = map(int, input().split()) ab = [map(int, input().split()) for _ in range(m)] a, b = [list(i) for i in zip(*ab)] a.extend(b) c = Counter(a) most = c.most_common(1)[0][0] temp = [] for i in range(m): if a[i] == most or b[i] == most: if a[i] == b[i]: continue temp....
Traceback (most recent call last): File "/tmp/tmpa8bv2w3m/tmpeqbx04aq.py", line 3, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s621755330
p02573
u829999015
1600723389
Python
Python (3.8.2)
py
Runtime Error
856
132232
358
from collections import Counter n, m = map(int, input().split()) ab = [map(int, input().split()) for _ in range(m)] a, b = [list(i) for i in zip(*ab)] a.extend(b) c = Counter(a) most = c.most_common(1)[0][0] temp = [] for i in range(m): if a[i] == most or b[i] == most: temp.append(a[i]) temp.append(b[i]) t...
Traceback (most recent call last): File "/tmp/tmpimq0ttot/tmpzum8rt85.py", line 3, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s200190683
p02573
u292746386
1600609534
Python
Python (3.8.2)
py
Runtime Error
2207
50972
557
N, M = (int(d) for d in input().split()) C = [[] for i in range(N+1)] for i in range(M): A, B = (int(d) for d in input().split()) C[A].append(B) C[B].append(A) # BFS Q = [] ungrouped = [i for i in range(1, N+1)] G = [] while len(ungrouped) > 0: init = ungrouped.pop(0) Q += C[init] G.append([]...
Traceback (most recent call last): File "/tmp/tmpzl2f3vee/tmpdfxlxna9.py", line 1, in <module> N, M = (int(d) for d in input().split()) ^^^^^^^ EOFError: EOF when reading a line
s283711357
p02573
u322171361
1600596012
Python
Python (3.8.2)
py
Runtime Error
2206
24516
357
n, m = map(int, input().split()) par = list(range(n)) qua = [1]*n def root(x): if par[x] == x : return x else: return root(par[x]) def unite(x, y): rx = root(x) ry = root(y) if rx == ry: return par[rx] = ry qua[ry] +=qua[rx] for i in range(m): a, b = map(int, input().split())...
Traceback (most recent call last): File "/tmp/tmpil4awq5v/tmpi4u_1b0t.py", line 1, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s499149387
p02573
u238786149
1600592316
Python
Python (3.8.2)
py
Runtime Error
1990
255476
227
import networkx as nx G = nx.Graph() n, m = map(int, input().split()) for i in range(m): a, b = map(int, input().split()) G.add_edge(a, b) largest_cc = max(nx.connected_components(G), key=len) print(len(largest_cc))
Traceback (most recent call last): File "/tmp/tmp6uwtfp12/tmpmun1rm88.py", line 5, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line