s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s796075668 | p02570 | u087118202 | 1598789550 | Python | PyPy3 (7.3.0) | py | Runtime Error | 84 | 68632 | 78 | d,t,s=map(int,input().split())
if d//s > t:
print('No')
else:
print('Yes' |
s824846215 | p02570 | u344276999 | 1598787498 | Python | Python (3.8.2) | py | Runtime Error | 109 | 26740 | 444 | import numpy as np
N = int(input())
A = np.array([int(i) for i in input().split()])
sum = 0
#累積和、二乗和の両方で1項ずつ求めてmodをとる
for x in A:
sum += x
sum %= (10**9+7)
#sum = A.sum() % (10**9+7)
sum2 = 0
for x in A:
sum2 += x*x
sum2 %= (10**9+7)
#sum2 = (A**2).sum() % (10**9+7)
ans = (sum**2 - sum2) % (10**9+7)
if ans ... |
s556106701 | p02570 | u699522269 | 1598787238 | Python | PyPy3 (7.3.0) | py | Runtime Error | 94 | 74832 | 70 |
D,T,S = map(int, input.split())
print("Yes" if D/(S*T)<=1 else "No") |
s629036509 | p02570 | u918422508 | 1598787234 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8944 | 206 | S=input()
T=input()
ans=[]
count=0
for i1 in range(len(S)-len(T)):
for i2 in range(len(T)):
if S[i1+i2]==T[i2]:
count++
else:
ans=ans.append(count)
count=0
else:
print(ans.max()) |
s928978384 | p02570 | u918422508 | 1598786159 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9128 | 65 | D,T,S=map(int,input())
if D*S>T:
print("No")
else:
print("Yes") |
s855432730 | p02570 | u918422508 | 1598786102 | Python | Python (3.8.2) | py | Runtime Error | 21 | 9160 | 66 | D,T,S=map(int,input())
if D*S>T :
print("No")
else:
print("Yes") |
s601713857 | p02570 | u918422508 | 1598786067 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9104 | 66 | D,T,S=map(int,input())
if D*S>T :
print("No")
else:
print("Yes") |
s724960544 | p02570 | u344030307 | 1598785445 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9072 | 392 | n,m = map(int, input().split())
par = [i-1 for i in range(1, n+1)]
def find (x):
if par[x] == x:
return x
else:
par[x] = find(par[x])
return par[x]
def same(x,y):
return find(x) == find(y)
def unite(x,y):
x = find(x)
y = find(y)
if x == y:
return 0
par[x] = y
for i in range(m):
a,b ... |
s101548783 | p02570 | u760207136 | 1598779700 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9020 | 83 | D = input()
T = input()
S = input()
if(D/S <= T):
print("Yes")
else:
print("No") |
s118731729 | p02570 | u760207136 | 1598779661 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8956 | 79 | D = input()
T = input()
S = input()
if(D/S <= T) print("Yes")
else print("No") |
s724624207 | p02570 | u860966226 | 1598774644 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8976 | 95 | data = input()
n = [int(x) for x in data]
if n[1] * n[2] < n[0]: print("No")
else print("Yes")
|
s055766318 | p02570 | u923464546 | 1598754274 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9012 | 6129 | #include <numeric>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>... |
s820611732 | p02570 | u021814034 | 1598753157 | Python | PyPy3 (7.3.0) | py | Runtime Error | 121 | 81460 | 2602 | import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input=sys.stdin.readline
from random import randint
##import numpy as np
##sys.setrecursionlimit(10**7)
mo=10**9+7
def cin():
return map(int,sin().split())
def ain():
return list(map(in... |
s461980831 | p02570 | u973069173 | 1598753139 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9060 | 77 | d,t,s = input().split()
if d/s <= t:
print("Yes")
else:
print("No") |
s254703111 | p02570 | u973069173 | 1598753014 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9004 | 82 | d,t,s = int(input().split())
if d/s <= t:
print("Yes")
else:
print("No") |
s908774769 | p02570 | u013617325 | 1598751048 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9160 | 818 | #!/usr/bin/env python3
import sys
from itertools import accumulate
MOD = 1000000007 # type: int
def solve(N: int, A: "List[int]"):
aa = list(accumulate(A))
print(aa)
x = sum(A)
print(x)
ans = 0
for i in range(N):
ans += A[i]*(aa[N-1]-aa[i])%MOD
ans %= MOD
return print(an... |
s321954212 | p02570 | u165612156 | 1598750787 | Python | PyPy3 (7.3.0) | py | Runtime Error | 98 | 74468 | 122 | d, t, s = map(int, input().split())
x = d / s
if x < t:
print('Yes')
elif x == y:
print('Yes')
else:
print('No') |
s312708402 | p02570 | u165612156 | 1598750713 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9064 | 123 | d, t, s = map(int, input().split())
x = d // s
if x < t:
print('Yes')
elif x == y:
print('Yes')
else:
print('No') |
s393351818 | p02570 | u991542950 | 1598750091 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74756 | 239 | import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
sum_A = sum(A) % mod
ans = 0
for a in A[:-1]:
sum_A -= a
sum_A %= mod
ans += a * sum_A
ans %= mod
ans %= mod
print(ans) |
s957658067 | p02570 | u991542950 | 1598750036 | Python | PyPy3 (7.3.0) | py | Runtime Error | 89 | 74856 | 239 | import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
sum_A = sum(A) % mod
ans = 0
for a in A[:-1]:
sum_A -= a
sum_A %= mod
ans += a * sum_A
ans %= mod
ans %= mod
print(ans) |
s064561486 | p02570 | u551162413 | 1598747585 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9144 | 350 | s = input()
t = input()
start, end = 0, len(t)
def f(s, t, start, end):
min_changes = len(t)
if start + len(t) == len(s):
count = 0
for i in range(len(t)):
if s[start:end][i] != t[i]: count += 1
return min(count, min_changes)
return min(f(s, t, start+1, end+1), min_change... |
s090179912 | p02570 | u167993508 | 1598745858 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9100 | 375 | def find(e):
if parent[e] == e:
return e
return find(parent[e])
n, m = map(int,input().split())
l = []
parent = [i for i in range(n)]
for _ in range(m):
p, q = map(int,input().split())
p -= 1
q -= 1
x = find(p)
y = find(q)
if parent[x] > parent[y]:
x, y = y, x
parent[y] = x
mx = 0
for i in s... |
s248492412 | p02570 | u479362648 | 1598745019 | Python | Python (3.8.2) | py | Runtime Error | 30 | 8864 | 80 | def yOrN(D,T,S)
time = D//S
if time <= T:
print('Yes')
else:
print('No') |
s807579454 | p02570 | u479362648 | 1598744751 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8924 | 71 | def yOrN(D,T,S)
time = D/S
if time <= T:
print('Yes')
print('No') |
s422326366 | p02570 | u805102038 | 1598743437 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8988 | 193 | AllInput = input("Enter Distance,Time Taken and Speed Separated by Space")
Para = AllInput.split()
if ((float(Para[0])/float(Para[1])) <= float(Para[2]):
print("Yes")
else:
print("NO") |
s902981622 | p02570 | u626891113 | 1598743223 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74824 | 454 | import sys
sys.setrecursionlimit(10**9)
n, m = map(int, input().split())
root = [-1]*n
def find(n):
if root[n] < 0:
return n
else:
root[n] = find(root[n])
return root[n]
def unite(x, y):
x = find(x)
y = find(y)
if x == y:
return
else:
root[x] += root[y]... |
s451818449 | p02570 | u915558071 | 1598741649 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9172 | 92 | d,t,s=map(int,input().split())
time=d/s
if time<=t:
print("Yes")
else:
primmt("No")
|
s637170584 | p02570 | u644139801 | 1598740510 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9164 | 94 | d=int(input())
t=int(input())
s=int(input())
if t*s>=d:
print("YES")
else:
print("NO") |
s018443982 | p02570 | u961223096 | 1598740270 | Python | PyPy3 (7.3.0) | py | Runtime Error | 90 | 68764 | 69 | D,T,S = input().split()
out = 'Yes' if D < T * S else 'No'
print(out) |
s264590332 | p02570 | u260216890 | 1598739488 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 68624 | 959 | import sys
input = sys.stdin.readline
n,m=map(int, input().split())
class UnionFind(object):
def __init__(self, n=1):
self.par = [i for i in range(n)]
self.rank = [0 for _ in range(n)]
def find(self, x):
if self.par[x] == x:
return x
else:
self.par[x] =... |
s481360980 | p02570 | u391382440 | 1598739124 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9176 | 346 | N = int(input())
A = list(map(int,input().split()))
sumA = sum(A)%(1000000007)
sumA2 = (sumA * sumA)%(1000000007)
square = 0
for i in range(N):
square += ( A[i]**2 ) % (1000000007)
square = square % (1000000007)
buf = sumA2 - square
if buf < 0:
buf = buf + (1000000007)
res = ( buf * ((1000000007+1)//2)) % 10... |
s970194587 | p02570 | u752774573 | 1598738943 | Python | PyPy3 (7.3.0) | py | Runtime Error | 207 | 85016 | 985 | INF=10**9+7
D = [INF]*(10**6+1)
L = [True]*(10**6+1)
L[0] = False
L[1] = False
D[1] = 1
for i in range(2, 10**6+1):
if L[i]:
D[i] = i
for j in range(i*2, 10**6+1, i):
L[j] = False
D[j] = min(i, D[j])
def egcd(a, b):
if a == 0:
return b
else:
g = egcd... |
s872234791 | p02570 | u462524298 | 1598738767 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8880 | 86 | d,t,s = map(int,input()split(()))
if t*s >= d:
print("Yes")
else:
print("No") |
s263102733 | p02570 | u766236264 | 1598738549 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9004 | 290 | s = input()
t = input()
minCount = len(t)
i = 0
while i < len(s) and i + len(t) <= len(s):
countSame = 0
j = 0
while j < len(t):
if t[j] == s[i+j]:
countSame += 1
j += 2
minCount = min(len(t) - countSame, minCount)
i += 1
print(minCount)
|
s614289822 | p02570 | u934052933 | 1598737927 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9000 | 366 | # import sys
def main():
# input = sys.stdin.readline
s = input()
t = input()
res = len(t)
# 部分文字列の探索
for i in range(len(s)-len(t)+1):
diff = 0
for j in range(len(t)):
if s[i + j] != t[j]:
diff += 1
res = min(res, diff)
print(res)
if __na... |
s846871575 | p02570 | u934052933 | 1598737889 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9132 | 364 | import sys
def main():
# input = sys.stdin.readline
s = input()
t = input()
res = len(t)
# 部分文字列の探索
for i in range(len(s)-len(t)+1):
diff = 0
for j in range(len(t)):
if s[i + j] != t[j]:
diff += 1
res = min(res, diff)
print(res)
if __name... |
s254123506 | p02570 | u892797057 | 1598737867 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9100 | 352 | S = input()
T = input()
min_count = len(T)
for s in range(len(S) - len(T) + 1): # T cannot exceed the length of S
matched = 0
for i in range(len(T)):
# print(f'S[{s + i}] == T[{i}]')
if S[s + i] == T[i]:
matched += 1
count = len(T) - matched
if count < min_count:
mi... |
s515232334 | p02570 | u467544200 | 1598737210 | Python | PyPy3 (7.3.0) | py | Runtime Error | 111 | 74756 | 335 | n = int(input(''))
adl = input('')
a = list(map(int,adl.split(' ')))
number = 0
mod = 1000000007
amari = 0
for i in range(n):
aa = 0
for e in range(n-i-1):
j = i+e+1
if i != j:
aa = aa + a[j]
number = number + ((a[i] % mod) * aa)
number = number % mod
amari = number % mo... |
s056578800 | p02570 | u969708690 | 1598736742 | Python | PyPy3 (7.3.0) | py | Runtime Error | 87 | 68696 | 2126 | def gcd(a, b):
while b: a, b = b, a % b
return a
def isPrimeMR(n):
d = n - 1
d = d // (d & -d)
L = [2]
for a in L:
t = d
y = pow(a, t, n)
if y == 1: continue
while y != n - 1:
y = (y * y) % n
if y == 1 or t == n - 1: return 0
t ... |
s402471587 | p02570 | u605880635 | 1598736044 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8924 | 238 | N = int(input())
A = list(map(int,input().split()))
k = 1000000007
sm = sum(A)
ans = 0
for s in range(len(A)-1):
#ans += A[s]*sum(A[s+1:])
sm -= A[s]
ans += A[s]*sm
if ans>1000000007:
print(ans%k)
else:
print(ans)
|
s980934996 | p02570 | u995400612 | 1598735927 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8856 | 62 | D,T,S=input()
if(D==(S*T)):
print("Yes")
else:
print("No") |
s191522023 | p02570 | u858795303 | 1598735485 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9020 | 120 | d = float(input())
t = float(input())
s = float(input())
if (s*t)>d or (s*t)==d:
print('yeah')
else:
print('No') |
s972960486 | p02570 | u127288756 | 1598735075 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9032 | 170 | n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
total = sum(a)
cum=[]
ans=0
for i in range(n):
total-=a[i]
ans += a[i]*(total)%mod
print(ans)
|
s122497004 | p02570 | u458412487 | 1598735062 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8984 | 48 | d=T*S
if d>D:
print("Yes")
else:
print("No") |
s117148641 | p02570 | u024584010 | 1598734921 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9184 | 192 | n = int(input())
a = list(map(int,input().split()))
sum = 0
for i in range(n):
sum += a[i]
sum = sum*sum
for j in range(n):
sum = sum - a[j]*a[j]
sum = int(sum/2)
print(sum%1000000007) |
s431390430 | p02570 | u521866787 | 1598734801 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9184 | 1171 | import sys
sys.setrecursionlimit(1000000)
class UnionFind:
def __init__(self, n):
self.par = list(range(n)) #親
self.rank = [0] * n #根の深さ
# xの属する根を求める
def find(self, x):
if self.par[x] == x:
return x
else:
self.par[x] = self.find(self.par[x])
... |
s638806997 | p02570 | u598795006 | 1598734692 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9136 | 713 | # required function
def findProductSum(A, n):
# calculating array sum (a1 + a2 ... + an)
array_sum = 0
for i in range(0, n, 1):
array_sum = array_sum + A[i]
# calcualting square of array sum
# (a1 + a2 + ... + an)^2
array_sum_square = array_sum * array_sum
# calc... |
s869357065 | p02570 | u304058693 | 1598734647 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9044 | 341 | # import numpy as np
# import itertools as it
n = int(input())
a = list(map(int, input().split()))
res = 0
for i in range(n):
res += a[i] * a[i]
ans = sum(a) * sum(a)
print(((ans - res)//2) % (10 ** 9 + 7))
# sum = 0
# for i in range(n):
# sum += 1 / a[i]
#print(sum)
# ans = int(sum * np.prod(a))
# print(... |
s926315040 | p02570 | u329730886 | 1598734175 | Python | Python (3.8.2) | py | Runtime Error | 112 | 26704 | 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)) |
s348596565 | p02570 | u171125031 | 1598734131 | Python | Python (3.8.2) | py | Runtime Error | 21 | 9060 | 97 | d=int(input())
t=int(input())
s=int(input())
sp=d/t
if(s>=sp):
print("Yes")
else:
print("No") |
s475941398 | p02570 | u721652634 | 1598734099 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9152 | 147 | n = int(input())
m = 1e9 + 7
a = list(map(int, input().split()))
s = sum(a)
s *= s
r = sum([x*x for x in a])
ans = (s - r) // 2
ans %= m
print(ans) |
s654688063 | p02570 | u365058393 | 1598734023 | Python | Python (3.8.2) | py | Runtime Error | 21 | 8824 | 83 | a, b, c = int(input().split())
i = a/c
if i <=b:
print("No")
else:
print("Yes") |
s260262477 | p02570 | u171125031 | 1598734013 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9064 | 97 | d=int(input())
t=int(input())
s=int(input())
sp=d/t
if(s>=sp):
print("Yes")
else:
print("No") |
s740996167 | p02570 | u755524167 | 1598733894 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9020 | 166 | D,T,S= [int(x) for x in input("Enter values in the range of 1 and 10000: ").split(",")]
if (D and T) and S <=10000 and D/S<=T:
print("Yes")
else:
print("No") |
s384586002 | p02570 | u171125031 | 1598733880 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9096 | 103 | d=int(input())
t=int(input())
s=int(input())
speed=d/t
if(s>=speed):
print("Yes")
else:
print("No") |
s902019528 | p02570 | u365416597 | 1598733851 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9080 | 243 | S = input()
T = input()
ruijimax = 0
for first in range(len(S)-len(T)):
ruiji = 0
for i in range(len(T)):
if S[first+i] == T[i]:
ruiji += 1
if ruijimax <= ruiji:
ruijimax = ruiji
print(len(T)-ruijimax) |
s362592447 | p02570 | u075304271 | 1598733832 | Python | Python (3.8.2) | py | Runtime Error | 39 | 10460 | 776 | import math
import collections
import fractions
import itertools
import functools
import operator
import bisect
def solve():
n, m = map(int, input().split())
group = []
done = [-1]*n
num = 0
for i in range(m):
a, b = map(lambda x:int(x)-1, input().split())
if done[a] != -1:
... |
s903047981 | p02570 | u075304271 | 1598733779 | Python | Python (3.8.2) | py | Runtime Error | 40 | 10396 | 495 | import math
import collections
import fractions
import itertools
import functools
import operator
import bisect
def solve():
s = input()
t = input()
hoge = 10000
let = len(t)
les = len(s)
ans = 10000
for i in range(les-let+1):
hoge = s[i:i+let]
piyo = 0
for j, k in z... |
s087542379 | p02570 | u310956674 | 1598733597 | Python | PyPy3 (7.3.0) | py | Runtime Error | 89 | 74664 | 199 | s = input()
t = input()
count=10000000000
COUNT=0
for j in range(len(s)-len(t)-1):
for i in range(len(t)):
if not t[i]==s[j]:
COUNT+=1
count=min(count,COUNT)
print(count)
|
s480599935 | p02570 | u168573507 | 1598733597 | Python | Python (3.8.2) | py | Runtime Error | 33 | 9036 | 232 | N= int(input())
list1 =[]
list1 = list(map(int, input().split()))
sum = 0
print(list1)
for i in range(N-1):
for j in range(i+1,N):
sum = sum + list1[i]*list1[j]
answer = divmod(sum, 10**9+7)
print(answer[1])
|
s082690618 | p02570 | u806691350 | 1598733596 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9184 | 263 | import itertools
n = int(input())
alist = list(map(int, input().split()))
result = 0
amari = 0
nmod = 10 ** 9 + 7
for i in itertools.combinations(alist, 2):
amari = ((i[0] % nmod) * (i[1] % nmod)) % nmod
result = (result + amari) % nmod
print(result)
|
s647610064 | p02570 | u024584010 | 1598733593 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9164 | 189 | n = int(input())
a = list(map(int,input().split()))
sum = 0
for i in range(n):
sum += a[i]
sum = sum*sum
for j in range(n):
sum = sum - a[j]*a[j]
sum = sum
print((sum%1000000007)/2) |
s160889486 | p02570 | u218375549 | 1598733593 | Python | PyPy3 (7.3.0) | py | Runtime Error | 96 | 68684 | 370 | N, M = map(int, input().split())
S = []
for i in range(M):
S.append(set(input().split()))
groups = [S[0]]
for j in range(1,len(S)-1):
for k in range(len(groups)):
if S[j] & groups[k] != set():
groups[k] = S[j] | group
else:
groups.append(S[j])
lens = []
for group in gr... |
s576959198 | p02570 | u297089927 | 1598733583 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9216 | 708 | n,m=map(int,input().split())
li=[]
ans=0
if m!=0:
for i in range(m):
a,b=map(int,input().split())
if len(li)==0:
li.append([a,b])
else:
flag=0
for j in range(len(li)):
if a in li[j] and b not in li[j]:
li[j].append(b)
... |
s294089387 | p02570 | u743383679 | 1598733557 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9172 | 838 | n, m = list(map(int, input().split()))
am = []
bm = []
for _ in range(m):
a, b = list(map(int, input().split()))
am.append(a)
bm.append(b)
groups = []
for ai, bi in zip(am, bm):
ag = None
bg = None
for g, group in enumerate(groups):
if ai in group:
ag = g
if bi in gr... |
s468933928 | p02570 | u806691350 | 1598733556 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8944 | 263 | import itertools
n = int(input())
alist = list(map(int, input().split()))
result = 0
amari = 0
nmod = 10 ** 9 + 7
for i in itertools.combinations(alist, 2):
amari = ((i[0] % nmod) * (i[1] % nmod)) % nmod
result = (result + amari) % nmod
print(result)
|
s293595006 | p02570 | u233179527 | 1598733548 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9004 | 66 | d, t, s = input()
if d / t > s:
print("No")
else:
print("Yes") |
s560471334 | p02570 | u024584010 | 1598733543 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9096 | 192 | n = int(input())
a = list(map(int,input().split()))
sum = 0
for i in range(n):
sum += a[i]
sum = sum*sum
for j in range(n):
sum = sum - a[j]*a[j]
sum = int(sum/2)
print(sum%1000000007) |
s980651171 | p02570 | u704157847 | 1598733520 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8972 | 59 | D,T,S = input().split()
print("Yes" if D / S < T else "No") |
s221640907 | p02570 | u659159398 | 1598733439 | Python | PyPy3 (7.3.0) | py | Runtime Error | 90 | 68340 | 487 | def dfs(g, start):
visited[start] = True
cc.append(0)
for nbr in g[start]:
if not visited[nbr]:
dfs(g, nbr)
from collections import defaultdict
n, m = map(int, input().split())
g = defaultdict(set)
for _ in range(m):
a, b = map(int, input().split())
g[a - 1].add(b - 1)
g[... |
s390338746 | p02570 | u884244819 | 1598733433 | Python | PyPy3 (7.3.0) | py | Runtime Error | 149 | 68684 | 303 | from sys import stdin
import itertools
def main():
number = int(input())
num_list = list(map(int, stdin.readline().split()))
comb = list(itertools.combinations(num_list, 2))
total = sum([c1*c2 for c1, c2 in comb])
print(total % (1000000000 + 7))
if __name__ == '__main__':
main() |
s429390508 | p02570 | u659159398 | 1598733338 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 68660 | 525 | def dfs(g, start):
visited[start] = True
cc.append(0)
for nbr in g[start]:
if not visited[nbr]:
dfs(g, nbr)
import sys
from collections import defaultdict
input = sys.stdin.readline
n, m = map(int, input().split())
g = defaultdict(set)
for _ in range(m):
a, b = map(int, input().s... |
s631481582 | p02570 | u450586332 | 1598733239 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9116 | 314 | N = int(input())
A = list(map(int,input().split()))
Sum = 0
mod_n = 10.0E8 +7
for i in range(N-1):
for j in range(i+1,N):
if j == len(A):
break
else:
Sum += A[i]*A[j]
# for i in A:
# Sum -= i**2
# Sum = int(Sum/2)
print(Sum)
print(int(Sum % mod_n)) |
s603802433 | p02570 | u324918230 | 1598733222 | Python | PyPy3 (7.3.0) | py | Runtime Error | 89 | 74804 | 178 | N = int(input())
A = list(map(int, input().split()))
sum_ = 0
for i in range(N):
for j in range(i, N):
sum_ += A[i] * A[j]
sum_ %= 1_000_000_007
print(sum_)
|
s975311322 | p02570 | u364741711 | 1598733206 | Python | PyPy3 (7.3.0) | py | Runtime Error | 91 | 68692 | 169 | n = int(input())
a = list(map(int, input().split()))
sum=0
for i in range(n-1) :
for j in range(n-i-1) :
sum += a[i]*a[j+i+1]
sum = sum%1000000007
print(sum) |
s760438087 | p02570 | u719044784 | 1598733176 | Python | Python (3.8.2) | py | Runtime Error | 32 | 8956 | 136 | d,t,s=list(map(int,input().split()))
if d//s<=t:
print("Yes")
elif d=0 or t=0 or s=0:
print("Yes")
else:
print("No")
|
s249309306 | p02570 | u743878367 | 1598733097 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8996 | 167 | for i in range(len(S)-len(T)+1):
sub_S = S[i:i+len(T)]
cnt = 0
for j in range(len(T)):
if sub_S[j] != T[j]:
cnt += 1
cnt_list.append(cnt)
print(min(cnt_list)) |
s434275527 | p02570 | u715329136 | 1598732985 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 68692 | 291 | def resolve():
N = int(input())
A = list(map(int, input().split()))
x = []
for i in range(1, N):
x.append(sum(A[i:]))
ans = 0
for i in range(N-1):
ans += A[i] * x[i]
ans = ans % (10**9 + 7)
print(ans)
if __name__ == "__main__":
resolve() |
s732201422 | p02570 | u259190728 | 1598732970 | Python | PyPy3 (7.3.0) | py | Runtime Error | 87 | 68864 | 1565 | import sys,bisect
from sys import stdin,stdout
from bisect import bisect_left,bisect_right,bisect,insort,insort_left,insort_right
from math import gcd,ceil,floor,sqrt
from collections import Counter,defaultdict,deque,OrderedDict
dx=[-1,1,0,0]
dy=[0,0,1,-1]
sys.setrecursionlimit(10**6)
INF = float('inf')
MOD = 9... |
s013893849 | p02570 | u467544200 | 1598732800 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 68848 | 94 | dts = input('')
d,t,s = dts.split(' ')
if d <= t * s:
print('YES')
else:
print('NO')
|
s438865333 | p02570 | u158587446 | 1598732747 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9028 | 131 | i = input().split()
d = i[0]
t = i[1]
s = i[2]
dt = i[0] / i[2]
lt = i[1]
if dt <= lt:
print('Yes')
else:
print('No')
|
s181139551 | p02570 | u894694822 | 1598732670 | Python | PyPy3 (7.3.0) | py | Runtime Error | 128 | 68684 | 142 | n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(n-1):
ans+=(l[i]*(sum(l[i+1:len(l)+1]))%(10**9+7))
print(ans%(10**9+7)) |
s162942905 | p02570 | u478417863 | 1598732612 | Python | Python (3.8.2) | py | Runtime Error | 124 | 26488 | 839 | import numpy as np
n=int(input())
a= list(map(int, input().strip().split()))
a.sort()
b=1
for i in range(n):
b*=a[i]
f=0#pairwise coprime
for i in range(n):
if b%(a[i])**2==0:
f=1
break
b=np.gcd(a[0],a[1])
def make_divisors(n):
lower_divisors , upper_divisors = [], []
i = 1
while i*i... |
s672924945 | p02570 | u082587812 | 1598732585 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9116 | 128 | l=[]
for i in range(3):
l.append(int(input()))
d=l[0]
t=l[1]
s=l[2]
time=d/s
if(time<=t):
print("Yes")
else:
print("No")
|
s199688551 | p02570 | u126183307 | 1598732584 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9156 | 77 | i = list(map(int, input().split()))
print("Yes" if i[0]>i[1]*1[2] else "No")
|
s172468519 | p02570 | u858114983 | 1598732479 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9140 | 239 | a = [input().split() for l in range(2)]
count = 0
N = int(a[0][0])
for i in range(N):
for j in range(i):
if i != j:
count = (int(a[1][i])*int(a[1][j])) % 1000000007 + count
count = count % 1000000007
print(count)
|
s925816615 | p02570 | u046247133 | 1598732440 | Python | PyPy3 (7.3.0) | py | Runtime Error | 180 | 68664 | 225 | import itertools
def NextInts(): return map(int,input().split())
saisyo = input()
X = NextInts()
p = itertools.combinations(X, 2)
ANSWER = 0
for i in p:
answer = int(i[0])*int(i[1])
ANSWER+=answer
print(ANSWER%(10**9+7))
|
s842227419 | p02570 | u707567014 | 1598732412 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9124 | 183 | 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 and not i ==t]
num = sum(sum_list)%mod
print(num) |
s542505513 | p02570 | u545509057 | 1598732355 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9160 | 99 | d = int(input())
t = int(input())
s = int(input())
if d/s >= t:
print("Yes")
else:
print("No") |
s901695401 | p02570 | u016753669 | 1598732337 | Python | Python (3.8.2) | py | Runtime Error | 20 | 8884 | 85 | D,T,S = map(int,input().split())
if T*S >= D:
print("Yes")
else:
print("No") |
s769821460 | p02570 | u153047519 | 1598732292 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9064 | 201 | n = int(input())
a = list(map(int, input().split()))
result = 0
d = 0
for i in range(n):
d += a[i] ** 2
result = int(((sum(a) % (10**9 + 7)) ** 2 - d) / 2)
result = result % (10**9 + 7)
print(result) |
s412447717 | p02570 | u016753669 | 1598732140 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8860 | 85 | A,B,C = map(int,input().split())
if B*C >= A:
print("Yes")
else:
print("No") |
s560975981 | p02570 | u013617325 | 1598732057 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9132 | 225 | N = int(input())
A = list(map(int, input().split()))
number = 0
MOD = 1000000007
for i in range(N-1):
for j in range(i+1, N):
number += A[i]*A[j]
if number > MOD:
print(number%MOD)
else:
print(number)
|
s608138353 | p02570 | u508061226 | 1598731962 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9124 | 209 | import itertools
s = input()
t = input()
ans = 0
A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
part = t[i[0]:i[1]]
if part in s:
ans = len(part)
print(len(t) - ans) |
s442419590 | p02570 | u924915048 | 1598731889 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8916 | 104 | D, T, S =input().split(' ')
i = int(D/S)
if i > T:
answer = "No"
else:
answer = "Yes"
print answer
|
s373732531 | p02570 | u590107758 | 1598731785 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8856 | 5068 | import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class Main {
static long mod = (long)1e9 + 7;
static long mod1 = 998244353;
static FastScanner f;
static PrintWriter pw = new PrintWriter(System.out);
static Scanner S = new Scanner(System.in);
static long x0; static long ... |
s992133189 | p02570 | u762523240 | 1598731781 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9068 | 168 | N = int(input())
A = list(map(int, input().split()))
result = 0
i = 0
for x in A[:N]:
for y in A[i+1:]:
result += x * y
i += 1
print(result.__mod__(10**9 + 7)) |
s910321578 | p02570 | u590107758 | 1598731738 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8892 | 5050 | import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class cf1 {
static long mod = (long)1e9 + 7;
static long mod1 = 998244353;
static FastScanner f;
static PrintWriter pw = new PrintWriter(System.out);
static Scanner S = new Scanner(System.in);
static long x0; static long y... |
s278408073 | p02570 | u879866069 | 1598731686 | Python | PyPy3 (7.3.0) | py | Runtime Error | 99 | 68752 | 190 | N = int(input())
n = 10 ** 9 + 7
A_n = [int(i) % n for i in input().split()]
A_n_mod = 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) |
s595573294 | p02570 | u185851743 | 1598731673 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8996 | 211 | S = input()
T = input()
min = len(T)
for t in range(len(S) - len(T)+1):
tmp = 0
for i in range(len(T)):
if S[i+t] != T[i]:
tmp+=1
if tmp < min:
min = tmp
print(min) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.