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
s822283304
p02572
u134185377
1598881106
Python
Python (3.8.2)
py
Runtime Error
2246
1961776
200
import numpy as np M=10**9+7 N=int(input()) Alist=np.array([int(i) for i in input().split()]) Amat=np.outer(Alist,Alist) Atri=Amat[np.nonzero(np.tril(Amat,k=-1))] sumsum=np.sum(Atri)%M print(sumsum)
Traceback (most recent call last): File "/tmp/tmpx89bn4ft/tmpsxowwbch.py", line 3, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s810151033
p02572
u134185377
1598880808
Python
Python (3.8.2)
py
Runtime Error
1934
1927676
182
import numpy as np M=10**9+7 N=int(input()) Alist=np.array([int(i) for i in input().split()]) Amat=np.outer(Alist,Alist) Atri=np.tril(Amat,k=-1) sumsum=np.sum(Atri)%M print(sumsum)
Traceback (most recent call last): File "/tmp/tmpn0pwx7v8/tmph6p2nhbq.py", line 3, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s363870643
p02572
u857673087
1598868687
Python
Python (3.8.2)
py
Runtime Error
74
31436
154
n = int(input()) a = list(map(int,input().split())) mod= 10**9+7 A = sum(a) ans=0 for i in a: A -= i A%=mod ans += A*x ans%=mod print(ans)
Traceback (most recent call last): File "/tmp/tmpggwxc5wp/tmpu5mbsxaf.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s928591246
p02572
u000138965
1598867684
Python
PyPy3 (7.3.0)
py
Runtime Error
2239
994716
259
# -*- using:utf-8 -*- from itertools import combinations if __name__ == "__main__": n = int(input()) li = list(map(int, input().split())) array = list(combinations(li, 2)) sum = 0 for i in range(n): sum += array[i][0] * array[i][1] print(sum)
Traceback (most recent call last): File "/tmp/tmph6o05v4w/tmp6patj971.py", line 5, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s707589920
p02572
u000138965
1598867523
Python
PyPy3 (7.3.0)
py
Runtime Error
2237
930580
188
import itertools n = int(input()) li = list(map(int, input().split())) array = list(itertools.combinations(li, 2)) sum = 0 for i in range(n): sum += array[i][0] * array[i][1] print(sum)
Traceback (most recent call last): File "/tmp/tmpofcqysc4/tmp9218nhyj.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s767579428
p02572
u000138965
1598867399
Python
PyPy3 (7.3.0)
py
Runtime Error
2229
991760
251
# -*- using:utf-8 -*- import itertools if __name__ == "__main__": n = int(input()) li = list(map(int, input().split())) array = list(itertools.combinations(li, 2)) sum = 0 for i in range(n): sum += array[i][0] * array[i][1] print(sum)
Traceback (most recent call last): File "/tmp/tmpz29raxcf/tmp0gjnfrmy.py", line 5, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s548612580
p02572
u588592871
1598863481
Python
Python (3.8.2)
py
Runtime Error
52
25164
179
n=int(input()) a=list(input().split(' ')) total=0 S_i=0 for i in range(n-1): S_i+=a[n-1-i] S_i=S_i%(7+10**9) total+=S_i*a[n-2-i] total=total%(7+10**9) print(total)
Traceback (most recent call last): File "/tmp/tmp1n3mic3h/tmpev5zmgkc.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s412072211
p02572
u730807152
1598858963
Python
Python (3.8.2)
py
Runtime Error
24
9064
168
n = int(input()) a = list(map(int, input().split())) ans = 0 double = 0 for i in a: double += i*i ans = (sum(a) * sum(a) - double) // 2 print((ans % (10**9 + 7))
File "/tmp/tmpkx6wprw9/tmpz8ijve6n.py", line 11 print((ans % (10**9 + 7)) ^ SyntaxError: '(' was never closed
s574504255
p02572
u262632239
1598829961
Python
Python (3.8.2)
py
Runtime Error
109
31556
150
n = int(input()) a = list(map(int,input().split())) c = 0 for i in range(n): for j in range(i+1,n+1): c += a[i]*a[j] print(c % (10**9 + 7))
Traceback (most recent call last): File "/tmp/tmpr4zcyvxn/tmpkaj6m5p6.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s527946322
p02572
u262632239
1598829839
Python
Python (3.8.2)
py
Runtime Error
108
31608
153
n = int(input()) a = list(map(int,input().split())) c = 0 for i in range(1,n): for j in range(i+1,n+1): c += a[i]*a[j] print(c % (10**9 + 7))
Traceback (most recent call last): File "/tmp/tmprggyw6bg/tmpuo4_rp5o.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s766840288
p02572
u682894596
1598827680
Python
Python (3.8.2)
py
Runtime Error
25
8948
260
N = int(input()) a = list(map(int, input().split(" "))) s = 0 for i in range(0,N): s += a[i] s = s*s for i in range(0,N): s -= a[i]*a[i] if s % 2 = 0: s = s % 2*(10**9 +7) s = s/2 else: s = (s + 10**9 + 7) % 2*(10**9 + 7) s = s/2 print(int(s))
File "/tmp/tmp8_qdu_n9/tmpkx_hngqk.py", line 12 if s % 2 = 0: ^^^^^ SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?
s515394715
p02572
u760154761
1598826472
Python
PyPy3 (7.3.0)
py
Runtime Error
90
74576
290
import numpy as np N = int(input()) A = list(map(int,input().split())) B = np.zeros(N) B[0] = A[0] c = 0 for i in range(1, N): B[i] = B[i - 1] + A[i] for j in range(N - 1): c += ((A[j] % (10 ** 9 + 7)) * ((B[N - 1] - B[j]) % (10 ** 9 + 7))) % (10 ** 9 + 7) print(int(c % (10 ** 9 + 7)))
Traceback (most recent call last): File "/tmp/tmpqjuxxocu/tmpnydq5g2t.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s841041798
p02572
u335950809
1598825141
Python
Python (3.8.2)
py
Runtime Error
47
25020
200
m = 1000000007 n = int(input()) a = map(int,input().split()) s = [] for i in range(n-1): for j in range(i+1,n): #print(a[i],a[j]) s.append(a[i]*a[j]) ans = sum(s) % m print(ans)
Traceback (most recent call last): File "/tmp/tmpnzq6lnej/tmp0kwl6co3.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s260826747
p02572
u620259318
1598819877
Python
Python (3.8.2)
py
Runtime Error
45
25136
171
x = 10 ** 9 + 7 n = int(input()) l = list(map(int, input().split()) % x) ans = 0 for i in range(n): for j in range(i + 1, n): ans += l[i] * l[j] print(ans)
Traceback (most recent call last): File "/tmp/tmpb2o1b9yb/tmpfxejk845.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s568756935
p02572
u347640436
1598817389
Python
Python (3.8.2)
py
Runtime Error
24
9108
176
l = input() a = l.split(' ') tmp = 0 tmp2 = 0 for i in range(n): tmp += int(a[i]) for i in range(n): tmp2 += int(a[i])*int(a[i]) print((tmp*tmp-tmp2)//2%1000000007)
Traceback (most recent call last): File "/tmp/tmp_vrzo55i/tmp_f7jvc_a.py", line 1, in <module> l = input() ^^^^^^^ EOFError: EOF when reading a line
s011931118
p02572
u595600198
1598803839
Python
Python (3.8.2)
py
Runtime Error
24
8964
235
N = int(input()) input_list = list(map(int,input().split())) ans = 0 for i in range(N): if i!=N-1: for j in range(i+1,N): ans += input_list[i]*input_list[j] if ans >= 10**9+7: ans = ans % (10**9+7 print(ans)
File "/tmp/tmpquu6x_k4/tmp2pg7n10p.py", line 10 ans = ans % (10**9+7 ^ SyntaxError: '(' was never closed
s814600004
p02572
u770265284
1598799001
Python
Python (3.8.2)
py
Runtime Error
22
8956
751
#include<bits/stdc++.h> #define fr(i,c,b) for(int i=c;i<b;i++) #define frl(i,c,b) for(ll i=c;i<b;i++) #define si(x) int x; scanf("%d", &x) #define sll(x) ll x; scanf("%lld", &x) #define pi(x) printf("%d", x) #define pll(x) printf("%lld", x) #define nl printf("\n") #define watch(x) cout << (#x) << " is " << (x) << endl ...
File "/tmp/tmpp11wibo1/tmpvn84l8jm.py", line 14 typedef long long int ll; ^^^^ SyntaxError: invalid syntax
s533400080
p02572
u686230543
1598795318
Python
Python (3.8.2)
py
Runtime Error
126
25000
226
mod = 10 ** 9 + 7 n = int(input()) a_sum = 0 sq_sum = 0 for a in map(int, input().split()): a_sum = (a_sum + a) % mod sq_sum = (sq_sum + a * a) % mod res = (a_sum * a_sum - sq_sum) % mod print(-(p // 2) % mod * res % mod)
Traceback (most recent call last): File "/tmp/tmpbj0n1i0t/tmpvu7067_5.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s559546543
p02572
u186820109
1598794881
Python
Python (3.8.2)
py
Runtime Error
23
9100
153
i = 0 j = i+1 ans = 0 while i != n - 1: ans = (ans+(a[i] * a[j])) % 1000000007 j += 1 if j == n: i += 1 j = i + 1 print(ans)
Traceback (most recent call last): File "/tmp/tmpq5dxe06t/tmpq1xnj8_y.py", line 4, in <module> while i != n - 1: ^ NameError: name 'n' is not defined
s930348420
p02572
u186820109
1598794722
Python
Python (3.8.2)
py
Runtime Error
24
8996
131
i = 0 j = i+1 ans = 0 while i != n - 1: ans += a[i] * a[j] j += 1 if j == n: i += 1 j = i + 1 print(ans % 1000000007)
Traceback (most recent call last): File "/tmp/tmpzzx_xbxm/tmp3j6jmv6s.py", line 4, in <module> while i != n - 1: ^ NameError: name 'n' is not defined
s753347907
p02572
u914693053
1598794260
Python
Python (3.8.2)
py
Runtime Error
29
9016
196
n=int(input()) a=list(map(int,input().split())) if n==1: print(a[0]) else: l=list(map(lambda z:z**2,a) x=sum(a) y=sum(l) t=(x-y)//2 if t>(10**9+7): print(t%(10**9+7)) else: print(t)
File "/tmp/tmphzajc0kf/tmp7_ek3yar.py", line 4 print(a[0]) ^ IndentationError: expected an indented block after 'if' statement on line 3
s451075963
p02572
u872271866
1598793981
Python
Python (3.8.2)
py
Runtime Error
28
9008
444
#include <bits/stdc++.h> using namespace std; int main(){ int N; long long ans = 0, sum =0; int mod = 1000000000+7; cin >> N; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a.at(i); sum += a.at(i); sum %= mod; } for (int i = 0; i < N; i++) { sum -...
File "/tmp/tmp6bis5_21/tmpui8lb0eq.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s725881041
p02572
u872271866
1598793851
Python
Python (3.8.2)
py
Runtime Error
23
8932
433
#include <bits/stdc++.h> using namespace std; int main(){ int N; long long ans = 0, sum =0; int mod = 1000000000+7; cin >> N; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a.at(i); sum += a.at(i); } for (int i = 0; i < N-1; i++) { sum -= a.at(i); ...
File "/tmp/tmpjwpbkt_k/tmpz9exgvpa.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s634282369
p02572
u914693053
1598793744
Python
Python (3.8.2)
py
Runtime Error
25
8956
114
n=int(input()) a=list(map(int,input().split())) l=list(map(lambda z:z**2,a) x=sum(a) y=sum(l) t=(x-y)//2 print(t)
File "/tmp/tmp8ly23dxf/tmpcii1v6zm.py", line 3 l=list(map(lambda z:z**2,a) ^ SyntaxError: '(' was never closed
s553906763
p02572
u914693053
1598793209
Python
Python (3.8.2)
py
Runtime Error
27
8896
140
n=int(input()) a=list(map(int,input().split())) if n==1: print(a[0]) else: l=list(map(lambda z:z**2,a) x=sum(a) y=sum(l) t=(x-y)//2 print(t)
File "/tmp/tmpnngvwd8c/tmp__c9q6y1.py", line 4 print(a[0]) ^ IndentationError: expected an indented block after 'if' statement on line 3
s520617080
p02572
u321379724
1598792844
Python
Python (3.8.2)
py
Runtime Error
2291
3323992
126
N = int(input()) a = list(map(int,input().split())) s = 0 for i in range(N): s += sum(a[i]*a[i+1:]) print(s%(pow(10,9)+7))
Traceback (most recent call last): File "/tmp/tmp2twzapae/tmpp3l36w3n.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s496934897
p02572
u321379724
1598792774
Python
Python (3.8.2)
py
Runtime Error
2292
3324808
136
N = int(input()) a = list(map(int,input().split())) s = 0 for i in range(N): b = a[i] s += sum(b*a[i+1:]) print(s%(pow(10,9)+7))
Traceback (most recent call last): File "/tmp/tmpef_spsvq/tmp66acd507.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s153218928
p02572
u987846648
1598792061
Python
PyPy3 (7.3.0)
py
Runtime Error
125
105648
223
N = int(input()) A = list(map(int,input().split())) SUMA = 0 MOD = 10**9 + 7 C = [0] * (N-1) for i in range(N): SUMA += A[i] C[i] = SUMA ans = 0 for i in range(N-1): ans += A[i]*C[i] ans %= MOD print(ans)
Traceback (most recent call last): File "/tmp/tmpr8jf6er7/tmpd6wtt_60.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s009235868
p02572
u987846648
1598791089
Python
PyPy3 (7.3.0)
py
Runtime Error
95
74732
224
mod =10**9 +7 n = int(input()) a = list(map(int, input().split())) sumpro = 0 for i in range(n-1): x = 0 for j in range(i+1, n): x += a[j] x = x%mod y = a[i]* x sumpro += y print(sumpro%mod)
File "/tmp/tmpradmtvjb/tmpzjnb_udo.py", line 12 sumpro += y IndentationError: unexpected indent
s929068191
p02572
u784982404
1598784337
Python
Python (3.8.2)
py
Runtime Error
45
25056
154
N = int(input()) A = input().split() Sum = sum(A) ans = 0 for i in range(N): ans += int(A[i])*(Sum-int(A[i])) ans %= 1000000007 print(int(ans/2))
Traceback (most recent call last): File "/tmp/tmp_so1suvs/tmpyppkyki2.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s130819256
p02572
u243312682
1598782189
Python
Python (3.8.2)
py
Runtime Error
157
31416
625
def main(): n = int(input()) A = [int(x) for x in input().split()] mod = 10**9+7 # a_sum = sum(A) a_cum = [0] * (n+1) for i in range(n): a_cum[i + 1] = a_cum[i] + A[i] ans = 0 for i in range(len(A)-1): ans += A[i] * (a_cum[n] - a_cum[i+1]) % mod ans %= mod pri...
Traceback (most recent call last): File "/tmp/tmpezb2e55p/tmpftxzqqer.py", line 16, in <module> main() File "/tmp/tmpezb2e55p/tmpftxzqqer.py", line 2, in main n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s292586284
p02572
u060505280
1598776750
Python
Python (3.8.2)
py
Runtime Error
27
8948
259
mport numpy as np from decimal import Decimal N = int(input()) numbers = np.array(list(map(int, input().split())), dtype=Decimal) square = numbers.sum()**2 numbers_pow = numbers**2 times_sum = (square - numbers_pow.sum()) / 2 print(int(times_sum % (1e9 + 7)))
File "/tmp/tmp_zgclbf8/tmpd181t5i4.py", line 1 mport numpy as np ^^^^^ SyntaxError: invalid syntax
s687697230
p02572
u060505280
1598775337
Python
Python (3.8.2)
py
Runtime Error
2263
3042764
265
import numpy as np N = int(input()) numbers = np.array(list(map(int, input().split()))) ii, jj = np.meshgrid(range(N), range(N)) xx, yy = np.meshgrid(numbers, numbers) times = xx * yy times_sum = np.where(ii < jj, times, 0).sum() print(int(times_sum % (1e+9 + 7)))
Traceback (most recent call last): File "/tmp/tmpn41kf4dm/tmpvvf585sb.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s302851820
p02572
u060505280
1598775252
Python
Python (3.8.2)
py
Runtime Error
2264
2550072
249
import numpy as np N = int(input()) numbers = np.array(list(map(int, input().split()))) ii, jj = np.mgrid[:N, :N] xx, yy = np.meshgrid(numbers, numbers) times = xx * yy times_sum = np.where(ii < jj, times, 0).sum() print(int(times_sum % (1e9 + 7)))
Traceback (most recent call last): File "/tmp/tmpf33c6wg4/tmpsdquxkko.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s481503113
p02572
u060505280
1598775060
Python
Python (3.8.2)
py
Runtime Error
2260
3200524
265
import numpy as np N = int(input()) numbers = np.array(list(map(int, input().split()))) ii, jj = np.meshgrid(range(N), range(N)) xx, yy = np.meshgrid(numbers, numbers) times = xx * yy times_sum = np.where(ii < jj, times, 0).sum() print(int(times_sum % 1000000007))
Traceback (most recent call last): File "/tmp/tmpcltblqok/tmpqc65_8kz.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s537130968
p02572
u060505280
1598774994
Python
Python (3.8.2)
py
Runtime Error
167
49900
266
import numpy as np N = int(input()) numbers = np.array(list(map(int, input().split()))) ii, jj = np.mesehgrid(range(N), range(N)) xx, yy = np.meshgrid(numbers, numbers) times = xx * yy times_sum = np.where(ii < jj, times, 0).sum() print(int(times_sum % 1000000007))
Traceback (most recent call last): File "/tmp/tmpcq95490i/tmpaqzdy82l.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s129705384
p02572
u060505280
1598774602
Python
Python (3.8.2)
py
Runtime Error
2263
2705440
252
import numpy as np N = int(input()) numbers = np.array(list(map(int, input().split()))) ii, jj = np.mgrid[:N, :N] xx, yy = np.meshgrid(numbers, numbers) times = xx * yy times_sum = np.where(ii < jj, times, 0).sum() print(int(times_sum % (1000000007)))
Traceback (most recent call last): File "/tmp/tmp0cvr_3e9/tmp4o4wqnr2.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s389654780
p02572
u060505280
1598774155
Python
Python (3.8.2)
py
Runtime Error
2256
2721936
251
import numpy as np N = int(input()) numbers = np.array(list(map(int, input().split()))) ii, jj = np.mgrid[:N, :N] xx, yy = np.meshgrid(numbers, numbers) times = xx * yy times_sum = np.where(ii < jj, times, 0).sum() print(int(times_sum % (1e+9 + 7)))
Traceback (most recent call last): File "/tmp/tmptr8nbnqw/tmp6ondhhta.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s161543500
p02572
u557792847
1598774087
Python
Python (3.8.2)
py
Runtime Error
22
8904
571
mport sys import numpy as np import math import collections import copy import decimal import itertools from collections import deque from functools import reduce from itertools import product from itertools import combinations # input = sys.stdin.readline N = int(input()) An = list(map(int, input().split())) An_l = ...
File "/tmp/tmpmg1h705w/tmpbgzl5lw0.py", line 1 mport sys ^^^ SyntaxError: invalid syntax
s288531143
p02572
u073139376
1598769015
Python
Python (3.8.2)
py
Runtime Error
2234
1929116
183
import numpy as np m=1000000007 n=int(input()) a=np.array(list(map(int,input().split()))) aa=np.ravel(np.triu(np.outer(a,a),k=1))%m ans=0 for a in aa: ans+=a ans%=m print(ans)
Traceback (most recent call last): File "/tmp/tmp_mzep4f8/tmp73wgz__8.py", line 3, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s105783596
p02572
u073139376
1598768909
Python
Python (3.8.2)
py
Runtime Error
2243
1930016
184
import numpy as np m=1000000007 n=int(input()) a=np.array(list(map(int,input().split()))) aa=np.outer(a,a)[np.triu_indices(n,k=1)]%m ans=0 for a in aa: ans+=a ans%=m print(ans)
Traceback (most recent call last): File "/tmp/tmpb0_yh0nj/tmp1tpjj0m_.py", line 3, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s792439503
p02572
u887959172
1598768154
Python
PyPy3 (7.3.0)
py
Runtime Error
88
74652
486
#include <iostream> #include <vector> using namespace std; const unsigned int M = 1000000007; int N; int main(){ cin >> N; vector<long long> A; for(int i = 0; i < N; i++){ long long x; cin >> x; A.push_back(x); } long long sum = 0; for(int i = 0; i < N; i++){ ...
File "/tmp/tmpo_rcc5jv/tmppaoqnsb5.py", line 3 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s680075858
p02572
u825343780
1598765245
Python
Python (3.8.2)
py
Runtime Error
24
8940
1565
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <iomanip> #include <set> #include <map> #include <numeric> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; i++) #define all(x) x.begin(), x.end() #define mod 1000000007 #include ...
File "/tmp/tmpz2yaot9c/tmpxcny4y25.py", line 11 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s065288954
p02572
u132147074
1598741911
Python
Python (3.8.2)
py
Runtime Error
77
34080
288
num = int(input()) line = input() arr = [int(x) for x in line.split(" ")] post = [] post[num - 1] = arr[num - 1] for i in range(2, num + 1): post[num - i] = post[num-i+1] + arr[num - i] sum = 0 for i in range(num-1): sum += arr[i] * post[i+1] sum %= 1e9 + 7 print(int(sum))
Traceback (most recent call last): File "/tmp/tmp0y_14h7n/tmp7xz1483o.py", line 1, in <module> num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s612205843
p02572
u167993508
1598741712
Python
Python (3.8.2)
py
Runtime Error
104
31388
164
n = int(input()) l = list(map(int,input().split())) ans = 0 for i in range(1,n): l[i] += l[i-1] i = 0 while i<n-1: ans += l[i]*(l[n] - l[i]) i += 1 print(ans)
Traceback (most recent call last): File "/tmp/tmpn0e5qjsz/tmpp4mt1vqb.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s602805145
p02572
u766565683
1598738880
Python
Python (3.8.2)
py
Runtime Error
25
9028
235
n = int(input()) a = list(map(int, input().split())) sigma = sum(a) count = 0 for i in range(len(a)-1): start = a[i] sigma = sigma-a[i] count = count + start * if count >= 10**9+7: count = count % (10**9+7) print(count)
File "/tmp/tmpz30hfyfj/tmpc5ny6hso.py", line 10 count = count + start * ^ SyntaxError: invalid syntax
s249916686
p02572
u671889550
1598737780
Python
PyPy3 (7.3.0)
py
Runtime Error
154
68732
274
import numpy as np n = int(input()) a = np.array(list(map(int, input().split())), dtype = 'object') mod = 10**9 + 7 sq_sum_a = sum(a)**2 sum_sq_a = sum(a**2) sum_cross = (sq_sum_a - sum_sq_a) // 2 ans = sum_cross % mod # xy = ((x + y)**2 - (x**2 + y**2)) // 2 print(ans)
Traceback (most recent call last): File "/tmp/tmpexpsn8k0/tmpuhzqc8h7.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s590425487
p02572
u779293207
1598737062
Python
Python (3.8.2)
py
Runtime Error
73
31564
119
N=int(input()) A=list(map(int,input().split())) A2=0 for i in ragne(len(A)): A2+=A[i]**2 c=(sum(A))**2-A2 print(c//2)
Traceback (most recent call last): File "/tmp/tmpwbzfdy6n/tmp6lwxq9vb.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s509970638
p02572
u290887281
1598736846
Python
Python (3.8.2)
py
Runtime Error
78
31556
177
mod = 10 ** 9 + 7 n = int(input()) a_list = list(map(int, input().split())) result = 0 a_sum = sum(a) for i in a_list: a_sum -= i result += i * a_sum print(result % mod)
Traceback (most recent call last): File "/tmp/tmpyq5gbmy4/tmphu4qjcl2.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s185047347
p02572
u467544200
1598736825
Python
PyPy3 (7.3.0)
py
Runtime Error
551
76736
504
import resource; import random # 再帰回数上弦を100000回に設定 sys.setrecursionlimit(100000) # スタックサイズを無制限に設定 resource.setrlimit(resource.RLIMIT_STACK, (-1, -1)) n = int(input('')) adl = input('') a = list(map(int,adl.split(' '))) number = 0 mod = 7+1000000000 amari = 0 for i in range(n): aa = 0 for e in range(n-i-1)...
Traceback (most recent call last): File "/tmp/tmpni9sw56p/tmpa_sss746.py", line 4, in <module> sys.setrecursionlimit(100000) ^^^ NameError: name 'sys' is not defined
s675948032
p02572
u290887281
1598736546
Python
Python (3.8.2)
py
Runtime Error
80
31388
177
mod = 10 ** 9 + 7 n = int(input()) a_list = list(map(int, input().split())) result = 0 a_sum = sum(a) for i in a_list: a_sum -= i result += i * a_sum print(result % mod)
Traceback (most recent call last): File "/tmp/tmpsxjsuff_/tmphaasc363.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s904744296
p02572
u170913092
1598735326
Python
Python (3.8.2)
py
Runtime Error
70
31836
305
N = int(input()) A = list(map(int,input().split())) mod = 10**9+7 partial_sum = copy.deepcopy(A) sum_now = A[N-1] for j in range(N-2,-1,-1): sum_now = int((sum_now+A[j])%mod) partial_sum[j] = sum_now res = 0 for i in range(N-1): res = (res + (A[i]*partial_sum[i+1])%mod) %mod print(int(res))
Traceback (most recent call last): File "/tmp/tmpo2cwwaa2/tmpkm69ypcs.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s797247882
p02572
u736154449
1598735287
Python
PyPy3 (7.3.0)
py
Runtime Error
131
94204
189
N=int(input()) A=list(map(int,input().split())) S=sum(A) ##print(S) tmp=0 T=0 for i in range(N): T=T+[i+1] ##print(T) ##print(A[i]) tmp=(A[i]*(S-T)+tmp) tmp=tmp%(10**9+7) print(tmp)
Traceback (most recent call last): File "/tmp/tmp5zbih79g/tmp99jvvr1p.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s357409029
p02572
u065099501
1598735264
Python
Python (3.8.2)
py
Runtime Error
74
31576
216
import sys input = sys.stdin.readline n = int(input()) tmp = list(map(int, input().split())) A = [a % M for a in tmp] M = 1000000007 ans = 0 for i in range(1,n): ans += (A[i-1] * ((sum(A[i::])%M)))%M print(ans%M)
Traceback (most recent call last): File "/tmp/tmpdca61gmz/tmp0jk565f1.py", line 3, in <module> n = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s726487358
p02572
u825343780
1598735053
Python
Python (3.8.2)
py
Runtime Error
22
8936
770
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <iomanip> #include <set> #include <map> #include <numeric> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; i++) #define all(x) x.begin(), x.end() #define mod 1000000007 int main(...
File "/tmp/tmphk57wpl2/tmpf8r40if7.py", line 11 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s708530765
p02572
u485319545
1598734749
Python
PyPy3 (7.3.0)
py
Runtime Error
134
94264
192
n=int(input()) a=list(map(int,input().split())) mod=10**9+7 import numpy as np total = sum(a) cum=[] ans=0 for i in range(n): total-=a[i] ans += a[i]*(total)%mod print(ans%mod)
Traceback (most recent call last): File "/tmp/tmpp2zm93ep/tmpz6pnp4qy.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s548371047
p02572
u275030199
1598734561
Python
Python (3.8.2)
py
Runtime Error
2209
126276
190
n = int(input()) a = input().split() print(a) import numpy as np arr = np.zeros((n,n)) for i in range(n): arr[i,:] = [float(s) for s in a] arr = np.triu(arr,k=-1) print(int(np.sum(arr)))
Traceback (most recent call last): File "/tmp/tmpprpcxftq/tmpw83n0m_z.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s275336674
p02572
u768944351
1598734512
Python
PyPy3 (7.3.0)
py
Runtime Error
108
68636
2
hu
Traceback (most recent call last): File "/tmp/tmpzhigt1uh/tmpb4f3htie.py", line 1, in <module> hu NameError: name 'hu' is not defined
s629547737
p02572
u348293370
1598734435
Python
Python (3.8.2)
py
Runtime Error
25
9052
164
from C import ans n = int(input()) n_list = [int(i) for i in input().split()] s = sum(a**2 for a in n_list) ans = sum(n_list) ** 2 - s print((ans//2)%(10**9+7))
Traceback (most recent call last): File "/tmp/tmpgog2zf71/tmpl0r2j8_v.py", line 1, in <module> from C import ans ModuleNotFoundError: No module named 'C'
s650483893
p02572
u155659281
1598734255
Python
Python (3.8.2)
py
Runtime Error
26
8880
200
def solve(): N = int(input()) AA = list(map(int,input().split())) ans = 0 for a in AA: ans += a ans = ans**2 for a in AA: ans -= a**2 ans = ans//2 print(ans%(10**9+7) solve()
File "/tmp/tmphkf87755/tmpdwen0wcb.py", line 12 print(ans%(10**9+7) ^ SyntaxError: '(' was never closed
s648025329
p02572
u329730886
1598734204
Python
Python (3.8.2)
py
Runtime Error
119
26952
194
import numpy as np A = np.asarray(input().split()).astype(np.int) ans = 0 mod = 10**9 + 7 for i in range(N): pA = (A[i] % mod) * (A[i+1:].sum() % mod) ans += pA print(int(ans % mod))
Traceback (most recent call last): File "/tmp/tmp4fgqwzsi/tmpu7l64iqr.py", line 2, in <module> A = np.asarray(input().split()).astype(np.int) ^^^^^^^ EOFError: EOF when reading a line
s682990679
p02572
u375695365
1598734197
Python
PyPy3 (7.3.0)
py
Runtime Error
87
68768
164
n = int(input()) a = list(map(int, input().split())) mod = 10**9+7 ans = 0 aa=sum(a) for i in range(n): aa-=a[i] ans += a[i]*a[j] ans %= mod print(ans)
File "/tmp/tmp2leoe9kz/tmp3gay99cs.py", line 8 ans += a[i]*a[j] IndentationError: unexpected indent
s099007790
p02572
u714732628
1598734196
Python
Python (3.8.2)
py
Runtime Error
22
8880
210
n = int(input()) a = list(map(int, input().split())) s = 0 ans = 0 for i in range(len(a)): s += a[i] for i in range(len(a)-1): s -= a[i] if s<0: s += 1e9+7 ans += s*a[i] ans %= 1e9+7 print(int(ans))
File "/tmp/tmp337wspc2/tmphqhefsv5.py", line 10 s += 1e9+7 TabError: inconsistent use of tabs and spaces in indentation
s979569793
p02572
u329730886
1598734136
Python
Python (3.8.2)
py
Runtime Error
22
9060
175
A = np.asarray(input().split()).astype(np.int) ans = 0 mod = 10**9 + 7 for i in range(N): pA = (A[i] % mod) * (A[i+1:].sum() % mod) ans += pA print(int(ans % mod))
Traceback (most recent call last): File "/tmp/tmphau0cf3x/tmpk9yt4vw8.py", line 1, in <module> A = np.asarray(input().split()).astype(np.int) ^^ NameError: name 'np' is not defined
s753144653
p02572
u514222361
1598734135
Python
Python (3.8.2)
py
Runtime Error
1877
1935388
394
# -*- coding: utf-8 -*- import sys import math import numpy as np import copy n = input() a = [int(p) for p in input().split(' ')] #行列生成 aa = [] ab = [] a1 = np.array(a) a2 = np.tril(np.tile(a1, (len(a), 1)).T) #print(a2) #np.fill_diagonal(a2, 0) a3 = a1.T #print(a1 * a2) sum_n = np.sum(a2 * a3) print(sum_n % (10...
Traceback (most recent call last): File "/tmp/tmpd7r1zvip/tmp60u_rc9v.py", line 8, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s291450164
p02572
u655048024
1598734096
Python
Python (3.8.2)
py
Runtime Error
24
9044
152
n = int(input()) a = list(map(int,input().split())) h = sum(a) ans = 0 for i in range(n): h -= a[i] ans = (ans + (a[i]*(h))%(10**9+7) print(ans)
File "/tmp/tmpkcqwgsh3/tmpexgonwn0.py", line 7 ans = (ans + (a[i]*(h))%(10**9+7) ^ SyntaxError: '(' was never closed
s370357295
p02572
u682894596
1598734030
Python
Python (3.8.2)
py
Runtime Error
131
31344
219
N = int(input()) a = list(map(int, input().split(" "))) s = 0 for i in range(0,N): s += a[i] s = s*s for i in range(0,N): s -= a[i]*a[i] while s >= 2*(10**9 +7): s = int(s % (10**9 +7)) s = s/2 print(int(ss))
Traceback (most recent call last): File "/tmp/tmp9hi99pnt/tmpv90tm6d9.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s554069431
p02572
u766565683
1598733867
Python
Python (3.8.2)
py
Runtime Error
79
31440
307
n = int(input()) a = list(map(int, input().split())) sigma = 0 after = sum(a[0:]) for i in range(len(a)-1): start = a[i] after = after - [i] if after >= (10**9 + 7): after = after % (10**9+7) sigma = sigma + start * after if sigma >= (10**9 + 7): sigma = sigma % (10**9+7) print(sigma)
Traceback (most recent call last): File "/tmp/tmpwkzuwaiv/tmp4xvtayoy.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s950898057
p02572
u514222361
1598733835
Python
Python (3.8.2)
py
Runtime Error
1894
1816764
389
# -*- coding: utf-8 -*- import sys import math import numpy as np import copy n = input() a = [int(p) for p in input().split(' ')] #行列生成 aa = [] ab = [] a1 = np.array(a) a2 = np.tile(a1, (len(a), 1)).T #print(a2) np.fill_diagonal(a2, 0) a3 = a1.T #print(a1 * a2) sum_n = np.sum(a2 * a3) // 2 print(sum_n % (1000000...
Traceback (most recent call last): File "/tmp/tmp9a4bm28w/tmpo0bkq0sg.py", line 8, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s897516067
p02572
u707567014
1598733758
Python
PyPy3 (7.3.0)
py
Runtime Error
101
68724
202
import numpy as np a = int(input()) p = list(map(int,input().split())) mod = 10**9 + 7 sum_list =[p[i]*p[t] for i in range(a) for t in range(a) if i<t ] num = np.sum(sum_list) num = num%mod print(num)
Traceback (most recent call last): File "/tmp/tmpnv9w0w4i/tmpz25o8quo.py", line 3, in <module> a = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s477334869
p02572
u170913092
1598733687
Python
Python (3.8.2)
py
Runtime Error
234
31552
638
n = int(input()) A = [int(x)%(1e9+7) for x in input().split()] # calculating array sum (a1 + a2 ... + an) array_sum = 0 for i in range(0, n, 1): array_sum = (array_sum + A[i])%(1e9+7) # calcualting square of array sum # (a1 + a2 + ... + an)^2 array_sum_square = (array_sum * array_sum)%(1e9+7) # c...
Traceback (most recent call last): File "/tmp/tmp2j7sjt3s/tmpadz0yzpb.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s856722163
p02572
u942388574
1598733626
Python
Python (3.8.2)
py
Runtime Error
24
8884
341
# -*- coding: utf-8 -*- """ Created on Sat Aug 29 22:19:15 2020 @author: naoki """ N = int(input()) A = list(map(int,input().split())) count1 = 0 count2 = 0 count = 10**9 +7 for i in A: count1+=i count1=count1%count for j in A: count2 = j*(count1-j)%count + count2 count1 = count1 -j print(count2%...
File "/tmp/tmpv4xj5e18/tmpxznwmeii.py", line 17 count1=count1%count TabError: inconsistent use of tabs and spaces in indentation
s321921533
p02572
u721652634
1598733616
Python
Python (3.8.2)
py
Runtime Error
43
13256
174
n = int(input()) m = 1e9 + 7 a = [] s = 0 r = 0 for _ in range(n): x = int(input()) a.append(x) s += x r += x * x s *= s ans = (s - r) / 2 ans %= m print(ans)
Traceback (most recent call last): File "/tmp/tmpv388ga49/tmp_z4rdrtc.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s325091422
p02572
u243312682
1598733608
Python
Python (3.8.2)
py
Runtime Error
440
62672
1054
import sys import numpy as np def main(): n = int(input()) A_ = [int(x) for x in input().split()] A = [a for a in A_ if a != 0] N = len(A) # mod = 10**9+7 mod = 200003 PR = 2 order = [1] x = PR while x != 1: order.append(x) x *= PR x %= mod order_l ...
Traceback (most recent call last): File "/tmp/tmpt8xyuly1/tmp4_wm6dfu.py", line 46, in <module> main() File "/tmp/tmpt8xyuly1/tmp4_wm6dfu.py", line 5, in main n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s340736219
p02572
u616791574
1598733600
Python
Python (3.8.2)
py
Runtime Error
31
8940
470
#include<bits/stdc++.h> using namespace std; using ll = long long int; #define MOD (ll) (1e9+7) int main() { ll N; cin >> N; vector<ll> A(N); vector<ll> sum(N); for(size_t i=0;i<N; i++) { cin >> A[i]; } for(ll i=N-2;i>=0;i--) { sum[i] = (sum[i+1] + A[i+1]) % MOD; ...
File "/tmp/tmprx3jcyoh/tmpap9cl8oz.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s864793843
p02572
u005569385
1598733600
Python
Python (3.8.2)
py
Runtime Error
2208
72304
303
N = int(input()) a = list(map(int,input().split())) t = [];s = 0 for i in range(N): for j in range(N): if i != j: if a[i]*a[j]<10**9+7: t.append(a[i]*a[j]) else: t.append(a[i]%7*a%[j]%7) for i in t: s += i s = s//2 print(s%10**9+7)
Traceback (most recent call last): File "/tmp/tmphw74epby/tmpb0cr0ojs.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s751975721
p02572
u243815850
1598733599
Python
Python (3.8.2)
py
Runtime Error
2208
15060
294
S = input() T = input() print(S) print(T) num = [] for i in range(len(T)): _T = T[i:] for j in range(len(T)-i): _T_ = _T if j == 0 else _T[:-j] base = S[i:-j] if j != 0 else S[i:] if _T_ in base: num.append(len(T)-len(_T_)) print(num) print(min(num))
Traceback (most recent call last): File "/tmp/tmpmge78_0q/tmpyrfzkoim.py", line 1, in <module> S = input() ^^^^^^^ EOFError: EOF when reading a line
s600248565
p02572
u787131053
1598733595
Python
PyPy3 (7.3.0)
py
Runtime Error
147
93544
686
#import numpy as np N = int(input()) #A = np.array(list(map(int,input().split(" ")))) % MOD A = list(map(int,input().split(" "))) MOD = 10**9 + 7 ans = 0 #print(A) table = np.outer(A,A) % MOD #print(table) #print(A) for i in range(0,len(A)): raw = 0 for j in range(i+1,len(A)): raw += A[j] raw = ...
Traceback (most recent call last): File "/tmp/tmpket2cpro/tmpqysxozrr.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s914420419
p02572
u060505280
1598733594
Python
Python (3.8.2)
py
Runtime Error
2268
3182180
269
import numpy as np N = int(input()) numbers = np.array(list(map(int, input().split()))) ii, jj = np.meshgrid(range(N), range(N)) xx, yy = np.meshgrid(numbers, numbers) times = xx * yy times_sum = np.where(ii < jj, times, 0).sum() print(int(times_sum) % int(1e+9 + 7))
Traceback (most recent call last): File "/tmp/tmpycn7b6ji/tmptkinpav2.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s437656484
p02572
u687529684
1598733594
Python
Python (3.8.2)
py
Runtime Error
42
13156
185
N=int(input()) A = [] for i in range(N): A.append(int(input())) sum = 0 for i in range(N): for j in range(i+1,N): sum += A[i]*A[j] sum %= 1000*1000*1000+7 print(sum)
Traceback (most recent call last): File "/tmp/tmpfjlgntdh/tmp58idknio.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s699893969
p02572
u324918230
1598733567
Python
PyPy3 (7.3.0)
py
Runtime Error
131
94208
118
N = int(input()) A = list(map(int, input().split())) tmp = sum(A) sum_ += sum(a * (tmp - a) for a in A) print(sum_)
Traceback (most recent call last): File "/tmp/tmp790w34lg/tmpz4uct91q.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s138012234
p02572
u060505280
1598733558
Python
Python (3.8.2)
py
Runtime Error
1842
3524696
269
import numpy as np N = int(input()) numbers = np.array(list(map(int, input().split()))) ii, jj = np.meshgrid(range(N), range(N)) xx, yy = np.meshgrid(numbers, numbers) times = xx * yy times_sum = np.where(ii < jj, times, 0).sum() print(int(times_sum % int(1e+9 + 7)))
Traceback (most recent call last): File "/tmp/tmpqrgd6kbc/tmp861n9dfm.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s164010392
p02572
u053550236
1598733552
Python
Python (3.8.2)
py
Runtime Error
128
31392
312
from sys import stdin n = stdin.readline().rstrip().split()[0] A = [int(x) for x in stdin.readline().rstrip().split()] s = str(int((sum(A)**2 - sum([a**2 for a in A])) / 2)) if(int(s) < (10**9 + 7)): print(int(s)) x = int(s[-9:]) - 7 * int(s[:-9]) if(x < 0): print(x % (10**9 + 7)) else: print(x)
Traceback (most recent call last): File "/tmp/tmpq0el7ke0/tmpab930qo1.py", line 3, in <module> n = stdin.readline().rstrip().split()[0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range
s685824747
p02572
u811629303
1598733551
Python
Python (3.8.2)
py
Runtime Error
2265
1970580
481
# # 177C # import itertools n = input() b = input() n = int(n) list_c = list(range(n)) a = b.split() p_list = list(itertools.permutations(list_c, 2)) #print(p_list[0][0]) new_list = [] i = 0 for i in range(len(p_list)): #print(p_list[i][0]) #print(p_list[i][1]) if p_list[i][0]<p_list[i][1]: ne...
Traceback (most recent call last): File "/tmp/tmpeb5k3s1r/tmpdd8ngjk5.py", line 6, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s024612259
p02572
u868907609
1598733550
Python
Python (3.8.2)
py
Runtime Error
183
49892
497
import numpy as np # import sys # import itertools N = int(input()) A = np.array(list(map(int, input().split()))) A = A % (1E+9+7) C = np.array(list(itertools.combinations(A,2))) # print(C[:,0]) # print(len(C)) answer = np.dot(C[:,0],C[:,1]) # product = 0 # product_sum = 0 # for i in range(len(C)): # product = ...
Traceback (most recent call last): File "/tmp/tmpmh8k0h3p/tmpf7gocs07.py", line 5, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s717311933
p02572
u721652634
1598733540
Python
Python (3.8.2)
py
Runtime Error
37
13148
158
n = int(input()) m = 1e9 + 7 a = [] s = 0 r = 0 for _ in range(n): x = int(input()) s += x r += x * x s *= s ans = (s - r) / 2 ans %= m print(ans)
Traceback (most recent call last): File "/tmp/tmpvhx366ib/tmphe4a21l6.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s384570195
p02572
u463893436
1598733497
Python
PyPy3 (7.3.0)
py
Runtime Error
93
68084
248
import numpy as np n = int(input()) a = list(map(int, input().split())) sum = 0 k = 0 for i in range(len(a)-1): for j in range(i+1,len(a)): k += a[j] sum += a[i] * k k = 0 ans = np.mod(sum,10**9+7) print(ans)
Traceback (most recent call last): File "/tmp/tmpuvqqiiit/tmp8n_1g2oc.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s394251585
p02572
u328179275
1598733493
Python
Python (3.8.2)
py
Runtime Error
807
925284
306
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/tmpbd2nfwse/tmpbfljrpl6.py", line 7, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s274717019
p02572
u393077661
1598733491
Python
Python (3.8.2)
py
Runtime Error
160
31672
239
N = int(input()) A = list(map(int,input().split())) mod = 1000000007 sum = 0 indsum = 0 for i in A: sum += i sum%=mod p = (i*i)%mod indsum+=p indsum%=mod squaresum = (sum*sum)%mod res = (((sumsquare-indsum)%mod)/2)%mod print(res)
Traceback (most recent call last): File "/tmp/tmp2xpro0hx/tmpiuovup2w.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s245663440
p02572
u555767343
1598733478
Python
PyPy3 (7.3.0)
py
Runtime Error
135
94404
301
MOD = 10**9 + 7 n = int(input()) A = list(map(int, input().split())) import numpy A_CS = numpy.cumsum(sorted(A, reverse=True)) A_CS = A_CS%MOD A = sorted(A) #print(A_CS) ans = 0 for i in range(n-1): # print(A[i], A_CS[-i-2]) # A_CS -= A[i] ans = (ans+(A[i]*A_CS[-i-2])%MOD)%MOD print(ans)
Traceback (most recent call last): File "/tmp/tmpvbw6l3ur/tmp7lkzcvlo.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s779978452
p02572
u346785363
1598733477
Python
Python (3.8.2)
py
Runtime Error
2337
3525212
359
import numpy as np def main(): N = int(input("")) in2 = input("") num_list = np.array([int(x) for x in in2.split(" ")]) i_vector = np.transpose(np.reshape(num_list, (1,N))) j_vector = np.triu(num_list, k=1) print(i_vector) print(j_vector) sum = np.sum(i_vector * j_vector) print(sum % (10**9+7)...
Traceback (most recent call last): File "/tmp/tmp7jnr7355/tmpd19dw1v0.py", line 18, in <module> main() File "/tmp/tmp7jnr7355/tmpd19dw1v0.py", line 4, in main N = int(input("")) ^^^^^^^^^ EOFError: EOF when reading a line
s089688038
p02572
u949115942
1598733457
Python
Python (3.8.2)
py
Runtime Error
2245
2297340
338
import numpy as np m = 10**9 + 7 n = int(input()) an = list(map(int, input().split())) an_np = np.array(an) an_col = np.zeros((n-1,n-1)) summary = 0 zero = np.zeros((1,n-1)) for i in range(0, n-1): tmp = np.array(an_np[i+1: n]) an_col[i] = np.append(tmp, zero)[:n-1] print(int(sum(sum(np.multiply(an_np[:-1], a...
Traceback (most recent call last): File "/tmp/tmplwvrhfw0/tmpod_zyrq_.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s231681916
p02572
u939790872
1598733444
Python
Python (3.8.2)
py
Runtime Error
503
31508
227
N = int(input()) A = list(map(int, input().split())) ans = 1 res = 0 for i in range(N): ans *= A[i] ans %= 10 ** 9 + 7 for i in range(N): res += ans * pow(A[i], -1, 10 ** 9 + 7) res %= 10 ** 9 + 7 print(res)
Traceback (most recent call last): File "/tmp/tmpb_mbk66_/tmp_as1sdf1.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s798609114
p02572
u060505280
1598733438
Python
Python (3.8.2)
py
Runtime Error
1768
3527216
265
import numpy as np N = int(input()) numbers = np.array(list(map(int, input().split()))) ii, jj = np.meshgrid(range(N), range(N)) xx, yy = np.meshgrid(numbers, numbers) times = xx * yy times_sum = np.where(ii < jj, times, 0).sum() print(int(times_sum % (1e+9 + 7)))
Traceback (most recent call last): File "/tmp/tmpgkr3aoek/tmpvoyh5_dv.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s918963168
p02572
u212539610
1598733436
Python
Python (3.8.2)
py
Runtime Error
2317
3545812
390
N = int(input()) A = [int(a) for a in input().split()] import numpy as np mod = 10**9 + 7 mesh = np.array(np.meshgrid(A, A), dtype=np.int64) comb = mesh.T.reshape(-1, 2) t_comb = [] for c in comb: if c[0] == c[1]: continue else: t_comb.append(sorted(c)) t_comb = np.unique(t_comb, axis=0) s...
Traceback (most recent call last): File "/tmp/tmp1_cm3e2i/tmpgrd64051.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s281402204
p02572
u671889550
1598733422
Python
Python (3.8.2)
py
Runtime Error
2265
1999576
202
import itertools as it n = int(input()) a = list(map(int, input().split())) c = list(it.combinations(a, 2)) ans = 0 for i in range(n): ans += int(c[i][0]) * int(c[i][1]) print(ans % (10**9 + 7))
Traceback (most recent call last): File "/tmp/tmpkddmfmbd/tmpe1otm16b.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s918667614
p02572
u053550236
1598733420
Python
Python (3.8.2)
py
Runtime Error
136
32036
310
from sys import stdin n = stdin.readline().rstrip().split()[0] A = [int(x) for x in stdin.readline().rstrip().split()] s = str(int((sum(A)**2 - sum([a**2 for a in A])) / 2)) if(int(s) < (10**9 + 7)): print(int(s)) x = int(s[-9:]) - 7 * int(s[:-9]) if(x < 0): print(x + 10**9 + 7) else: print(x)
Traceback (most recent call last): File "/tmp/tmpp4zbs545/tmpsfdm8bww.py", line 3, in <module> n = stdin.readline().rstrip().split()[0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range
s044170438
p02572
u346395915
1598733385
Python
Python (3.8.2)
py
Runtime Error
286
31792
322
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%mod 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/tmpuip979g5/tmp3hi1agha.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s791498827
p02572
u687529684
1598733352
Python
Python (3.8.2)
py
Runtime Error
37
13288
176
N=int(input()) A = [] for i in range(N): A[i] = int(input()) sum = 0 for i in range(N): for j in range(i+1,N): sum += A[i]*A[j] sum %= 1000*1000*1000+7 print(sum)
Traceback (most recent call last): File "/tmp/tmps1ptt7mr/tmpjqplhetu.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s928513450
p02572
u905436707
1598733346
Python
Python (3.8.2)
py
Runtime Error
44
13260
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/tmpr7vozgvq/tmpuuuzsa38.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line