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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s511211804 | p02572 | u598795006 | 1598733333 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 68664 | 904 | # 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 %% 1000000007) + (A[i] %% 1000000007)) %% 1000000007
# calcualting square of array sum
# (a1 + a2 + ... + an)^2
array_su... | File "/tmp/tmpxlnmzkaf/tmp49vsxs77.py", line 7
array_sum = ((array_sum %% 1000000007) + (A[i] %% 1000000007)) %% 1000000007
^
SyntaxError: invalid syntax
| |
s404800884 | p02572 | u794521826 | 1598733322 | Python | PyPy3 (7.3.0) | py | Runtime Error | 90 | 68704 | 237 | import numpy as np
def mo(v):
return v % 1000000007
n = int(input())
a = mo(np.array(list(map(int, input().split()))))
s = 0
for i in range(0, n - 1, 1):
for j in range(i + 1, n, 1):
s += mo(a[i] * a[j])
print(mo(s))
| Traceback (most recent call last):
File "/tmp/tmpyn9xh18t/tmp5no2okmj.py", line 8, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s833344820 | p02572 | u346395915 | 1598733305 | Python | Python (3.8.2) | py | Runtime Error | 233 | 31844 | 318 | 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
for i in range(1, n):
check -= li[i] * li[i-1]
if check < 0:
check += 10**9 + 7
check //= li[i-1]
check *= li[i]
ans += check
ans %= mod
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpgumun0zk/tmpml89zd2p.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s720585248 | p02572 | u905436707 | 1598733247 | Python | Python (3.8.2) | py | Runtime Error | 36 | 13420 | 222 | N = int(input())
A = []
a = int(0)
m = int(1000000007)
n = int(1)
for i in range(N):
A.append(int(input()))
for i in range(N-1):
for j in range(N-n):
a = a + A[i] * A[j + n]
n += 1
print(a % m)
| Traceback (most recent call last):
File "/tmp/tmpgv38365_/tmput6iiwoz.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s124651774 | p02572 | u612911402 | 1598733244 | Python | Python (3.8.2) | py | Runtime Error | 38 | 15116 | 819 | 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/tmpaeiol2rg/tmp0n162_vf.py", line 25, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s086479051 | p02572 | u975771310 | 1598733101 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 1934972 | 285 | import numpy as np
N = int(input())
A = list(map(int, input().split()))
A = np.array(A).reshape(-1,1)
mod = 10**9+7
temp = A*A.T
for i in range(N):
temp[i,i]=0
temp = np.tril(temp)
temp = temp%mod
temp_sum = np.sum(temp)%mod
temp_sum = np.sum(temp_sum)%mod
print(int(temp_sum)) | Traceback (most recent call last):
File "/tmp/tmp39vn0v8x/tmp0931q04j.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s177817528 | p02572 | u945443580 | 1598733094 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 53500 | 267 | import numpy as np
N = input()
A = input()
N = int(N)
#
part_A = A.split(" ")
int_A = [float(i) for i in part_A]
part_sum = [sum(int_A[i+1:N]) for i in range(len(int_A)-1)]
sum = np.dot(np.array(part_sum), np.array(int_A[:-1]))
MOD = 1000000007
print(sum0%MOD)
| Traceback (most recent call last):
File "/tmp/tmpnva78ttb/tmpgri54rvi.py", line 2, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s621068329 | p02572 | u172892118 | 1598733089 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 31536 | 168 | N = int(input())
An = list(map(int, input().strip().split()))
S = 0
for i in range(N):
for j in range(N-1-i):
S += S % An[i]*An[N-1-j]%1000000007
print(S) | Traceback (most recent call last):
File "/tmp/tmpw43ui0ex/tmp21cxpqrg.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s415298548 | p02572 | u917678406 | 1598733008 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8976 | 198 | for i in range (N):
A = (int(input())
MASS = 0
for i in range (N - 1):
T = 0
for j in range (i + 1, N):
T += (A[j] % NUM)
MASS += ((A[i]%NUM) * (T%NUM))%NUM
print(MASS % NUM) | File "/tmp/tmpt3sui6ws/tmpxx2qmfax.py", line 2
A = (int(input())
^
SyntaxError: '(' was never closed
| |
s800408976 | p02572 | u054966391 | 1598732999 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8704 | 534 | def findProductSum(A, n):
array_sum = 0
for i in range(0, n, 1):
array_sum = array_sum + A[i]
Hap
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]
re... | File "/tmp/tmpa63oouw0/tmppujrd6i2.py", line 19
array_sum_square = array_sum * array_sum
IndentationError: unexpected indent
| |
s705268501 | p02572 | u999327182 | 1598732977 | Python | Python (3.8.2) | py | Runtime Error | 78 | 31476 | 162 | ans = 0
N = int(input())
array = list(map(int, input().split()))
x = sum(array)
for i in range(N):
ans += array[i] * (x -arrau[i])
print(int(ans/2)%(10**9+7)) | Traceback (most recent call last):
File "/tmp/tmp8dmfsapr/tmpxeunvayd.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s685711647 | p02572 | u460009487 | 1598732955 | Python | PyPy3 (7.3.0) | py | Runtime Error | 104 | 68664 | 177 | import numpy as np
n = int(input())
a = list(map(int, input().split()))
zenbu = sum(a)
ans = 0
for i in range(n):
ans += a[i]*(zenbu-a[i])
print(ans // 2 % (1000000000+7)) | Traceback (most recent call last):
File "/tmp/tmpch888wy1/tmptuak2k_0.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s846082057 | p02572 | u463893436 | 1598732919 | Python | PyPy3 (7.3.0) | py | Runtime Error | 103 | 74384 | 210 | import numpy as np
n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in range(len(a)-1):
for j in range(i+1,len(a)):
sum += a[i]*a[j]
ans = np.mod(sum,10**9+7)
print(ans) | Traceback (most recent call last):
File "/tmp/tmppkrmuwok/tmp8vnppogn.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s473308436 | p02572 | u304593245 | 1598732881 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8988 | 365 | import functools
import operator
N = int(input())
A = list(map(int, input().split()))
mod = 10**9+7
ans = 0
for i in range(2**len(A)):\
list2 = []
for j in range(len(A)):
if (i >> j) &1 == 1:
list2.append(A[j])
if len(list2) == 2:
ans += list2[0]*list2[1]
# print(ans)
# ... | File "/tmp/tmpbrlpj26c/tmpuztiui26.py", line 11
for j in range(len(A)):
IndentationError: unexpected indent
| |
s825233810 | p02572 | u328179275 | 1598732865 | Python | Python (3.8.2) | py | Runtime Error | 512 | 925104 | 310 | 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(int((f-g)/2)%(10**9+7))) | Traceback (most recent call last):
File "/tmp/tmph2wc6rgh/tmpqzvsvm9y.py", line 7, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s847144941 | p02572 | u517674755 | 1598732844 | Python | Python (3.8.2) | py | Runtime Error | 39 | 13412 | 276 | from itertools import combinations
n = int(input())
li = []
for i in range(0,n):
a = int(input())
li.append(a)
comb = combinations(li, 2)
li1 = []
out = []
for i in list(comb):
li1.append(i)
for j in li1:
temp = j[0]*j[1]
out.append(temp)
print(sum(out)) | Traceback (most recent call last):
File "/tmp/tmpb9uq3mkt/tmpfxcg2a3v.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s699084470 | p02572 | u845416499 | 1598732839 | Python | Python (3.8.2) | py | Runtime Error | 2054 | 1934108 | 248 | import numpy as np
if __name__ == '__main__':
n = int(input())
a = np.array(input().split()).astype(np.int64)
num = 10**9+7
mat = np.tril(a.reshape((-1, 1)) * a, k=-1)
mat %= num
sum = (np.sum(mat)) % num
print(sum)
| Traceback (most recent call last):
File "/tmp/tmp4bto5gp0/tmp3j1_os95.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s460039340 | p02572 | u555767343 | 1598732759 | Python | PyPy3 (7.3.0) | py | Runtime Error | 142 | 94208 | 141 | n = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(n-1):
ans = (ans+(A[i]*sum(A[i+1:])%MOD)%MOD)%MOD
print(ans) | Traceback (most recent call last):
File "/tmp/tmphjodc8vc/tmp1b75pesh.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s226148950 | p02572 | u491412719 | 1598732746 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8860 | 629 | #include <iostream>
using namespace std;
// required function
int findProductSum(int A[], int n) {
int array_sum = 0;
for (int i = 0; i < n; i++)
array_sum = array_sum + A[i];
int array_sum_square = array_sum * array_sum;
int individual_square_sum = 0;
for (int i = 0; i < n; i++) ... | File "/tmp/tmptw64411v/tmpes5havqq.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s338925670 | p02572 | u463893436 | 1598732720 | Python | PyPy3 (7.3.0) | py | Runtime Error | 104 | 68668 | 288 | import numpy as np
def product(list):
p = 1
for i in list:
p *= i
return p
n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in range(len(a)-1):
for j in range(i+1,len(a)):
sum += a[i]*a[j]
ans = np.mod(sum,10**9+7)
print(ans) | Traceback (most recent call last):
File "/tmp/tmpdpi9z6dj/tmpwfqd7jft.py", line 10, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s900141237 | p02572 | u428123597 | 1598732694 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8980 | 352 | N = int(input())
input1 = input()
input1 = input1.split()
A = []
for i in input1:
A.append(int(i))
sum = 0
for i in range(N):
sum = sum + A[i]
sum_square = sum*sum
individual_square_sum = 0
for i in range(N):
individual_square_sum = individual_square_sum + A[i]*A[i]
result = int((sum_square - individual... | File "/tmp/tmp71x14v7e/tmptfz5m22k.py", line 14
result = int((sum_square - individual_square_sum) / 2))
^
SyntaxError: unmatched ')'
| |
s466376649 | p02572 | u885068064 | 1598732682 | Python | Python (3.8.2) | py | Runtime Error | 1909 | 2718120 | 280 | import numpy as np
N = input()
A = np.array(list(map(int, input().split())), dtype=int)
s = 0
x, y = np.meshgrid(A, A)
s = (np.sum(x * y) - np.sum(A ** 2)) / 2
#for i in range(len(A) - 1):
# s += np.sum(A[i] * A[i + 1:])
ans = int(s % (10 ** 9 + 7))
print(ans) | Traceback (most recent call last):
File "/tmp/tmp4hihb66s/tmpj3u16d6j.py", line 2, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s704779107 | p02572 | u060505280 | 1598732671 | Python | Python (3.8.2) | py | Runtime Error | 2265 | 3519264 | 246 | import numpy as np
N = int(input())
numbers = np.array(list(map(int, input().split())))
xx, yy = np.meshgrid(numbers, numbers)
times = xx * yy
eye = np.eye(N)
times_sum = np.where(eye == 0, times, 0).sum() / 2
print(int(times_sum % (10**9 + 7)))
| Traceback (most recent call last):
File "/tmp/tmpt2n2m0vu/tmpxowad9m2.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s487637160 | p02572 | u428123597 | 1598732659 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8988 | 358 | N = int(input())
input1 = input()
input1 = input1.split()
A = []
for i in input1:
A.append(int(i))
sum = 0
for i in range(N):
sum = sum + A[i]
sum_square = sum*sum
individual_square_sum = 0
for i in range(N):
individual_square_sum = individual_square_sum + A[i]*A[i]
result = int((array_sum_square - indi... | File "/tmp/tmpdt5z424j/tmps8xzzcdp.py", line 14
result = int((array_sum_square - individual_square_sum) / 2))
^
SyntaxError: unmatched ')'
| |
s130719994 | p02572 | u371132735 | 1598732657 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 68752 | 315 | # abc177_c.py
from numba import jit
@numba
def solve():
N = int(input())
A = list(map(int,input().split()))
ans = 0
mod = 10**9+7
for i in range(N-1):
for j in range(i+1,N):
if i != j:
ans+=A[i]*A[j]
ans%=mod
return ans%mod
print(solve()) | Traceback (most recent call last):
File "/tmp/tmpiy_8it_r/tmpg3k_6oza.py", line 3, in <module>
@numba
^^^^^
NameError: name 'numba' is not defined
| |
s487734344 | p02572 | u127288756 | 1598732643 | Python | PyPy3 (7.3.0) | py | Runtime Error | 94 | 68708 | 363 | import numpy as np
N=int(input())
A=list(map(int,input().split()))
MOD = 1000000007
ans=0
for i in range(2**N):
bin_str = format(i, 'b')
bin_ = bin_str.count('1')
if 1 < bin_ < N:
if bin_ == 2:
temp=1
for n in range(N):
if i>>n&1:
temp *=A... | Traceback (most recent call last):
File "/tmp/tmp6f8idr8l/tmpx8sx9m4f.py", line 2, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s609803487 | p02572 | u680540873 | 1598732595 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9120 | 153 | N = int(input())
Sum = 0
A = np.array((map(int, input().split())))
for j in range(N):
for i in range(j):
Sum += A[i]*A[j]
print(Sum%(1000000000+7)) | Traceback (most recent call last):
File "/tmp/tmp0059c0dg/tmpwxi128kh.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s138330182 | p02572 | u297802287 | 1598732590 | Python | Python (3.8.2) | py | Runtime Error | 21 | 8840 | 1531 | #include <bits/stdc++.h>
using namespace std;
using namespace __detail;
typedef long long ll;
#define ar array
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define all(x) (x).begin(), (x).end()
#define en '\n'
#define FILL(x, v) memset(x, v, sizeof(x))
#define pb push_back
#defi... | File "/tmp/tmpbkc7wirk/tmp1suourm4.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s052803494 | p02572 | u014386369 | 1598732589 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9028 | 191 | sum_all=[]
for i in range(N-1):
for j in range(i+1,N):
A[i]=A[i]%mod
A[j]=A[j]%mod
sum_all.append((A[i])*(A[j]))
sum=0
for n in sum_all:
sum+=n
print(sum%mod) | Traceback (most recent call last):
File "/tmp/tmpj7rdqjvs/tmp4uvm_0h9.py", line 2, in <module>
for i in range(N-1):
^
NameError: name 'N' is not defined
| |
s226417970 | p02572 | u470735879 | 1598732569 | Python | Python (3.8.2) | py | Runtime Error | 985 | 1935172 | 150 | import numpy as np
mod = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
ans = np.triu(np.outer(a, a), k=1).sum()
print(ans % mod)
| Traceback (most recent call last):
File "/tmp/tmpsohofpqp/tmpfn4l86o1.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s639956623 | p02572 | u655856480 | 1598732452 | Python | PyPy3 (7.3.0) | py | Runtime Error | 92 | 68612 | 321 | #include <bits/stdc++.h>
#define N 1000005
using namespace std;
int main(){
int64_t n,sum=0,l=0;
cin>>n;
int64_t a[n+1];
for(int i=1;i<=n;i++){
cin>>a[i];
sum+=a[i];
l+=(a[i]*a[i]);
}
int64_t result=((sum*sum)-l)/2;
cout<<result%1000000007<<endl;
return 0;
}... | File "/tmp/tmpg8v1erif/tmpyoaxop4t.py", line 5
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s610464230 | p02572 | u071920156 | 1598732451 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2208 | 94216 | 356 | n = int(input())
a_list = list(map(int, input().split()))
sum = 0
def mod(num):
if num > 10 ** 9 + 7:
amari = num % (10 ** 9 + 7)
return amari
j = 0
while j < n:
i = 0
while i < j:
sum += mod(a_list[i] * a_list[j])
if sum >= 10 ** 9 + 7:
sum = sum % (10 ** 9 + 7)
... | Traceback (most recent call last):
File "/tmp/tmpamu8yaaw/tmp0_i5_88b.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s252250176 | p02572 | u885068064 | 1598732439 | Python | Python (3.8.2) | py | Runtime Error | 1949 | 2731192 | 269 | import numpy as np
N = input()
A = np.array(list(map(int, input().split())))
s = 0
x, y = np.meshgrid(A, A)
s = (np.sum(x * y) - np.sum(A ** 2)) / 2
#for i in range(len(A) - 1):
# s += np.sum(A[i] * A[i + 1:])
ans = int(s % (10 ** 9 + 7))
print(ans) | Traceback (most recent call last):
File "/tmp/tmp05_3faee/tmpu_q4dag7.py", line 2, in <module>
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s535638705 | p02572 | u630237503 | 1598732435 | Python | Python (3.8.2) | py | Runtime Error | 212 | 30952 | 448 | def main():
N = int(input())
A = list(map(int, input().split()))
mod_v = 10**9 + 7
ans = [0] * (N + 1)
for i in range(0, N - 1):
ai = A[0]
aj = A[i + 1]
ans[0] += ai * aj
for j in range(1, N - 1):
ans[j] = (ans[j - 1] - A[j - 1] * A[j]) // A[j - 1] * A[j]
ret ... | Traceback (most recent call last):
File "/tmp/tmpk67qa4kc/tmpbzik89c5.py", line 20, in <module>
main()
File "/tmp/tmpk67qa4kc/tmpbzik89c5.py", line 2, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s604408290 | p02572 | u655856480 | 1598732404 | Python | PyPy3 (7.3.0) | py | Runtime Error | 105 | 68608 | 309 | #include <bits/stdc++.h>
#define N 1000005
using namespace std;
int main(){
int64_t n,sum=0,l=0;
cin>>n;
int64_t a[n+1];
for(int i=1;i<=n;i++){
cin>>a[i];
sum+=a[i];
l+=(a[i]*a[i]);
}
int64_t result=((sum*sum)-l)/2;
cout<<abs(result%1000000007)<<endl;
}
| File "/tmp/tmpjkgcz3x9/tmpcs9i8fqf.py", line 5
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s389484964 | p02572 | u837340160 | 1598732384 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 31552 | 268 | N = int(input())
A = list(map(int, input().split()))
def func(n):
if n == 1:
return 0
else:
sum = 0
for i in range(n-1):
sum += A[i]
return func(n-1) + sum * A[n-1]
ans = func(N)
mod = 10 ** 9 + 7
print(ans % mod)
| Traceback (most recent call last):
File "/tmp/tmpig1e9e7v/tmpsp7goa0s.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s027006487 | p02572 | u280790985 | 1598732372 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8904 | 475 | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
long long int mu=0,su=0,n,i,j;
long long int c=1000000007;
scanf("%lld",&n);
long long int l[n];
for(i=0;i<n;i++)
{
scanf("%lld",&l[i]);
}
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j+... | File "/tmp/tmp63kwryg8/tmprr81ybr9.py", line 6
int main()
^^^^
SyntaxError: invalid syntax
| |
s562116440 | p02572 | u655856480 | 1598732371 | Python | PyPy3 (7.3.0) | py | Runtime Error | 84 | 68624 | 309 | #include <bits/stdc++.h>
#define N 1000005
using namespace std;
int main(){
int64_t n,sum=0,l=0;
cin>>n;
int64_t a[n+1];
for(int i=1;i<=n;i++){
cin>>a[i];
sum+=a[i];
l+=(a[i]*a[i]);
}
int64_t result=((sum*sum)-l)/2;
cout<<abs(result%1000000007)<<endl;
}
| File "/tmp/tmpxf047u9_/tmputxqby1w.py", line 5
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s945333263 | p02572 | u630237503 | 1598732343 | Python | Python (3.8.2) | py | Runtime Error | 182 | 30756 | 472 | def main():
N = int(input())
A = list(map(int, input().split()))
mod_v = 10**9 + 7
ans = [0] * (N + 1)
for i in range(0, N - 1):
ai = A[0]
aj = A[i + 1]
ans[0] += ai * aj
for j in range(1, N - 1):
ans[j] = (ans[j - 1] - A[j - 1] * A[j]) // A[j - 1] * A[j]
ret ... | Traceback (most recent call last):
File "/tmp/tmp15loxcxz/tmpxk_k6d2f.py", line 21, in <module>
main()
File "/tmp/tmp15loxcxz/tmpxk_k6d2f.py", line 2, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s403369559 | p02572 | u243815850 | 1598732210 | Python | Python (3.8.2) | py | Runtime Error | 1386 | 924172 | 302 | N = int(input())
a = list(map(int, input().split()))
import numpy as np
a_ = np.array(a).reshape(-1, len(a))
all = np.dot(a_.T, a_)
taikaku = np.sum(np.diag(all))
all_ = np.sum(all)
if int(all_-taikaku)/2 >= (10**9+7):
print(int((all_-taikaku)/2) % (10**9+7))
else:
print(int((all_-taikaku)/2)) | Traceback (most recent call last):
File "/tmp/tmp2p2he0mc/tmpqnccicdx.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s910962321 | p02572 | u212539610 | 1598732175 | Python | Python (3.8.2) | py | Runtime Error | 2215 | 1486432 | 485 | N = int(input())
A = [int(a) for a in input().split()]
import numpy as np
mod = 10**9 + 7
def pairwise_combs_mask(a):
a = np.array(a, dtype=np.int64)
n = len(a)
L = n*(n-1) // 2
out = np.empty((L,2), dtype=a.dtype)
m = ~np.tri(len(a), dtype=bool)
out[:,0] = np.broadcast_to(a[:,None],(n,n))[m]... | Traceback (most recent call last):
File "/tmp/tmp8gi8adss/tmpaiwbq74g.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s255555423 | p02572 | u910536093 | 1598732116 | Python | Python (3.8.2) | py | Runtime Error | 2219 | 381800 | 312 | import sys
n = int(input())
a = (list(map(int, input().split())))
dx = 10 ** 9 + 7
a = [i % dx for i in a if i != 0]
ans = 0
alist = []
for i in range(n):
for j in range(i+1, n):
alist.append((a[i] * a[j]) % dx)
for i in range(len(alist)):
ans += alist[i]
ans %= dx
ans %= dx
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp1_9zvuel/tmpvewrf3fg.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s185529529 | p02572 | u774827549 | 1598732090 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8908 | 716 | #include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <iostream>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
/*vector<Type> v;
vector<Type> v();
vector<Type> v(n);
vector<Type> v(n, d);
vector<vector<Type>> vv;
vector<vector<Type>> vv();
vector<vector<Type>> vv(n);
vector<vector<Type>> ... | File "/tmp/tmp0u19n0ug/tmpfwy1ia61.py", line 6
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s889978715 | p02572 | u212539610 | 1598732082 | Python | Python (3.8.2) | py | Runtime Error | 2230 | 1484068 | 484 | N = int(input())
A = [int(a) for a in input().split()]
import numpy as np
mod = 10**9 + 7
def pairwise_combs_mask(a):
a = np.array(a, dtype=np.float64)
n = len(a)
L = n*(n-1)//2
out = np.empty((L,2), dtype=a.dtype)
m = ~np.tri(len(a),dtype=bool)
out[:,0] = np.broadcast_to(a[:,None],(n,n))[m]
... | Traceback (most recent call last):
File "/tmp/tmpv83pl0xk/tmpbtbm_n_q.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s386982374 | p02572 | u570391873 | 1598732074 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 31440 | 238 | test = int(input())
for t in range(test):
lst = map(int, input().split())
lst2 = list(lst)
sum = 0
for i in range(len(lst2)):
for j in range(i+1, len(lst2)):
sum = sum + lst2[i] * lst2[j]
print(sum) | Traceback (most recent call last):
File "/tmp/tmppfxroof3/tmpvpm1tr9g.py", line 1, in <module>
test = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s311152729 | p02572 | u917678406 | 1598732072 | Python | Python (3.8.2) | py | Runtime Error | 42 | 13228 | 178 | N = int(input())
NUM = 1000000007
A = [int(input()) for _ in range(N)]
MASS = 0
for i in range (N):
I = A[i] % NUM
I = (I * (N - 1)) % NUM
MASS += I
print(MASS % NUM) | Traceback (most recent call last):
File "/tmp/tmpt54fxfom/tmpg0ch7qlm.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s523390814 | p02572 | u326278153 | 1598732058 | Python | Python (3.8.2) | py | Runtime Error | 107 | 31612 | 183 | n = int(input())
a = set(list(map(int, input().split())))
mod = 1000000007
res = 0
for i in range(n - 1):
main = a.pop(0)
res = (res + main * sum(a) % mod) % mod
print(res) | Traceback (most recent call last):
File "/tmp/tmp54xxl4i6/tmprt_3kw3_.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s664490344 | p02572 | u438720156 | 1598731983 | Python | Python (3.8.2) | py | Runtime Error | 48 | 25052 | 174 | x=int(input())
lst=[]
for i in range(x):
lst.append(map(int,input().split()))
sum=0
for i in range(x):
for j in range(1,x):
sum=sum+(lst[i]*lst[j])
print(sum)
| Traceback (most recent call last):
File "/tmp/tmpi22a9n61/tmplyxtqs8k.py", line 1, in <module>
x=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s538171411 | p02572 | u007815330 | 1598731960 | Python | PyPy3 (7.3.0) | py | Runtime Error | 157 | 93812 | 721 | # This is a sample Python script.
# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
import math
from functools import reduce
def gcd(numbers):
return reduce(math.gcd, numbers)
n = int(input())
numbers = list(map(i... | Traceback (most recent call last):
File "/tmp/tmp1e6mww8w/tmpm35sxa1h.py", line 11, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s849408562 | p02572 | u736470924 | 1598731954 | Python | Python (3.8.2) | py | Runtime Error | 163 | 48724 | 240 | import decimal
def resolve():
n = int(input())
A = list(map(decimal.Decimal, input().split()))
A_sum = sum(A)
ind_sum = 0
for a in A:
ind_sum += a**2
print((A_sum**2 - ind_sum)//2 % (10**9 + 7))
resolve() | Traceback (most recent call last):
File "/tmp/tmpae1byeyc/tmp8ko8fg1n.py", line 14, in <module>
resolve()
File "/tmp/tmpae1byeyc/tmp8ko8fg1n.py", line 5, in resolve
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s424451849 | p02572 | u953020348 | 1598731832 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9068 | 77 | for i in range(N-1):
tmp+=A[i]
ans+=tmp*A[i+1]
print(ans%((10**9)+7)) | Traceback (most recent call last):
File "/tmp/tmp8btx7n0o/tmpk5od8kch.py", line 1, in <module>
for i in range(N-1):
^
NameError: name 'N' is not defined
| |
s060156838 | p02572 | u817778491 | 1598731619 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8992 | 1329 | #include<bits/stdc++.h>
using namespace std;
const long long INF = 10e9+7;
string multiply(string num1, string num2)
{
int len1 = num1.size();
int len2 = num2.size();
if (len1 == 0 || len2 == 0)
return "0";
vector<int> result(len1 + len2, 0);
int i_n1 = 0;
int i_n2 = 0;
for (... | File "/tmp/tmp3laro4fw/tmp9hatq0k4.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s734928147 | p02572 | u879866069 | 1598731565 | Python | PyPy3 (7.3.0) | py | Runtime Error | 363 | 87232 | 222 | import numpy as np
N = int(input())
n = 10 ** 9 + 7
A_n = np.array([int(i) % n for i in input().split()])
A_n_mod = np.sum([(A_n[i] * A_n[j]) % n for i in range(N-1) for j in range(i+1, N, 1)])
res = A_n_mod % n
print(res) | Traceback (most recent call last):
File "/tmp/tmpbfeyzr2z/tmpv48pfuyt.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s185086554 | p02572 | u782455492 | 1598731541 | Python | Python (3.8.2) | py | Runtime Error | 45 | 13316 | 270 | mo=1000000007
def fin(A,n):
su=0;
pro=0;
for i in range(0,n):
su=(su%mo+A[i]%mo)%mo
pro=(pro%mo+((A[i]%mo)*(A[i]%mo))%mo)%mo
ans=((su%mo)*(su%mo)-pro+mo)%mo
return ans/2
A=[]
n=int(input())
for i in range(0,n):
ele=int(input())
A.append(ele)
print(fin(A,n)) | Traceback (most recent call last):
File "/tmp/tmp4w8s26gb/tmp_t9cm4jh.py", line 12, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s625427019 | p02572 | u021877437 | 1598731499 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8928 | 741 | #include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
int main()
{
const long long MOD = (1000000000 + 7);
int N;
cin >> N;
vector<unsigned long long> vec(N);
unsigned long long v;
for (int i = 0; i < N; i++) {
cin >> v;
vec[i] = v;
}
vector<uns... | File "/tmp/tmprcojflno/tmprim27otg.py", line 5
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s271351815 | p02572 | u719044784 | 1598731458 | Python | Python (3.8.2) | py | Runtime Error | 48 | 25064 | 168 | u=0
u=int(input())
A = map(int,input().split())
n = len(A)
prr = 0
for i in range(n):
for j in range(i + 1, n):
prr = prr + A[i] * A[j]
print(prr)
| Traceback (most recent call last):
File "/tmp/tmpjrhqensn/tmpw80jtkza.py", line 2, in <module>
u=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s984106007 | p02572 | u389530753 | 1598731450 | Python | PyPy2 (7.3.0) | py | Runtime Error | 332 | 106604 | 184 | N=int(input())
S=list(input().split())
A=[int(n) for n in S]
ans=int(0)
count=0
for i in range(N):
for j in range(i+1,N):
count += A[i]*A[j]
t=count%(10**9+7)
print(t) | Traceback (most recent call last):
File "/tmp/tmpxqbdf30f/tmpf51puwpj.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s934565666 | p02572 | u054966391 | 1598731430 | Python | Python (3.8.2) | py | Runtime Error | 78 | 31424 | 178 | n=int(input())
l=list(map(int,input().split()))
s=0
for i in range(len(l)):
while(j!=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/tmp3x48g_tg/tmpfc632g_j.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s565997927 | p02572 | u487183818 | 1598731409 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8920 | 128 | n=int(input())
l=list(map(int, input().split())
s=0
mod=(10**9)+7
for i in l:
for j in l:
if(i!=j):
s=s+(i*j)
print(s%mod) | File "/tmp/tmpcx1ollpd/tmpypl3t3r_.py", line 2
l=list(map(int, input().split())
^
SyntaxError: '(' was never closed
| |
s730428138 | p02572 | u805925900 | 1598731380 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9004 | 296 | #include <iostream>
using namespace std;
#define M 1000000007
int main()
{
long long a[200000], i,n, j, s=0, su=0;
cin >> n;
for (i = 0; i < n; i++)
{
cin >> a[i];
s=(s+a[i])%M;
}
for (i = 0; i < n; i++)
{
s -= a[i];
s+=M;
s%=M;
su += (a[i] * s)%M;
su %= M;
}
cout << su;
} | File "/tmp/tmp_qsodzy7/tmp0euc40gm.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s922511236 | p02572 | u243815850 | 1598731380 | Python | Python (3.8.2) | py | Runtime Error | 1358 | 923320 | 222 | N = int(input())
a = list(map(int, input().split()))
import numpy as np
a_ = np.array(a).reshape(-1, len(a))
all = np.dot(a_.T, a_)
taikaku = np.sum(np.diag(all))
all_ = np.sum(all)
print(int((all_-taikaku)/2) % (10**9+7)) | Traceback (most recent call last):
File "/tmp/tmp3dl7q18b/tmpgds39yku.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s058182776 | p02572 | u600673553 | 1598731337 | Python | PyPy3 (7.3.0) | py | Runtime Error | 131 | 94292 | 137 | n = int(input())
a = list(map(int,input().split()))
t = 10**9+7
ans = (sum(a)**2)%t
for i in range(n):
ans = ans-(a[n]**2)
print(ans%t) | Traceback (most recent call last):
File "/tmp/tmp04d9osio/tmpnbkr8utp.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s655268453 | p02572 | u556594202 | 1598731298 | Python | Python (3.8.2) | py | Runtime Error | 2218 | 1935360 | 239 | import numpy as np
n = int(input())
a = np.array(list(map(int,input().split())))
A = a.reshape(1, -1)
Asq = np.transpose(A) @ A
Asq = np.triu(Asq) - np.diag(np.ndarray.diagonal(Asq))
Asq = Asq % (10**9+7)
print(np.sum(Asq) % (10**9+7))
| Traceback (most recent call last):
File "/tmp/tmp_px9wppf/tmpqyx6otyt.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s166937614 | p02572 | u182106353 | 1598731215 | Python | Python (3.8.2) | py | Runtime Error | 124 | 31492 | 277 | import math
import numpy as np
n=int(input())
sum=0
a=list()
for i in range(0,n):
b = int(input())
a.append(b)
i =0
j=i+1
for i in range(0,n-1):
for j in range(i+1,n):
sum+=a[i]*a[j]
val=math.pow(10,9)+7
sum = np.mod(sum,val)
print (int(sum))
| Traceback (most recent call last):
File "/tmp/tmpz9chk4ad/tmpjgo8oyod.py", line 4, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s325636839 | p02572 | u531456543 | 1598731181 | Python | Python (3.8.2) | py | Runtime Error | 257 | 31436 | 456 | n= int(input())
lst = [int(i) for i in input().split()]
lst = sorted(lst)
count = 0
d_lst = []
for i in range(len(lst)):
if lst[i] not in d_lst:
if lst[i] == lst[i+1]:
d_lst.append(lst[i])
for d in d_lst:
count += d**2
lst = list(set(lst))
for i in range(len(lst)):
for j in range(i+1,le... | Traceback (most recent call last):
File "/tmp/tmpl50a3is3/tmp45f6y_9r.py", line 1, in <module>
n= int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s741640664 | p02572 | u787792408 | 1598731177 | Python | PyPy2 (7.3.0) | py | Runtime Error | 101 | 106704 | 255 | n = int(input())
a = [int(x) for x in input().split()]
ans = 0
for i in range(n-1):
for j in range(n-1-i):
hoge = a[i]*a[i+1+j] % 1000000007
ans = ans + hoge
if ans >= 1000000007:
ans = ans - 1000000007
print(ans) | Traceback (most recent call last):
File "/tmp/tmpm2h7hq3j/tmpzolx2q_k.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s066838055 | p02572 | u423162841 | 1598731176 | Python | PyPy3 (7.3.0) | py | Runtime Error | 100 | 68576 | 175 | N=int(input())
inputValue= input()
l=inputValue.split(" ")
result= 0
for i in range(N):
for j in range(i+1, N):
result=result+ int(l[i])* int(l[j])
print result%1000000007 | File "/tmp/tmphbgfx1va/tmpkt4l4foi.py", line 9
print result%1000000007
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s272216871 | p02572 | u713767919 | 1598731167 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8976 | 317 | def main():
input()
mod = 10**9 + 7
arr = sorted(map(int, input().split()))
arr.reverse()
xxx=False
sm = arr[0] + arr[1]
ans = arr[0] * arr[1] % mod
for x in range(2, len(arr)):
ans += sm * arr[x]
sm += arr[x]
print(ans % mod)
if __name__ == '__main__':
main() | File "/tmp/tmpya7nn75k/tmpx6g7s4_x.py", line 6
xxx=False
TabError: inconsistent use of tabs and spaces in indentation
| |
s718850518 | p02572 | u352513183 | 1598731166 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2229 | 684772 | 275 | n = int(input())
a = list(map(int, input().split()))
m = (10**9 + 7)
for i in range(n):
if abs(a[i]-m) < a[i]:
a[i] = x - m
result = [(a[i]*a[j])%m for i in range(n) for j in range(n) if i < j]
result = sum(result)%m
if(result < 0):
result += m
print(result) | Traceback (most recent call last):
File "/tmp/tmpma1i68_5/tmpm87o2np8.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s024532486 | p02572 | u438720156 | 1598731166 | Python | Python (3.8.2) | py | Runtime Error | 43 | 13168 | 161 | x=int(input())
lst=[]
for i in range(x):
lst.append(int(input()))
sum=0
for i in range(x):
for j in range(1,x):
sum=sum+(lst[i]*lst[j])
print(sum)
| Traceback (most recent call last):
File "/tmp/tmpxjigstih/tmp8deuvqi3.py", line 1, in <module>
x=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s131677751 | p02572 | u917678406 | 1598731153 | Python | Python (3.8.2) | py | Runtime Error | 75 | 31384 | 197 | N = int(input())
NUM = 1000000007
A = [list(map(int, input().split())) for _ in range(N)]
MASS = 0
for i in range (N):
I = A[i] % NUM
I = (I * (N - 1)) % NUM
MASS += I
print(MASS % NUM) | Traceback (most recent call last):
File "/tmp/tmp52_m4gf8/tmpu0ccd74d.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s236337903 | p02572 | u680540873 | 1598731138 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9004 | 176 | inport numpy as np
N = int(input())
Sum = []
A = list(map(int, input().split()))
Sum = [A[i]*A[j] for j in range(N) for i in range(j)]
print(np.array(Sum).sum()%(1000000000+7)) | File "/tmp/tmpfv33jnq2/tmpeoxndni3.py", line 1
inport numpy as np
^^^^^
SyntaxError: invalid syntax
| |
s130000652 | p02572 | u531456543 | 1598731133 | Python | Python (3.8.2) | py | Runtime Error | 251 | 31532 | 450 | n= int(input())
lst = [int(i) for i in input().split()]
lst = sorted(lst)
count = 0
d_lst = []
for i in range(len(lst)):
if lst[i] not in d_lst:
if lst[i] == lst[i+1]:
d_lst.append(lst[i])
for d in d_lst:
count += d**2
lst = set(lst)
for i in range(len(lst)):
for j in range(i+1,len(lst)... | Traceback (most recent call last):
File "/tmp/tmpjdri51sn/tmp3x19dxlg.py", line 1, in <module>
n= int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s696436507 | p02572 | u913565745 | 1598731125 | Python | Python (3.8.2) | py | Runtime Error | 744 | 358020 | 293 | def main():
from sys import stdin
readline = stdin.readline
N = int(readline().rstrip())
A = [ int(x) for x in readline().rstrip().split()]
total = 0
for i in range(N):
An = int(A.pop())
total += (sum(An * A))
print(total % (10**9 + 7))
main() | Traceback (most recent call last):
File "/tmp/tmpyaj6zpys/tmpl40zzzak.py", line 16, in <module>
main()
File "/tmp/tmpyaj6zpys/tmpl40zzzak.py", line 5, in main
N = int(readline().rstrip())
^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s191269215 | p02572 | u060505280 | 1598731089 | Python | Python (3.8.2) | py | Runtime Error | 2229 | 3525888 | 255 | 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_r = (np.eye(N) + 1) % 2
times_sum = (times * eye_r / 2).sum()
print(int(times_sum) % (10**9 + 7)) | Traceback (most recent call last):
File "/tmp/tmpnglh4k1n/tmpp52lwqfk.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s514013170 | p02572 | u707960254 | 1598731070 | Python | PyPy3 (7.3.0) | py | Runtime Error | 129 | 94140 | 203 | N = int(input())
A = list(map(int, input().split()))
mod = int(1e9+7)
all = pow(sum(A), 2, mod=mod)%mod
d = 0
for a in A:
d += pow(a,2)
d = d%mod
print(int((all-d)*pow(2, mod-2, mod=mod))%mod)
| Traceback (most recent call last):
File "/tmp/tmpyxess65e/tmp2me3ou69.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s899282099 | p02572 | u551368876 | 1598731047 | Python | PyPy3 (7.3.0) | py | Runtime Error | 116 | 85572 | 339 | n = int(input())
A = [int(input()) for i in range(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]
print(((array_sum_square - individual_square_sum)... | Traceback (most recent call last):
File "/tmp/tmpcaothcbn/tmp82pxash7.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s006794360 | p02572 | u059238013 | 1598731034 | Python | Python (3.8.2) | py | Runtime Error | 2220 | 1817668 | 266 | #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) - np.sum(np.diag(tmp)))%(10**9+7)
print(int(ans)) | Traceback (most recent call last):
File "/tmp/tmp2hvkb2nt/tmp0n2_jshr.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s704972108 | p02572 | u444238096 | 1598730999 | Python | PyPy3 (7.3.0) | py | Runtime Error | 105 | 68668 | 134 | import operator
import numpy as np
N=int(input())
A = list(map(int, input().split()))
data = np.array(A)
print(data.cumprod()[-1])
| Traceback (most recent call last):
File "/tmp/tmp_7oi3sqn/tmp463axo8_.py", line 4, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s042834112 | p02572 | u939790872 | 1598730986 | Python | PyPy3 (7.3.0) | py | Runtime Error | 225 | 94164 | 563 | N = int(input())
A = list(map(int, input().split()))
ans = 1
res = 0
def xgcd(a, b):
x0, y0, x1, y1 = 1, 0, 0, 1
while b != 0:
q, a, b = a // b, b, a % b
x0, x1 = x1, x0 - q * x1
y0, y1 = y1, y0 - q * y1
return a, x0, y0
def modinv(a, m):
g, x, y = xgcd(a, m)
if g != 1:
... | Traceback (most recent call last):
File "/tmp/tmpz0ldybcg/tmpipterpyl.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s051684515 | p02572 | u886860078 | 1598730970 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8980 | 396 | #include <bits/stdc++.h>
using namespace std;
void solve(){
unsigned long long mod=1000*1000*1000+7;
unsigned long long n;
cin>>n;
unsigned long long a[n];
for (unsigned long long i=0; i<n; i++) cin>>a[i];
unsigned long long su=0,m=0;
for (unsigned long long i=0; i<n; i++){
su+=a[i];
m+=a[i]*a[i];
}
unsign... | File "/tmp/tmp_xj6sxa2/tmpgenma5vt.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s866909968 | p02572 | u963526071 | 1598730949 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9016 | 164 | n = int(input())
lst = list(map(int, input().split()))
summary = 0
for i range(n):
for k in range(i+1, n):
summary += lst[i]*lst[k]
print(summary%((10**9)+7)) | File "/tmp/tmp3x4cps2w/tmp_615fq49.py", line 4
for i range(n):
^^^^^
SyntaxError: invalid syntax
| |
s056097407 | p02572 | u071211072 | 1598730947 | Python | PyPy3 (7.3.0) | py | Runtime Error | 87 | 74996 | 263 | input()
lis = list(map(int,input()))
def sol(lis):
MAX = 10**9+7
s = 0
for i in lis:
s = (s%MAX)+i%MAX
r = 0
sq = (s%MAX)*(s%MAX)
for i in lis:
r = (r%MAX)+(i%MAX)*(i%MAX)
r = (sq-r)//2
r%=MAX
print(r)
sol(lis)
| Traceback (most recent call last):
File "/tmp/tmpyt9_kz_5/tmp3v0jqjxn.py", line 1, in <module>
input()
EOFError: EOF when reading a line
| |
s097972311 | p02572 | u438720156 | 1598730931 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8916 | 159 | x=int(input())
lst=[]
for i in range(x):
lst.append(int(input())
sum=0
for i in range(x):
for j in range(1,x):
sum=sum+(lst[i]*lst[j])
print(sum) | File "/tmp/tmp9n70hsis/tmpdkg1qtzx.py", line 4
lst.append(int(input())
^
SyntaxError: '(' was never closed
| |
s175635794 | p02572 | u551368876 | 1598730916 | Python | PyPy3 (7.3.0) | py | Runtime Error | 125 | 85532 | 343 | n = int(input())
A = [int(input()) for i in range(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]
print(int((array_sum_square - individual_square_s... | Traceback (most recent call last):
File "/tmp/tmpo0nrjmni/tmpww8xcjbi.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s607045551 | p02572 | u557792847 | 1598730884 | Python | Python (3.8.2) | py | Runtime Error | 74 | 31580 | 276 | N = int(input())
An = list(map(int, input().split()))
An_s = collections.Counter(An)
total = 0
for k in An_s:
total += k
ans = 0
for A, v in An_s.items():
At = A * (total-A)*v
# print(A, total, At, ans)
ans = (ans+At) % (10**9+7)
# print(ans)
print(ans//2) | Traceback (most recent call last):
File "/tmp/tmplnwa_pn4/tmpwx81czd_.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s961096230 | p02572 | u806988802 | 1598730818 | Python | Python (3.8.2) | py | Runtime Error | 2460 | 153112 | 240 | n = input()
max = 10**9 + 7
a_list = [int(a) % max for a in input().split(" ")]
total = 0
for i in range(0, len(a_list)-1):
print(a_list[i], a_list[i+1:])
total += a_list[i] * sum(a_list[i+1:])
total = total % max
print(total)
| Traceback (most recent call last):
File "/tmp/tmpe69j0qpt/tmph066mwzt.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s714997426 | p02572 | u806988802 | 1598730750 | Python | Python (3.8.2) | py | Runtime Error | 2469 | 153012 | 259 | n = input()
max = 10**9 + 7
a_list = [int(a) % max for a in input().split(" ")]
print(sum(a_list))
total = 0
for i in range(0, len(a_list)-1):
print(a_list[i], a_list[i+1:])
total += a_list[i] * sum(a_list[i+1:])
total = total % max
print(total)
| Traceback (most recent call last):
File "/tmp/tmpkvu3kv2p/tmpfoydwmsz.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s229358613 | p02572 | u879921371 | 1598730743 | Python | Python (3.8.2) | py | Runtime Error | 905 | 923636 | 192 | import numpy as np
def main():
m=1000000007
n=int(input())
a=np.array(list(map(int,input().split())))
b=np.outer(a,a)
c=np.sum(b)
d=np.dot(a,a)
e=c-d
e=e//2
print(e%m)
main() | Traceback (most recent call last):
File "/tmp/tmpp8hy4l63/tmpp3xu6qph.py", line 12, in <module>
main()
File "/tmp/tmpp8hy4l63/tmpp3xu6qph.py", line 4, in main
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s474431179 | p02572 | u454649802 | 1598730737 | Python | Python (3.8.2) | py | Runtime Error | 2240 | 953504 | 215 | 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:
return (num[0] * sum(num[1:])) + rec(num[1:])
print(rec(num) % mod) | Traceback (most recent call last):
File "/tmp/tmp12tl9bzh/tmp7cxavq5_.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s465075235 | p02572 | u817778491 | 1598730708 | Python | Python (3.8.2) | py | Runtime Error | 44 | 13288 | 223 | n = int(input())
l =[]
x = 10e9+7
product=0
sum=0
for a in range(n):
b = int(input())
l.append(b)
for i in range(n):
for j in range(i+1,n):
product = int(l[i])*int(l[j])
sum = sum+product
sum = sum % x
print(sum)
| Traceback (most recent call last):
File "/tmp/tmprnhhrwpo/tmpbvkhe0yr.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s182048693 | p02572 | u822984882 | 1598730678 | Python | Python (3.8.2) | py | Runtime Error | 88 | 32488 | 360 | if __name__ == "__main__":
n = int(input())
y = list(input().split())
# print(y)
x = [int(x) for x in y]
# print(n)
# print(x)
test1 = list(itertools.combinations(x,2))
test2 = 0
for el in test1:
test3 = el[0]
for i in range(1, len(el)):
test3 *= el[i]
... | Traceback (most recent call last):
File "/tmp/tmpz0a84wm_/tmphw7abe_f.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s194902722 | p02572 | u071211072 | 1598730552 | Python | PyPy3 (7.3.0) | py | Runtime Error | 124 | 68500 | 221 | input()
lis = list(map(int,input().split()))
def sol(lis):
MAX = 10**9+7
s = sum(lis)
s%=MAX
r = 0
sq = s*s
sq%=MAX
for i in lis:
r+=i**2
r = (sq-r)//2
r%=MAX
print(r)
sol(lis)
| File "/tmp/tmpw_2t2lt1/tmpr7b12859.py", line 5
s = sum(lis)
TabError: inconsistent use of tabs and spaces in indentation
| |
s428341828 | p02572 | u818213347 | 1598730546 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9000 | 144 | n = int(input())
l = list(map(int,input().split()))
ans = 0
for i in range(n):
ans += ((l[i]*sum(l[i+1:n]))%1000000007
print(ans%1000000007) | File "/tmp/tmpmfalhdpd/tmp96w4fdha.py", line 5
ans += ((l[i]*sum(l[i+1:n]))%1000000007
^
SyntaxError: '(' was never closed
| |
s326733050 | p02572 | u879921371 | 1598730532 | Python | Python (3.8.2) | py | Runtime Error | 1153 | 918732 | 161 | import numpy as np
m=1000000007
n=int(input())
a=np.array(list(map(int,input().split())))
b=np.outer(a,a)
c=np.sum(b) //2
d=np.dot(a,a)
d=d // 2
e=c-d
print(e%m) | Traceback (most recent call last):
File "/tmp/tmpb64merfx/tmp8hl3l799.py", line 3, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s557958646 | p02572 | u185935459 | 1598730529 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8984 | 512 | #include<bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (int)(n); i++)
#define sum(a) accumulate(a.begin(),a.end(),0LL)
#define put(i) cout<<fixed<<i<<endl
using namespace std;
using ll = long long;
int main(){
ll n; cin >> n;
vector<ll> a(n); rep(i,n) cin >> a[i];
//ll n = 1e5; vector<ll> a(1... | File "/tmp/tmp2jr_fx48/tmpb2ul9xyv.py", line 5
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s897968843 | p02572 | u703742468 | 1598730506 | Python | Python (3.8.2) | py | Runtime Error | 42 | 13136 | 156 | N = int(input())
A = [int(input()) for i in range(int(N))]
ans = 0
for i in range(N-1):
ans += (A[i:i+1][0]*sum(A[i+1:]))%(10**9+7)
print(ans%(10**9+7)) | Traceback (most recent call last):
File "/tmp/tmp568xwhkv/tmpcnwpwo2k.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s066908332 | p02572 | u546853743 | 1598730484 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8968 | 164 | n=int(input())
ai = list(map(int,input().split()))
sum = 0
i=0
k=1
while i<n-1:
while k<n-i:
sum += ai[i]*ai[i+k]
k++
i++
sum %= 1000000007
print(sum) | File "/tmp/tmpxhta23xg/tmpkiu85v5d.py", line 8
sum += ai[i]*ai[i+k]
^
IndentationError: expected an indented block after 'while' statement on line 7
| |
s279355324 | p02572 | u616382321 | 1598730476 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 31616 | 208 | N = int(input())
A = list(map(int, input().split()))
start_v = (sum(A) - A[0])*A[0]
ans = start_v
for i in range(2, N):
ans += int((start_v - sum(A[1:i])*A[0])*A[i-1]/A[0])
print(ans%(10**9 + 7))
| Traceback (most recent call last):
File "/tmp/tmpxahcx_fs/tmp_vik119l.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s153768537 | p02572 | u419056960 | 1598730473 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9008 | 506 | #include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<stack>
#include<string>
using namespace std;
int main()
{
const int mod = int(pow(10.0, 9.0)) + 7;
int N;
cin >> N;
long long int* A = new long long int[N+1];
for (int i = 1; i <= N; i++)
{
cin >> A[i];
}
long long int sum =... | File "/tmp/tmpl7f__3dx/tmpiqvlh2fr.py", line 8
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.