Datasets:

problem_id
stringlengths
6
6
buggy_code
stringlengths
8
526k
fixed_code
stringlengths
12
526k
labels
listlengths
0
15
โŒ€
buggy_submission_id
int64
1
1.54M
fixed_submission_id
int64
2
1.54M
user_id
stringlengths
10
10
language
stringclasses
8 values
p02804
n, k = map(int,input().split()) a = sorted(list(map(int,input().split()))) def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 N = 10**4 g1 = [1, 1] g2 = [1, 1] inverse = [0, 1] for i in range( 2, N + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) ans = 0 for i in range(N-K+1): ans += (a[n-1-i]-a[i])*cmb(n-1-i,k-1,mod) ans %= mod print(ans)
n, k = map(int,input().split()) a = sorted(list(map(int,input().split()))) def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 N = 10**5 g1 = [1, 1] g2 = [1, 1] inverse = [0, 1] for i in range( 2, N + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) ans = 0 for i in range(n-k+1): ans += (a[n-1-i]-a[i])*cmb(n-1-i,k-1,mod) ans %= mod print(ans)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change", "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
608,606
608,605
u912599273
python
p02804
n,k=map(int,input().split()) a=list(map(int,input().split())) a.sort() mod=10**9+7 ans=0 fac=[1] for i in range(n): p=fac[-1]*(i+1)%mod fac.append(p) def comb(a,b): if a-b<0: return 0 else: r=pow(fac[b]*fac[a-b]%mod,mod-2,mod) return r*fac[a]%mod for i in range(n): ans-=comb(n-i-1,k-1)*a[i] ans+=comb(i,k-1)*a[i] print(ans)
n,k=map(int,input().split()) a=list(map(int,input().split())) a.sort() mod=10**9+7 ans=0 fac=[1] for i in range(n): p=fac[-1]*(i+1)%mod fac.append(p) def comb(a,b): if a-b<0: return 0 else: r=pow(fac[b]*fac[a-b]%mod,mod-2,mod) return r*fac[a]%mod for i in range(n): ans-=comb(n-i-1,k-1)*a[i] ans+=comb(i,k-1)*a[i] ans%=mod print(ans)
[]
608,617
608,618
u296150111
python
p02804
N, K = map(int, input().split()) A = list(map(int, input().split())) MOD = 10 ** 9 + 7 inv_t = [0, 1] + [0] * (N - 2) for i in range(2, N): inv_t[i] = inv_t[MOD % i] * (MOD - MOD // i) % MOD A.sort() ans = 0 C = 1 for i in range(K, N + 1): ans += (A[i - 1] - A[N - i]) * C ans %= MOD C = C * i * inv_t[i - K + 1] C %= MOD print(ans)
N, K = map(int, input().split()) A = list(map(int, input().split())) MOD = 10 ** 9 + 7 inv_t = [0, 1] + [0] * (N - 1) for i in range(2, N + 1): inv_t[i] = inv_t[MOD % i] * (MOD - MOD // i) % MOD A.sort() ans = 0 C = 1 for i in range(K, N + 1): ans += (A[i - 1] - A[N - i]) * C ans %= MOD C = C * i * inv_t[i - K + 1] C %= MOD print(ans)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
608,711
608,712
u374531474
python
p02804
import math N, K = map(int, input().split()) A = [int(a) for a in input().split()] A.sort() def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 #ๅ‡บๅŠ›ใฎๅˆถ้™ Ne = 10**5 g1 = [1, 1] # ๅ…ƒใƒ†ใƒผใƒ–ใƒซ g2 = [1, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ inverse = [0, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ่จˆ็ฎ—็”จใƒ†ใƒผใƒ–ใƒซ for i in range( 2, Ne + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) maxi = 0 for i in range(K-1,N): maxi += A[i]*cmb(i, K-1, mod) mini = 0 A.sort(reverse=True) for j in range(K-1,N): mini += A[j]*cmb(j, K-1, mod) print(maxi-mini)
import math N, K = map(int, input().split()) A = [int(a) for a in input().split()] A.sort() def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 #ๅ‡บๅŠ›ใฎๅˆถ้™ Ne = 10**5 g1 = [1, 1] # ๅ…ƒใƒ†ใƒผใƒ–ใƒซ g2 = [1, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ inverse = [0, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ่จˆ็ฎ—็”จใƒ†ใƒผใƒ–ใƒซ for i in range( 2, Ne + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) maxi = 0 for i in range(K-1,N): maxi += A[i]*cmb(i, K-1, mod) mini = 0 A.sort(reverse=True) for j in range(K-1,N): mini += A[j]*cmb(j, K-1, mod) print((maxi-mini)%mod)
[ "call.arguments.change", "call.arguments.add" ]
608,737
608,738
u062189367
python
p02804
import math N, K = map(int, input().split()) A = [int(a) for a in input().split()] A.sort() def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 #ๅ‡บๅŠ›ใฎๅˆถ้™ Ne = 10**4 g1 = [1, 1] # ๅ…ƒใƒ†ใƒผใƒ–ใƒซ g2 = [1, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ inverse = [0, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ่จˆ็ฎ—็”จใƒ†ใƒผใƒ–ใƒซ for i in range( 2, Ne + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) maxi = 0 for i in range(K-1,N): maxi += A[i]*cmb(i, K-1, mod) mini = 0 A.sort(reverse=True) for j in range(K-1,N): mini += A[j]*cmb(j,K-1,mod) print(maxi-mini)
import math N, K = map(int, input().split()) A = [int(a) for a in input().split()] A.sort() def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 #ๅ‡บๅŠ›ใฎๅˆถ้™ Ne = 10**5 g1 = [1, 1] # ๅ…ƒใƒ†ใƒผใƒ–ใƒซ g2 = [1, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ inverse = [0, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ่จˆ็ฎ—็”จใƒ†ใƒผใƒ–ใƒซ for i in range( 2, Ne + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) maxi = 0 for i in range(K-1,N): maxi += A[i]*cmb(i, K-1, mod) mini = 0 A.sort(reverse=True) for j in range(K-1,N): mini += A[j]*cmb(j, K-1, mod) print((maxi-mini)%mod)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change", "call.arguments.change", "call.arguments.add" ]
608,739
608,738
u062189367
python
p02804
def main(): N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() r = 0 for i in range(K+1): r += (A[N-i-1] - A[i]) * cmb(N-i-1, K-1, mod) print(r % mod) def cmb(n, r, mod): if r < 0 or r > n: return 0 r = min(r, n - r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 g1 = [1, 1] g2 = [1, 1] inverse = [0, 1] for i in range(2, 10 ** 6 + 1): g1.append((g1[-1] * i) % mod) inverse.append((-inverse[mod % i] * (mod // i)) % mod) g2.append((g2[-1] * inverse[-1]) % mod) main()
def main(): N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() r = 0 for i in range(N-K+1): r += (A[N-i-1] - A[i]) * cmb(N-i-1, K-1, mod) print(r % mod) def cmb(n, r, mod): if r < 0 or r > n: return 0 r = min(r, n - r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 g1 = [1, 1] g2 = [1, 1] inverse = [0, 1] for i in range(2, 10 ** 6 + 1): g1.append((g1[-1] * i) % mod) inverse.append((-inverse[mod % i] * (mod // i)) % mod) g2.append((g2[-1] * inverse[-1]) % mod) main()
[ "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.add" ]
608,758
608,759
u316464887
python
p02804
def main(): N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() r = 0 if N - K > K: for i in range(K+1): r += (A[N-i-1] - A[i]) * cmb(N-i-1, K-1, mod) else: for i in range(N-K+1): r += (A[N-i-1] - A[i]) * cmb(N-i-1, K-1, mod) print(r % mod) def cmb(n, r, mod): if r < 0 or r > n: return 0 r = min(r, n - r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 g1 = [1, 1] g2 = [1, 1] inverse = [0, 1] for i in range(2, 10 ** 6 + 1): g1.append((g1[-1] * i) % mod) inverse.append((-inverse[mod % i] * (mod // i)) % mod) g2.append((g2[-1] * inverse[-1]) % mod) main()
def main(): N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() r = 0 if False: for i in range(K+1): r += (A[-i-1] - A[i]) * cmb(N-i-1, K-1, mod) else: for i in range(N-K+1): r += (A[N-i-1] - A[i]) * cmb(N-i-1, K-1, mod) print(r % mod) def cmb(n, r, mod): if r < 0 or r > n: return 0 r = min(r, n - r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 g1 = [1, 1] g2 = [1, 1] inverse = [0, 1] for i in range(2, 10 ** 6 + 1): g1.append((g1[-1] * i) % mod) inverse.append((-inverse[mod % i] * (mod // i)) % mod) g2.append((g2[-1] * inverse[-1]) % mod) main()
[ "control_flow.branch.if.condition.change" ]
608,760
608,761
u316464887
python
p02804
def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 #ๅ‡บๅŠ›ใฎๅˆถ้™ N_ = 10**5+1 g1 = [1, 1] # ๅ…ƒใƒ†ใƒผใƒ–ใƒซ g2 = [1, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ inverse = [0, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ่จˆ็ฎ—็”จใƒ†ใƒผใƒ–ใƒซ for i in range( 2, N_ + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) N, K=list(map(int, input().split())) A = list(map(int, input().split())) A.sort() # min min_ = 0 for n in range(N-K+1): min_ += A[n]*cmb(N-1-n, K-1, mod) # max max_ = 0 for n in reversed( range(K-1, N) ): max_ += A[n]*cmb(n, K-1, mod) #mod = 10**9+7 print( (max_-min_) )
def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 #ๅ‡บๅŠ›ใฎๅˆถ้™ N_ = 10**5+1 g1 = [1, 1] # ๅ…ƒใƒ†ใƒผใƒ–ใƒซ g2 = [1, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ inverse = [0, 1] #้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ่จˆ็ฎ—็”จใƒ†ใƒผใƒ–ใƒซ for i in range( 2, N_ + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) N, K=list(map(int, input().split())) A = list(map(int, input().split())) A.sort() # min min_ = 0 for n in range(N-K+1): min_ += A[n]*cmb(N-1-n, K-1, mod) # max max_ = 0 for n in reversed( range(K-1, N) ): max_ += A[n]*cmb(n, K-1, mod) #mod = 10**9+7 print( (max_-min_)%mod )
[ "expression.operation.binary.add" ]
608,766
608,767
u488636998
python
p02804
def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 N = 10**4 g1 = [1, 1] g2 = [1, 1] inverse = [0, 1] for i in range( 2, N + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) n, k = map(int, input().split()) a = list( map(int, input().split())) ans = 0 a.sort() print(a) for j in range(n): i = j +1 if j <= n-k: minX = a[i-1] ans -= a[i-1]*cmb(n-i,k-1,mod)%mod if k -1 <= i: maxX = a[i-1] ans += a[i-1]*cmb(i-1,k-1,mod)%mod print(ans%mod)
def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod mod = 10**9+7 N = 10**5 g1 = [1, 1] g2 = [1, 1] inverse = [0, 1] for i in range( 2, N + 1 ): g1.append( ( g1[-1] * i ) % mod ) inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod ) g2.append( (g2[-1] * inverse[-1]) % mod ) n, k = map(int, input().split()) a = list( map(int, input().split())) ans = 0 a.sort() for j in range(n): i = j +1 if j <= n-k: minX = a[i-1] ans -= a[i-1]*cmb(n-i,k-1,mod)%mod if k -1 <= i: maxX = a[i-1] ans += a[i-1]*cmb(i-1,k-1,mod)%mod print(ans%mod)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change", "call.remove" ]
608,772
608,773
u952467214
python
p02804
n,k=map(int,input().split()) mod=10**9+7 f=[1] for i in range(n): f+=[f[-1]*(i+1)%mod] print(f) def combination(a,b): return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod a=list(map(int,input().split())) a.sort() b=a[::-1] ans=0 for i in range(k-1,n): ans+=((a[i]-b[i])*(combination(i,k-1)))%(10**9+7) print(ans%(10**9+7))
n,k=map(int,input().split()) mod=10**9+7 f=[1] for i in range(n): f+=[f[-1]*(i+1)%mod] def combination(a,b): return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod a=list(map(int,input().split())) a.sort() b=a[::-1] ans=0 for i in range(k-1,n): ans+=((a[i]-b[i])*(combination(i,k-1)))%(10**9+7) print(ans%(10**9+7))
[ "call.remove" ]
608,791
608,792
u471684875
python
p02804
n,k=map(int,input().split()) mod=10**9+7 f=[1] for i in range(n): f+=[f[-1]*(i+1)%mod] print(f) def combination(a,b): return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod a=list(map(int,input().split())) a.sort() b=a[::-1] ans=0 for i in range(k-1,n): ans+=((a[i]-b[i])*(comb(i,k-1)))%(10**9+7) print(ans%(10**9+7))
n,k=map(int,input().split()) mod=10**9+7 f=[1] for i in range(n): f+=[f[-1]*(i+1)%mod] def combination(a,b): return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod a=list(map(int,input().split())) a.sort() b=a[::-1] ans=0 for i in range(k-1,n): ans+=((a[i]-b[i])*(combination(i,k-1)))%(10**9+7) print(ans%(10**9+7))
[ "call.remove", "identifier.change", "call.function.change", "expression.operation.binary.change" ]
608,793
608,792
u471684875
python
p02804
import sys import copy import bisect import numpy as np from scipy.special import comb N,K = map(int,input().split()) a = list(map(int,input().split())) a = sorted(a) res = 0 fact = [0]*(N+1) ifact = [0]*(N+1) inv = [0]*(N+1) p=10**9+7 def combination(n,fact,ifact): fact[0] = 1 fact[1] = 1 ifact[0] = 1 ifact[1] = 1 inv[1] = 1 for i in range(2,n+1): fact[i] = (fact[i-1]*i)%p inv[i] = p - inv[p%i]*(p//i)%p ifact[i] = (ifact[i-1]*inv[i])%p def op(n,k,fact,ifact): if k<0 or k>n or n<0: return 0 return int(fact[n]*ifact[k]*ifact[n-k])%(10**9+7) combination(N,fact,ifact) for i in range(N): res += (a[i]*op(i,K-1,fact,ifact))%p #a = list(-np.array(a)) a = [-elem for elem in a] a = sorted(a) for i in range(N): res += (a[i]*op(i,K-1,fact,ifact))%p print(res%p)
import sys import copy import bisect import numpy as np N,K = map(int,input().split()) a = list(map(int,input().split())) a = sorted(a) res = 0 fact = [0]*(N+1) ifact = [0]*(N+1) inv = [0]*(N+1) p=10**9+7 def combination(n,fact,ifact): fact[0] = 1 fact[1] = 1 ifact[0] = 1 ifact[1] = 1 inv[1] = 1 for i in range(2,n+1): fact[i] = (fact[i-1]*i)%p inv[i] = p - inv[p%i]*(p//i)%p ifact[i] = (ifact[i-1]*inv[i])%p def op(n,k,fact,ifact): if k<0 or k>n or n<0: return 0 return int(fact[n]*ifact[k]*ifact[n-k])%(10**9+7) combination(N,fact,ifact) for i in range(N): res += (a[i]*op(i,K-1,fact,ifact))%p #a = list(-np.array(a)) a = [-elem for elem in a] a = sorted(a) for i in range(N): res += (a[i]*op(i,K-1,fact,ifact))%p print(res%p)
[]
609,088
609,089
u871980676
python
p02804
n, k = map(int, input().split()) A = list(map(int, input().split())) A = sorted(A) MOD = 10 ** 9 + 7 def pow(a, n): if n == 0: return 1 else: temp = pow(a, n // 2) if n % 2 == 0: return temp * temp % MOD else: return temp * temp * a % MOD ans = 0 combinations = list() for j, i in enumerate(range(k - 1, n)): if i == (k - 1): combinations.append(1) else: combinations.append(combinations[-1] * i // pow(i - k + 1, MOD - 2)) combinations[-1] = combinations[-1] % MOD # print(i, 'C', k - 1, '=', combinations[-1]) # print(combinations) # print(A) combinations = combinations[::-1] for j, i in enumerate(range(k - 1, n)): ans += (A[-j - 1] * combinations[j] % MOD) for j, i in enumerate(range(k - 1, n)): ans -= (A[j] * combinations[j] % MOD) if ans < 0: ans = ans + (- ans // MOD + 1) * MOD ans %= MOD print(ans)
n, k = map(int, input().split()) A = list(map(int, input().split())) A = sorted(A) MOD = 10 ** 9 + 7 def pow(a, n): if n == 0: return 1 else: temp = pow(a, n // 2) if n % 2 == 0: return temp * temp % MOD else: return temp * temp * a % MOD ans = 0 combinations = list() for j, i in enumerate(range(k - 1, n)): if i == (k - 1): combinations.append(1) else: combinations.append(combinations[-1] * i * pow(i - k + 1, MOD - 2)) combinations[-1] = combinations[-1] % MOD # print(i, 'C', k - 1, '=', combinations[-1]) # print(combinations) # print(A) combinations = combinations[::-1] for j, i in enumerate(range(k - 1, n)): ans += (A[-j - 1] * combinations[j] % MOD) for j, i in enumerate(range(k - 1, n)): ans -= (A[j] * combinations[j] % MOD) if ans < 0: ans = ans + (- ans // MOD + 1) * MOD ans %= MOD print(ans)
[ "expression.operator.arithmetic.change", "call.arguments.change", "expression.operation.binary.change" ]
609,150
609,151
u593761424
python
p02804
n, K = map(int, input().split()) A = list(map(int, input().split())) def Com_kai(n, r, mod): if (r < 0 or r > n or n < 0): return 0 r = min(r, n - r) return g1[n] * g2[r] * g2[n - r] % mod mod = 10 ** 9 + 7 # ๅ‡บๅŠ›ใฎๅˆถ้™ N = 10 ** 6 g1 = [1, 1] # ๅ…ƒใƒ†ใƒผใƒ–ใƒซ g2 = [1, 1] # ้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ inverse = [0, 1] # ้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ่จˆ็ฎ—็”จใƒ†ใƒผใƒ–ใƒซ for i in range(2, N + 1): g1.append((g1[-1] * i) % mod) inverse.append((-inverse[mod % i] * (mod // i)) % mod) g2.append((g2[-1] * inverse[-1]) % mod) A.sort() Max_Sum = 0 Min_Sum = 0 Mod = 1000000007 for i in range(n): print(i) Min_Sum = (Min_Sum + (A[i] * Com_kai(n - (i + 1), K - 1, Mod)) % Mod) % Mod Max_Sum = (Max_Sum + (A[i] * Com_kai(i, K - 1, Mod)) % Mod) % Mod print((Max_Sum - Min_Sum + Mod) % Mod)
n, K = map(int, input().split()) A = list(map(int, input().split())) def Com_kai(n, r, mod): if (r < 0 or r > n or n < 0): return 0 r = min(r, n - r) return g1[n] * g2[r] * g2[n - r] % mod mod = 10 ** 9 + 7 # ๅ‡บๅŠ›ใฎๅˆถ้™ N = 10 ** 6 g1 = [1, 1] # ๅ…ƒใƒ†ใƒผใƒ–ใƒซ g2 = [1, 1] # ้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ inverse = [0, 1] # ้€†ๅ…ƒใƒ†ใƒผใƒ–ใƒซ่จˆ็ฎ—็”จใƒ†ใƒผใƒ–ใƒซ for i in range(2, N + 1): g1.append((g1[-1] * i) % mod) inverse.append((-inverse[mod % i] * (mod // i)) % mod) g2.append((g2[-1] * inverse[-1]) % mod) A.sort() Max_Sum = 0 Min_Sum = 0 Mod = 1000000007 for i in range(n): Min_Sum = (Min_Sum + (A[i] * Com_kai(n - (i + 1), K - 1, Mod)) % Mod) % Mod Max_Sum = (Max_Sum + (A[i] * Com_kai(i, K - 1, Mod)) % Mod) % Mod print((Max_Sum - Min_Sum + Mod) % Mod)
[ "call.remove" ]
609,175
609,176
u698902360
python
p02804
N, K = map(int, input().split()) A = sorted(list(map(int, input().split())), reverse=True) MOD = 10 ** 9 + 7 # pypyใง้€šใ™ def prepare(n, MOD): # 1! - n! ใฎ่จˆ็ฎ— f = 1 factorials = [1] # 0!ใฎๅˆ† for m in range(1, n + 1): f *= m f %= MOD factorials.append(f) # n!^-1 ใฎ่จˆ็ฎ— inv = pow(f, MOD - 2, MOD) # n!^-1 - 1!^-1 ใฎ่จˆ็ฎ— invs = [1] * (n + 1) invs[n] = inv for m in range(n, 1, -1): inv *= m inv %= MOD invs[m - 1] = inv return factorials, invs def comb(n ,k, mod, fac, finv): ''' ไบŒ้ …ไฟ‚ๆ•ฐใฎ่จˆ็ฎ— Parameters n : int ๅ…ƒ้›†ๅˆ k : int ๅ…ƒ้›†ๅˆใ‹ใ‚‰้ธๆŠžใ™ใ‚‹ๆ•ฐ mod : int ใ‚ใพใ‚Š fac : list ้šŽไน—ใฎใƒชใ‚นใƒˆ finv : list ้€†ๅ…ƒใฎใƒชใ‚นใƒˆ Returns c : int nCkใฎ็ต„ใฟๅˆใ‚ใ›ใฎๆ•ฐ ''' if n < k: return 0 if n < 0 or k < 0: return 0 return fac[n] * (finv[k] * finv[n-k] % mod) % mod fac, rfac = prepare(N, MOD) #print(count) # ๆœ€ๅคงๅ€คใฎๆ•ฐใˆไธŠใ’ maxnum = 0 minnum = 0 for i in range(N-K+1): counter = comb(N-i-1, K-1, MOD, fac, rfac) maxnum = counter * A[i] % MOD minnum = counter * A[len(A) - 1 - i] % MOD print((maxnum - minnum) % MOD)
N, K = map(int, input().split()) A = sorted(list(map(int, input().split())), reverse=True) MOD = 10 ** 9 + 7 # pypyใง้€šใ™ def prepare(n, MOD): # 1! - n! ใฎ่จˆ็ฎ— f = 1 factorials = [1] # 0!ใฎๅˆ† for m in range(1, n + 1): f *= m f %= MOD factorials.append(f) # n!^-1 ใฎ่จˆ็ฎ— inv = pow(f, MOD - 2, MOD) # n!^-1 - 1!^-1 ใฎ่จˆ็ฎ— invs = [1] * (n + 1) invs[n] = inv for m in range(n, 1, -1): inv *= m inv %= MOD invs[m - 1] = inv return factorials, invs def comb(n ,k, mod, fac, finv): ''' ไบŒ้ …ไฟ‚ๆ•ฐใฎ่จˆ็ฎ— Parameters n : int ๅ…ƒ้›†ๅˆ k : int ๅ…ƒ้›†ๅˆใ‹ใ‚‰้ธๆŠžใ™ใ‚‹ๆ•ฐ mod : int ใ‚ใพใ‚Š fac : list ้šŽไน—ใฎใƒชใ‚นใƒˆ finv : list ้€†ๅ…ƒใฎใƒชใ‚นใƒˆ Returns c : int nCkใฎ็ต„ใฟๅˆใ‚ใ›ใฎๆ•ฐ ''' if n < k: return 0 if n < 0 or k < 0: return 0 return fac[n] * (finv[k] * finv[n-k] % mod) % mod fac, rfac = prepare(N, MOD) #print(count) # ๆœ€ๅคงๅ€คใฎๆ•ฐใˆไธŠใ’ maxnum = 0 minnum = 0 for i in range(N-K+1): counter = comb(N-i-1, K-1, MOD, fac, rfac) maxnum += counter * A[i] % MOD minnum += counter * A[len(A) - 1 - i] % MOD print((maxnum - minnum) % MOD)
[ "assignment.value.change" ]
609,181
609,182
u814781830
python
p02804
MOD = 1000000007 MAX = 200000 # max n fac = [0 for _ in range(MAX)] # = n! (mod MOD) finv = [0 for _ in range(MAX)] # = 1/r! (mod MOD) inv = [0 for _ in range(MAX)] # = 1/r (mod MOD) # init def COMinit(): fac[0] = fac[1] = 1 finv[0] = finv[1] = 1 inv[1] = 1 for i in range(2, MAX): fac[i] = fac[i - 1] * i % MOD inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD finv[i] = finv[i - 1] * inv[i] % MOD # nCk, n < [0, MAX), k < [0, n] def COM(n, k): if n < k: return 0 if n < 0 or k < 0: return 0 return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD n, k = map(int, input().split()) A = [int(a) for a in input().split()] A.sort() ans = 0 for i in range(n): if n-(i+1) < k-1: break ans += ((A[n-i-1]-A[i])*COM(n-i-1, k-1)) % MOD ans %= MOD print(ans)
MOD = 1000000007 MAX = 200000 # max n fac = [0 for _ in range(MAX)] # = n! (mod MOD) finv = [0 for _ in range(MAX)] # = 1/r! (mod MOD) inv = [0 for _ in range(MAX)] # = 1/r (mod MOD) # init def COMinit(): fac[0] = fac[1] = 1 finv[0] = finv[1] = 1 inv[1] = 1 for i in range(2, MAX): fac[i] = fac[i - 1] * i % MOD inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD finv[i] = finv[i - 1] * inv[i] % MOD # nCk, n < [0, MAX), k < [0, n] def COM(n, k): if n < k: return 0 if n < 0 or k < 0: return 0 return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD COMinit() n, k = map(int, input().split()) A = [int(a) for a in input().split()] A.sort() ans = 0 for i in range(n): if n - (i + 1) < k - 1: break ans += ((A[n - i - 1] - A[i]) * COM(n - i - 1, k - 1)) % MOD ans %= MOD print(ans)
[ "call.add" ]
609,183
609,184
u747184036
python
p02805
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # 2็‚นใฎ็›ดๅพ„ใพใŸใฏ3็‚นใฎๅค–ๅฟƒใ‚’ใƒ†ใ‚นใƒˆ import itertools import numpy as np N = int(readline()) m = map(int,read().split()) Z = [x + y * 1j for x,y in zip(m,m)] def find_O(z0,z1,z2): z1 -= z0; z2 -= z0 if abs((z1 * z2.conjugate()).imag) < 0.5: # ๅŒไธ€็›ด็ทšไธŠ return None num = z1 * z2 * (z1-z2).conjugate() den = z1.conjugate() * z2 den -= den.conjugate() return num / den A = [] for comb in itertools.combinations(Z,3): O = find_O(*comb) if O is None: continue A.append(O) for z1,z2 in itertools.combinations(Z,2): O = (z1 + z2) / 2 A.append(O) Z = np.array(Z); A = np.array(A) answer = np.abs((Z[:,None] - A[None,:])).max(axis = 0).min() print(answer)
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # 2็‚นใฎ็›ดๅพ„ใพใŸใฏ3็‚นใฎๅค–ๅฟƒใ‚’ใƒ†ใ‚นใƒˆ import itertools import numpy as np N = int(readline()) m = map(int,read().split()) Z = [x + y * 1j for x,y in zip(m,m)] def find_O(z0,z1,z2): z1 -= z0; z2 -= z0 if abs((z1 * z2.conjugate()).imag) < 0.5: # ๅŒไธ€็›ด็ทšไธŠ return None num = z1 * z2 * (z1-z2).conjugate() den = z1.conjugate() * z2 den -= den.conjugate() return (num / den) + z0 A = [] for comb in itertools.combinations(Z,3): O = find_O(*comb) if O is None: continue A.append(O) for z1,z2 in itertools.combinations(Z,2): O = (z1 + z2) / 2 A.append(O) Z = np.array(Z); A = np.array(A) answer = np.abs((Z[:,None] - A[None,:])).max(axis = 0).min() print(answer)
[ "function.return_value.change" ]
609,237
609,238
u102461423
python
p02806
n=int(input()) l=[input().split() for i in range(n)] x=input() ans=0 sum=0 for i,j in l: print(i,j) if i!=x: ans+=int(j) else: ans+=int(j) break for i,j in l: sum+=int(j) print(sum-ans)
n=int(input()) l=[input().split() for i in range(n)] x=input() ans=0 sum=0 for i,j in l: if i!=x: ans+=int(j) else: ans+=int(j) break for i,j in l: sum+=int(j) print(sum-ans)
[ "call.remove" ]
609,249
609,250
u094191970
python
p02806
N = int(input()) S = [] T = [] for i in range(N): s, t = input().split() S.append(s) T.append(int(t)) X = input() print(sum(T[:S.index(X)]))
N = int(input()) S = [] T = [] for i in range(N): s, t = input().split() S.append(s) T.append(int(t)) X = input() print(sum(T[S.index(X)+1:]))
[ "call.arguments.change" ]
609,255
609,256
u642012866
python
p02806
N = int(input()) S = [] T = [] for i in range(N): s, t = input().split() S.append(s) T.append(int(t)) X = input() print(sum(T[:S.index(X)+1]))
N = int(input()) S = [] T = [] for i in range(N): s, t = input().split() S.append(s) T.append(int(t)) X = input() print(sum(T[S.index(X)+1:]))
[ "call.arguments.change" ]
609,257
609,256
u642012866
python
p02806
N = int(input()) songs = [] times = [] for _ in range(N): song,time = input().split() songs.append(song) times.append(int(time)) start = input() number = songs.index(start) if number == len(songs): print(0) else: print(sum(times[1:]))
N = int(input()) songs = [] times = [] for _ in range(N): song,time = input().split() songs.append(song) times.append(int(time)) start = input() number = songs.index(start) if number == len(songs): print(0) else: print(sum(times[number+1:]))
[ "expression.operation.binary.add" ]
609,262
609,263
u760794812
python
p02805
import math import random from operator import itemgetter import re import sys from itertools import accumulate from collections import defaultdict from collections import deque from bisect import bisect_left,bisect from heapq import heappop,heappush from math import gcd from copy import deepcopy N = int(input()) cood = [] ans = 0 r = 0 for i in range(N): A= [float(i) for i in input().split()] cood.append(A) for j in range(N): for k in range(N): for i in range(N): if i == k or i == j or j == k: continue else: a = cood[j][0] b = cood[j][1] c = cood[k][0] d = cood[k][1] e = cood[i][0] f = cood[i][1] aa = a * a bb = b * b cc = c * c dd = d * d ee = e * e ff = f * f if ((a-c) * (a-e) + (b-d) * (b-f)) > 0 and ((c-a) * (c-e) + (d-b) * (d-f)) > 0 and ((e-a)* (e-c) + (f-b) * (f-d)) > 0: py = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f)) px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a)) \ if (c == a) else (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a)) r = math.hypot(px - a, py - b) else: r = max(((a-c)**2+(b-d)**2)**(1/2),((a-e)**2+(b-f)**2)**(1/2),((e-c)**2+(f-d)**2)**(1/2)) r /= 2 if r > ans: ans = r if N == 2: ans = ((cood[1][0]-cood[0][0])+(cood[1][1]-cood[0][1]))**(1/2)/2 print(ans)
import math import random from operator import itemgetter import re import sys from itertools import accumulate from collections import defaultdict from collections import deque from bisect import bisect_left,bisect from heapq import heappop,heappush from math import gcd from copy import deepcopy N = int(input()) cood = [] ans = 0 r = 0 for i in range(N): A= [float(i) for i in input().split()] cood.append(A) for j in range(N): for k in range(N): for i in range(N): if i == k or i == j or j == k: continue else: a = cood[j][0] b = cood[j][1] c = cood[k][0] d = cood[k][1] e = cood[i][0] f = cood[i][1] aa = a * a bb = b * b cc = c * c dd = d * d ee = e * e ff = f * f if ((a-c) * (a-e) + (b-d) * (b-f)) > 0 and ((c-a) * (c-e) + (d-b) * (d-f)) > 0 and ((e-a)* (e-c) + (f-b) * (f-d)) > 0: py = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f)) px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a)) \ if (c == a) else (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a)) r = math.hypot(px - a, py - b) else: r = max(((a-c)**2+(b-d)**2)**(1/2),((a-e)**2+(b-f)**2)**(1/2),((e-c)**2+(f-d)**2)**(1/2)) r /= 2 if r > ans: ans = r if N == 2: ans = ((cood[1][0]-cood[0][0])**2+(cood[1][1]-cood[0][1])**2)**(1/2)/2 print(ans)
[ "assignment.change" ]
609,276
609,277
u513900925
python
p02805
#!/usr/bin/env python3 import itertools import math EPS = 1e-6 def dot(a, b): return a.real * b.real + a.imag * b.imag def enclose_triangle(p1, p2, p3): v12 = p2 - p1 v23 = p3 - p2 v31 = p1 - p3 an1 = dot(v12, -v31) an2 = dot(-v12, v23) an3 = dot(-v23, v31) if an1 < 0 + EPS or an2 < 0 + EPS or an3 < 0 + EPS: vx = max(v12, v23, v31, key=abs) rad = abs(vx) / 2 if vx == v12: cent = (p1 + p2) / 2 elif vx == v23: cent = (p2 + p3) / 2 else: cent = (p3 + p1) / 2 else: a = p1 b = p2 c = p3 a2 = abs(v23) ** 2 b2 = abs(v31) ** 2 c2 = abs(v12) ** 2 u = a2 * (b2 + c2 - a2) * a + b2 * (c2 + a2 - b2) * \ b + c2 * (a2 + b2 - c2) * c u /= a2 * (b2 + c2 - a2) + b2 * (c2 + a2 - b2) + c2 * (a2 + b2 - c2) rad = abs(u - p1) cent = u return rad, cent def enclose_points(n, ps): assert n >= 2 if n == 2: return abs(ps[1] - ps[0]) / 2 for p1, p2, p3 in itertools.combinations(ps, 3): rad_cand, cent_cand = enclose_triangle(p1, p2, p3) for q1 in ps: dist = abs(cent_cand - q1) if dist > rad_cand: break else: return rad_cand def main(): n = int(input()) ps = [] for _ in range(n): x, y = (float(z) for z in input().split()) ps.append(complex(x, y)) res = enclose_points(n, ps) print("{:.16f}".format(res)) if __name__ == "__main__": main()
#!/usr/bin/env python3 import itertools import math EPS = 1e-6 def dot(a, b): return a.real * b.real + a.imag * b.imag def enclose_triangle(p1, p2, p3): v12 = p2 - p1 v23 = p3 - p2 v31 = p1 - p3 an1 = dot(v12, -v31) an2 = dot(-v12, v23) an3 = dot(-v23, v31) if an1 < 0 + EPS or an2 < 0 + EPS or an3 < 0 + EPS: vx = max(v12, v23, v31, key=abs) rad = abs(vx) / 2 if vx == v12: cent = (p1 + p2) / 2 elif vx == v23: cent = (p2 + p3) / 2 else: cent = (p3 + p1) / 2 else: a = p1 b = p2 c = p3 a2 = abs(v23) ** 2 b2 = abs(v31) ** 2 c2 = abs(v12) ** 2 u = a2 * (b2 + c2 - a2) * a + b2 * (c2 + a2 - b2) * \ b + c2 * (a2 + b2 - c2) * c u /= a2 * (b2 + c2 - a2) + b2 * (c2 + a2 - b2) + c2 * (a2 + b2 - c2) rad = abs(u - p1) cent = u return rad, cent def enclose_points(n, ps): assert n >= 2 if n == 2: return abs(ps[1] - ps[0]) / 2 for p1, p2, p3 in itertools.combinations(ps, 3): rad_cand, cent_cand = enclose_triangle(p1, p2, p3) for q1 in ps: dist = abs(cent_cand - q1) if dist >= rad_cand + EPS: break else: return rad_cand def main(): n = int(input()) ps = [] for _ in range(n): x, y = (float(z) for z in input().split()) ps.append(complex(x, y)) res = enclose_points(n, ps) print("{:.16f}".format(res)) if __name__ == "__main__": main()
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
609,280
609,281
u509661905
python
p02805
import sys from math import hypot readline = sys.stdin.readline N = int(readline()) Points = [tuple(map(int, readline().split())) for _ in range(N)] inf = 10**9+7 EPS = 1e-8 ans = inf for i in range(N): for j in range(i): a = Points[i][0] b = Points[i][1] c = Points[j][0] d = Points[j][1] px, py = (a+c)/2, (b+d)/2 R = hypot(a-px, b-py) if all(hypot(px-xi, py-yi) <= R+EPS for xi, yi in Points): ans = min(ans, R) for i in range(N): for j in range(i): for k in range(j): a = Points[i][0] b = Points[i][1] c = Points[j][0] d = Points[j][1] e = Points[k][0] f = Points[k][1] ea = hypot(c-e, d-f) eb = hypot(a-e, b-f) ec = hypot(a-c, b-d) cA = (ec**2+eb**2-ea**2)/(2*ec*eb) cB = (ec**2-eb**2+ea**2)/(2*ec*ea) cC = (-ec**2+eb**2+ea**2)/(2*ea*eb) sA = (1-cA**2)**0.5 sB = (1-cB**2)**0.5 sC = (1-cC**2)**0.5 s2A = 2*sA*cA s2B = 2*sB*cB s2C = 2*sC*cC if max(s2A, s2B, s2C) < EPS: continue else: px = (a*s2A + c*s2B + e*s2C)/(s2A+s2B+s2C) py = (b*s2A + d*s2B + f*s2C)/(s2A+s2B+s2C) R = hypot(px - a, py - b) if all(hypot(px-xi, py-yi) <= R+EPS for xi, yi in Points): ans = min(ans, R) print(ans)
import sys from math import hypot readline = sys.stdin.readline N = int(readline()) Points = [tuple(map(int, readline().split())) for _ in range(N)] inf = 10**9+7 EPS = 1e-8 ans = inf for i in range(N): for j in range(i): a = Points[i][0] b = Points[i][1] c = Points[j][0] d = Points[j][1] px, py = (a+c)/2, (b+d)/2 R = hypot(a-px, b-py) if all(hypot(px-xi, py-yi) <= R+EPS for xi, yi in Points): ans = min(ans, R) for i in range(N): for j in range(i): for k in range(j): a = Points[i][0] b = Points[i][1] c = Points[j][0] d = Points[j][1] e = Points[k][0] f = Points[k][1] ea = hypot(c-e, d-f) + EPS eb = hypot(a-e, b-f) + EPS ec = hypot(a-c, b-d) + EPS cA = (ec**2+eb**2-ea**2)/(2*ec*eb) cB = (ec**2-eb**2+ea**2)/(2*ec*ea) cC = (-ec**2+eb**2+ea**2)/(2*ea*eb) sA = (1-cA**2)**0.5 sB = (1-cB**2)**0.5 sC = (1-cC**2)**0.5 s2A = 2*sA*cA s2B = 2*sB*cB s2C = 2*sC*cC if max(s2A, s2B, s2C) < EPS: continue else: px = (a*s2A + c*s2B + e*s2C)/(s2A+s2B+s2C) py = (b*s2A + d*s2B + f*s2C)/(s2A+s2B+s2C) R = hypot(px - a, py - b) if all(hypot(px-xi, py-yi) <= R+EPS for xi, yi in Points): ans = min(ans, R) print(ans)
[ "assignment.change" ]
609,314
609,315
u368780724
python
p02806
n=int(input()) a=[list(map(input().split())) for _ in range(n)] x=input() cnt='x' for i in a: if cnt!='x': z=int(i[1]) cnt+=z if i[0]==x: cnt=0 print(cnt)
n=int(input()) a=[(input().split()) for _ in range(n)] x=input() cnt='x' for i in a: if cnt!='x': z=int(i[1]) cnt+=z if i[0]==x: cnt=0 print(cnt)
[ "call.remove", "call.arguments.change" ]
609,337
609,338
u350093546
python
p02806
n=int(input()) a=[list(map(input().split())) for _ in range(n)] x=input() cnt='x' for i in a: if cnt!='x': z=int(i[1]) cnt+=z if i[0]==x: cnt=0 print(cnt)
n=int(input()) a=[(input().split()) for _ in range(n)] x=input() cnt='x' for i in a: if cnt!='x': z=int(i[1]) cnt+=z if i[0]==x: cnt=0 print(cnt)
[ "call.remove", "call.arguments.change" ]
609,339
609,338
u350093546
python
p02806
n = int(input()) st = [list(input().split()) for nesya in range(n)] x = input() c = 0 for a in st: if x == st[0]: c = 0 else: c += int(st[1]) print(c)
n = int(input()) st = [list(input().split()) for nesya in range(n)] x = input() c = 0 for a in st: if x == a[0]: c = 0 else: c += int(a[1]) print(c)
[ "identifier.change", "control_flow.branch.if.condition.change", "call.arguments.change" ]
609,343
609,344
u227085629
python
p02806
n = int(input()) cum = 0 d = dict() for _ in range(n): a, b = input().split() b = int(b) cum += b d[a] = b c = input() print(cum - d[c])
n = int(input()) cum = 0 d = dict() for _ in range(n): a, b = input().split() b = int(b) cum += b d[a] = cum c = input() print(cum - d[c])
[ "assignment.value.change", "identifier.change" ]
609,349
609,350
u091051505
python
p02806
N=int(input()) s=[0]*N t=[0]*N for i in range(N): s[i],t[i] = input().split() t[i]=int(t[i]) X=input() j= s.index(X) if X==s[-1]: ans=0 else: ans= t[j+1:] print(sum(ans))
N=int(input()) s=[0]*N t=[0]*N for i in range(N): s[i],t[i] = input().split() t[i]=int(t[i]) X=input() j= s.index(X) if X==s[-1]: ans=0 else: ans= sum(t[j+1:]) print(ans)
[ "call.add", "call.arguments.change" ]
609,351
609,352
u089142196
python
p02806
N = int(input()) s, t = [], [] for i in range(N): s_i, t_i = [input().split(" ")] t_i = int(t_i) s.append(s_i) t.append(t_i) X = input() idx = 0 while idx < N: if s[idx] == X: idx += 1 break idx += 1 ans = 0 for i in range(idx, N): ans += t[i] print(ans)
N = int(input()) s, t = [], [] for i in range(N): s_i, t_i = input().split(" ") t_i = int(t_i) s.append(s_i) t.append(t_i) X = input() idx = 0 while idx < N: if s[idx] == X: idx += 1 break idx += 1 ans = 0 for i in range(idx, N): ans += t[i] print(ans)
[]
609,355
609,356
u198062737
python
p02806
def ii():return int(input()) def iim():return map(int,input().split()) def iil():return list(map(int,input().split())) n = ii() music = [] length = [] for i in range(n): ti,leng = map(str,input().split()) music.append(ti) length.append(leng) x = input() num = music.index(x) print(sum(length[x::]))
def ii():return int(input()) def iim():return map(int,input().split()) def iil():return list(map(int,input().split())) n = ii() music = [] length = [] for i in range(n): ti,leng = map(str,input().split()) music.append(ti) length.append(int(leng)) x = input() num = music.index(x) print(sum(length[num+1::]))
[ "call.add", "call.arguments.change", "variable_access.subscript.index.change", "io.output.change" ]
609,357
609,358
u021916304
python
p02806
n = int(input()) data=[list(inout().split()) for _ in range(n)] s = input() ans = 0 c = False for i in range(n): if c: ans += int(data[i][1]) if data[i][0] == s: c = True print(ans)
n = int(input()) data=[list(input().split()) for _ in range(n)] s = input() ans = 0 c = False for i in range(n): if c: ans += int(data[i][1]) if data[i][0] == s: c = True print(ans)
[ "assignment.value.change", "identifier.change", "call.function.change", "call.arguments.change" ]
609,359
609,360
u923279197
python
p02806
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, random, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return list(map(float, input().split())) def LI_(): return list(map(lambda x: int(x)-1, input().split())) def II(): return int(input()) def IF(): return float(input()) def LS(): return input().split() def S(): return input().rstrip() def IR(n): return [II() for _ in range(n)] def LIR(n): return [LI() for _ in range(n)] def FR(n): return [IF() for _ in range(n)] def LFR(n): return [LI() for _ in range(n)] def LIR_(n): return [LI_() for _ in range(n)] def SR(n): return [S() for _ in range(n)] def LSR(n): return [LS() for _ in range(n)] mod = 1000000007 inf = 1e10 #solve def solve(): n = II() st = LSR(n) x = S() ans = 0 te = 0 for s, t in st: if te: ans += t if s == x: te = 1 print(ans) return #main if __name__ == '__main__': solve()
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, random, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return list(map(float, input().split())) def LI_(): return list(map(lambda x: int(x)-1, input().split())) def II(): return int(input()) def IF(): return float(input()) def LS(): return input().split() def S(): return input().rstrip() def IR(n): return [II() for _ in range(n)] def LIR(n): return [LI() for _ in range(n)] def FR(n): return [IF() for _ in range(n)] def LFR(n): return [LI() for _ in range(n)] def LIR_(n): return [LI_() for _ in range(n)] def SR(n): return [S() for _ in range(n)] def LSR(n): return [LS() for _ in range(n)] mod = 1000000007 inf = 1e10 #solve def solve(): n = II() st = LSR(n) x = S() ans = 0 te = 0 for s, t in st: if te: ans += int(t) if s == x: te = 1 print(ans) return #main if __name__ == '__main__': solve()
[ "call.add", "call.arguments.change" ]
609,361
609,362
u423585790
python
p02806
n=int(input()) lst=[] for i in range(n): s,t=input().split() T=int(t) lst.append([s,t]) x=input() for j in range(n): if lst[j][0]==x: k=j break totl=0 for j in range(k+1,n): totl+=lst[j][1] print(totl)
n=int(input()) lst=[] for i in range(n): s,t=input().split() T=int(t) lst.append([s,T]) x=input() for j in range(n): if lst[j][0]==x: k=j break totl=0 for j in range(k+1,n): totl+=lst[j][1] print(totl)
[ "identifier.change", "call.arguments.change" ]
609,363
609,364
u527261492
python
p02806
n=int(input()) p=[input().split() for _ in range(n)] x=input() ans=0 flag=False for i in p: if i[1]==x: flag=True continue if flag: ans+=int(i[0]) print(ans)
n=int(input()) p=[input().split() for _ in range(n)] x=input() ans=0 flag=False for i in p: if i[0]==x: flag=True continue if flag: ans+=int(i[1]) print(ans)
[ "literal.number.integer.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change", "call.arguments.change" ]
609,379
609,380
u664373116
python
p02806
n=int(input()) l=[] for i in range(n): l.append(list(map(str,input().split()))) x=input() ans=0 f=0 for i in l: if f==1: ans+=int(l[1]) if i[0]==x: f=1 print(ans)
n=int(input()) l=[] for i in range(n): l.append(list(map(str,input().split()))) x=input() ans=0 f=0 for i in l: if f==1: ans+=int(i[1]) if i[0]==x: f=1 print(ans)
[ "identifier.change", "call.arguments.change" ]
609,402
609,403
u223904637
python
p02806
N=int(input()) s=["" for i in range(N)] t=["" for i in range(N)] for i in range(N): s[i],t[i]=input().split() t[i]=int(t[i]) X=int(input()) flag=0 ans=0 for i in range(N): if flag==1: ans+=t[i] else: if s[i]==X: flag=1 print(ans)
N=int(input()) s=["" for i in range(N)] t=["" for i in range(N)] for i in range(N): s[i],t[i]=input().split() t[i]=int(t[i]) X=input() flag=0 ans=0 for i in range(N): if flag==1: ans+=t[i] else: if s[i]==X: flag=1 print(ans)
[ "call.remove", "call.arguments.change" ]
609,406
609,407
u562016607
python
p02806
n = int(input()) s = ['']*n t = ['']*n for i in range(n): s[i], t[i] = input().split() x = input() p = s.index(x) total = 0 for i in range(p, n): total += int(t[i]) print(total)
n = int(input()) s = ['']*n t = ['']*n for i in range(n): s[i], t[i] = input().split() x = input() p = s.index(x) total = 0 for i in range(p+1, n): total += int(t[i]) print(total)
[ "control_flow.loop.range.bounds.lower.change", "expression.operation.binary.add" ]
609,421
609,422
u816637025
python
p02806
N = int(input()) P = [] for _ in range(N): s,t = input().split() t = int(t) P.append([s,t]) X = input() end_index = 0 for i in range(N): p = P[i] if p[0]==X: end_index = i break count = 0 for i in range(end_index, N, 1): count = count + P[i][1] print(count)
N = int(input()) P = [] for _ in range(N): s,t = input().split() t = int(t) P.append([s,t]) X = input() end_index = -1 for i in range(N): p = P[i] if p[0]==X: end_index = i break count = 0 for i in range(end_index+1, N, 1): count = count + P[i][1] print(count)
[ "assignment.value.change", "expression.operation.unary.add" ]
609,423
609,424
u492447501
python
p02806
import math import random from operator import itemgetter import re import sys from itertools import accumulate from collections import defaultdict from collections import deque from bisect import bisect_left,bisect from heapq import heappop,heappush from math import gcd from copy import deepcopy import functools N = int(input()) music = [] for i in range(N): music.append(list(map(str,input().split()))) stop = input() i = 0 while stop != music[i][0]: i += 1 ans = 0 for j in range(N-i-1): ans += int(music[i+j+1][1]) print(ans) print(ans)
import math import random from operator import itemgetter import re import sys from itertools import accumulate from collections import defaultdict from collections import deque from bisect import bisect_left,bisect from heapq import heappop,heappush from math import gcd from copy import deepcopy import functools N = int(input()) music = [] for i in range(N): music.append(list(map(str,input().split()))) stop = input() i = 0 while stop != music[i][0]: i += 1 ans = 0 for j in range(N-i-1): ans += int(music[i+j+1][1]) print(ans)
[ "call.remove" ]
609,435
609,436
u513900925
python
p02806
N = int(input()) ST = list() for i in range(N): s, t = input().split() ST.append([s, t]) X = input() result = None for s, t in ST: t = int(t) if result is None: if s == X: result = 0 else: result += t print(s, t) print(result)
N = int(input()) ST = list() for i in range(N): s, t = input().split() ST.append([s, t]) X = input() result = None for s, t in ST: t = int(t) if result is None: if s == X: result = 0 else: result += t print(result)
[ "call.remove" ]
609,439
609,440
u658801777
python
p02806
n=int(input()) l=[input() for i in range(n)] target_song = input() total = 0 ff = False for i in l: s, t = i.split(" ") if s == target_song: f = True continue if f == True: total += int(t) print(total)
n=int(input()) l=[input() for i in range(n)] target_song = input() total = 0 ff = False for i in l: s, t = i.split(" ") if s == target_song: ff = True continue if ff == True: total += int(t) print(total)
[ "assignment.variable.change", "identifier.change", "control_flow.branch.if.condition.change" ]
609,460
609,461
u218602353
python
p02806
def main(): N = int(input()) music = [] m_time = [] for _ in range(N): a, b = input().split() music.append(a) m_time.append(int(b)) X = input() ans = 0 for i, a in enumerate(music): if a == X: for j in range(i, N): ans += m_time[j] print(ans) main()
def main(): N = int(input()) music = [] m_time = [] for _ in range(N): a, b = input().split() music.append(a) m_time.append(int(b)) X = input() ans = 0 for i, a in enumerate(music): if a == X: for j in range(i+1, N): ans += m_time[j] print(ans) main()
[ "control_flow.loop.range.bounds.lower.change", "expression.operation.binary.add" ]
609,481
609,482
u611865271
python
p02806
n=int(input()) t=[]*n sec=[]*n for k in range(n): s=input().split() t[k]=s[0] sec[k]=int(s[1]) x=input() p=t.index(x) a=0 if p!=n: for l in range(p+1,n): a+=sec[l] print(str(a))
n=int(input()) t=[""]*n sec=[0]*n for k in range(n): s=input().split() t[k]=s[0] sec[k]=int(s[1]) x=input() p=t.index(x) a=0 if p!=n: for l in range(p+1,n): a+=sec[l] print(str(a))
[]
609,483
609,484
u291988695
python
p02806
N = int(input()) s = ["" for i in range(N)] t = [0 for i in range(N)] for i in range(N): s_str, t_str = input().split() s[i] = s_str t[i] = int(t_str) X = input() ans = 0 count = False for i in range(X): if count: ans += t[i] if s[i] == X: count = True print(ans)
N = int(input()) s = ["" for i in range(N)] t = [0 for i in range(N)] for i in range(N): s_str, t_str = input().split() s[i] = s_str t[i] = int(t_str) X = input() ans = 0 count = False for i in range(N): if count: ans += t[i] if s[i] == X: count = True print(ans)
[ "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
609,499
609,500
u623349537
python
p02806
n=int(input()) s=list(input().strip().split() for _ in range(n)) x=input().strip() ans=0 isis=False for ss,tt in s: if isis: ans += (tt) if ss==x: isis=True print(ans)
n=int(input()) s=list(input().strip().split() for _ in range(n)) x=input().strip() ans=0 isis=False for ss,tt in s: if isis: ans += int(tt) if ss==x: isis=True print(ans)
[ "call.add", "type_conversion.to_integer.change", "type_conversion.to_number.change" ]
609,501
609,502
u077337864
python
p02803
from collections import deque def solve(s, start): if s[start[0]][start[1]] == "#": return -1 q = deque([start]) distance = [[-1] * w for _ in range(h)] distance[start[0]][start[1]] = 0 while q: y, x = q.popleft() for i, j in ((1, 0), (-1, 0), (0, 1), (0, -1)): new_y, new_x = y + i, x + j if not(0 <= new_y < h and 0 <= new_x < w): continue if s[new_y][new_x] == "#": continue if distance[new_y][new_x] == -1: distance[new_y][new_x] = distance[y][x] + 1 q.append([new_y, new_x]) print(distance) return max(map(max, distance)) h, w = map(int, input().split()) s = [input() for _ in range(h)] ans = 0 for i in range(h): for j in range(w): ans = max(ans, solve(s, [i, j])) print(ans)
from collections import deque def solve(s, start): if s[start[0]][start[1]] == "#": return -1 q = deque([start]) distance = [[-1] * w for _ in range(h)] distance[start[0]][start[1]] = 0 while q: y, x = q.popleft() for i, j in ((1, 0), (-1, 0), (0, 1), (0, -1)): new_y, new_x = y + i, x + j if not(0 <= new_y < h and 0 <= new_x < w): continue if s[new_y][new_x] == "#": continue if distance[new_y][new_x] == -1: distance[new_y][new_x] = distance[y][x] + 1 q.append([new_y, new_x]) return max(map(max, distance)) h, w = map(int, input().split()) s = [input() for _ in range(h)] ans = 0 for i in range(h): for j in range(w): ans = max(ans, solve(s, [i, j])) print(ans)
[ "call.remove" ]
609,515
609,516
u561870477
python
p02803
def Warshall_floyd(d, n): for k in range(n): for i in range(n): for j in range(n): d[i][j] = min(d[i][j], d[i][k] + d[k][j]) return d H, W = map(int,input().split()) N = H * W d = [[float("inf") for i in range(N)] for i in range(N)] M = [[1 for i in range(W+1)] for i in range(H+1)] for i in range(H): m = input().strip() for j in range(W): if m[j] == '.': M[i][j] = 0 for i in range(H): for j in range(W): if M[i][j] == 0: d[W*i+j][W*i+j] = 0 if M[i][j+1] == 0: d[W*i+j][W*i+j+1] = 1 d[W*i+j+1][W*i+j] = 1 if M[i+1][j] == 0: d[W*i+j][W*(i+1)+j] = 1 d[W*(i+1)+j][W*i+j] = 1 o = warshall_floyd(d, N) ans = 0 for i in range(N): for j in range(N): if o[i][j] != float('inf'): ans = max(ans, o[i][j]) print(ans)
def warshall_floyd(d, n): for k in range(n): for i in range(n): for j in range(n): d[i][j] = min(d[i][j], d[i][k] + d[k][j]) return d H, W = map(int,input().split()) N = H * W d = [[float("inf") for i in range(N)] for i in range(N)] M = [[1 for i in range(W+1)] for i in range(H+1)] for i in range(H): m = input().strip() for j in range(W): if m[j] == '.': M[i][j] = 0 for i in range(H): for j in range(W): if M[i][j] == 0: d[W*i+j][W*i+j] = 0 if M[i][j+1] == 0: d[W*i+j][W*i+j+1] = 1 d[W*i+j+1][W*i+j] = 1 if M[i+1][j] == 0: d[W*i+j][W*(i+1)+j] = 1 d[W*(i+1)+j][W*i+j] = 1 o = warshall_floyd(d, N) ans = 0 for i in range(N): for j in range(N): if o[i][j] != float('inf'): ans = max(ans, o[i][j]) print(ans)
[ "identifier.change" ]
609,548
609,549
u314350294
python
p02803
from collections import deque import itertools h,w=map(int,input().split()) s=["#"+input()+"#" for i in range(h)] s.insert(0,'#'*(w+2)) s.append('#'*(w+2)) def dep(s,t,p,q,time): print(s) s[p][q]=min(time,s[p][q]) time+=1 if t[p+1][q]=="." : dep(s,t,p+1,q,time) if t[p-1][q]=="." : dep(s,t,p-1,q,time) if t[p][q+1]=="." : dep(s,t,p,q+1,time) if t[p][q-1]=="." : dep(s,t,p,q-1,time) return max(itertools.chain.from_iterable(s)) m=0 for i in range(h): for j in range(w): if s[i+1][j+1]=='.': t=[[-1 for l in range(w+2)] for l2 in range(h+2)] time=0 q1=deque([]) t[i+1][j+1]=time q1.appendleft([i+1,j+1]) while len(q1)!=0: q=q1.pop() time=t[q[0]][q[1]]+1 if s[q[0]+1][q[1]]=='.' and t[q[0]][q[1]]==-1: t[q[0]+1][q[1]]=time q1.appendleft([q[0]+1,q[1]]) if s[q[0] - 1][q[1]] == '.' and t[q[0]-1][q[1]] == -1: t[q[0] - 1][q[1]] = time q1.appendleft([q[0] - 1, q[1]]) if s[q[0]][q[1]+1] == '.' and t[q[0]][q[1]+1] == -1: t[q[0] ][q[1]+1] = time q1.appendleft([q[0] , q[1]+1]) if s[q[0]][q[1]-1] == '.' and t[q[0]][q[1]-1] == -1: t[q[0] ][q[1]-1] = time q1.appendleft([q[0], q[1]-1]) m=max(max(itertools.chain.from_iterable(t)),m) print(m)
from collections import deque import itertools h,w=map(int,input().split()) s=["#"+input()+"#" for i in range(h)] s.insert(0,'#'*(w+2)) s.append('#'*(w+2)) def dep(s,t,p,q,time): print(s) s[p][q]=min(time,s[p][q]) time+=1 if t[p+1][q]=="." : dep(s,t,p+1,q,time) if t[p-1][q]=="." : dep(s,t,p-1,q,time) if t[p][q+1]=="." : dep(s,t,p,q+1,time) if t[p][q-1]=="." : dep(s,t,p,q-1,time) return max(itertools.chain.from_iterable(s)) m=0 for i in range(h): for j in range(w): if s[i+1][j+1]=='.': t=[[-1 for l in range(w+2)] for l2 in range(h+2)] time=0 q1=deque([]) t[i+1][j+1]=time q1.appendleft([i+1,j+1]) while len(q1)!=0: q=q1.pop() time=t[q[0]][q[1]]+1 if s[q[0]+1][q[1]]=='.' and t[q[0]+1][q[1]]==-1: t[q[0]+1][q[1]]=time q1.appendleft([q[0]+1,q[1]]) if s[q[0] - 1][q[1]] == '.' and t[q[0]-1][q[1]] == -1: t[q[0] - 1][q[1]] = time q1.appendleft([q[0] - 1, q[1]]) if s[q[0]][q[1]+1] == '.' and t[q[0]][q[1]+1] == -1: t[q[0] ][q[1]+1] = time q1.appendleft([q[0] , q[1]+1]) if s[q[0]][q[1]-1] == '.' and t[q[0]][q[1]-1] == -1: t[q[0] ][q[1]-1] = time q1.appendleft([q[0], q[1]-1]) m=max(max(itertools.chain.from_iterable(t)),m) print(m)
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "misc.off_by_one" ]
609,595
609,596
u341267151
python
p02803
import queue import copy def ngoin(bo,now): return 0 <= now[0] and now[0] < len(bo) and 0 <= now[1] and now[1] < len(bo[0]) def minido(bo,si,sj): tb = [[False for i in range(len(bo[0]))] for j in range(len(bo))] q = queue.Queue() q.put([si,sj,0]) tb[si][sj] = True ret = 0 while not q.empty(): now = q.get() ret = now[2] if ngoin(bo,[now[0]-1,now[1]]): if bo[now[0]-1][now[1]] and not tb[now[0]-1][now[1]]: q.put([now[0]-1,now[1],now[2]+1]) tb[now[0]][now[1]] = True if ngoin(bo,[now[0],now[1]+1]): if bo[now[0]][now[1]+1] and not tb[now[0]][now[1]+1]: q.put([now[0],now[1]+1,now[2]+1]) tb[now[0]][now[1]+1] = True if ngoin(bo,[now[0]+1,now[1]]): if bo[now[0]+1][now[1]] and not tb[now[0]+1][now[1]]: q.put([now[0]+1,now[1],now[2]+1]) tb[now[0]+1][now[1]] = True if ngoin(bo,[now[0],now[1]-1]): if bo[now[0]][now[1]-1] and not tb[now[0]][now[1]-1]: q.put([now[0],now[1]-1,now[2]+1]) tb[now[0]][now[1]-1] = True return ret h,w = map(int,input().split()) bo = [[True if x == '.' else False for x in input()] for i in range(h)] grap = [[float('inf') for i in range(h*w)] for j in range(h*w)] ans = 0 for i in range(h*w): grap[i][i] = 0 for si in range(h): for sj in range(w): if not bo[si][sj]: continue ans = max(ans,minido(bo,si,sj)) print(ans)
import queue import copy def ngoin(bo,now): return 0 <= now[0] and now[0] < len(bo) and 0 <= now[1] and now[1] < len(bo[0]) def minido(bo,si,sj): tb = [[False for i in range(len(bo[0]))] for j in range(len(bo))] q = queue.Queue() q.put([si,sj,0]) tb[si][sj] = True ret = 0 while not q.empty(): now = q.get() ret = now[2] if ngoin(bo,[now[0]-1,now[1]]): if bo[now[0]-1][now[1]] and not tb[now[0]-1][now[1]]: q.put([now[0]-1,now[1],now[2]+1]) tb[now[0]-1][now[1]] = True if ngoin(bo,[now[0],now[1]+1]): if bo[now[0]][now[1]+1] and not tb[now[0]][now[1]+1]: q.put([now[0],now[1]+1,now[2]+1]) tb[now[0]][now[1]+1] = True if ngoin(bo,[now[0]+1,now[1]]): if bo[now[0]+1][now[1]] and not tb[now[0]+1][now[1]]: q.put([now[0]+1,now[1],now[2]+1]) tb[now[0]+1][now[1]] = True if ngoin(bo,[now[0],now[1]-1]): if bo[now[0]][now[1]-1] and not tb[now[0]][now[1]-1]: q.put([now[0],now[1]-1,now[2]+1]) tb[now[0]][now[1]-1] = True return ret h,w = map(int,input().split()) bo = [[True if x == '.' else False for x in input()] for i in range(h)] grap = [[float('inf') for i in range(h*w)] for j in range(h*w)] ans = 0 for i in range(h*w): grap[i][i] = 0 for si in range(h): for sj in range(w): if not bo[si][sj]: continue ans = max(ans,minido(bo,si,sj)) print(ans)
[ "assignment.change" ]
609,597
609,598
u386131832
python
p02807
n = int(input()) x = list(map(int, input().split())) d = [] for x1, x2 in zip(x, x[1:]): d.append(x2 - x1) mod = 10 ** 9 + 7 base = 1 P = 10**9 + 7 N = n inv_t = [0]+[1] for i in range(2,N): inv_t += [inv_t[P % i] * (P - int(P / i)) % P] for i in range(1, n): base *= i base %= mod ans = 0 b = base for i, di in enumerate(d): ans += (base * di) % mod ans %= mod base += b * inv_t[i+2] base % mod print(ans)
n = int(input()) x = list(map(int, input().split())) d = [] for x1, x2 in zip(x, x[1:]): d.append(x2 - x1) mod = 10 ** 9 + 7 base = 1 P = 10**9 + 7 N = n+2 inv_t = [0]+[1] for i in range(2,N): inv_t += [inv_t[P % i] * (P - int(P / i)) % P] for i in range(1, n): base *= i base %= mod ans = 0 b = base for i, di in enumerate(d): ans += (base * di) % mod ans %= mod base += b * inv_t[i+2] base % mod print(ans)
[ "assignment.change" ]
609,622
609,623
u711539583
python
p02807
# -*- coding: utf-8 -*- # dwacon6th-prelims/dwacon6th_prelims_b import sys s2nn = lambda s: [int(c) for c in s.split(' ')] ss2nn = lambda ss: [int(s) for s in list(ss)] ss2nnn = lambda ss: [s2nn(s) for s in list(ss)] i2s = lambda: sys.stdin.readline().rstrip() i2n = lambda: int(i2s()) i2nn = lambda: s2nn(i2s()) ii2ss = lambda n: [i2s() for _ in range(n)] ii2nn = lambda n: ss2nn(ii2ss(n)) ii2nnn = lambda n: ss2nnn(ii2ss(n)) MAX = 10**5 + 100 MOD = 10**9 + 7 fac = [0] * MAX finv = [0] * MAX inv = [0] * MAX coef = [0] * MAX fac[0:2] = (1, 1) finv[0:2] = (1, 1) inv[1] = 1 coef[0:2] = (1, 1) for i in range(2, MAX): fac[i] = fac[i - 1] * i % MOD inv[i] = MOD - inv[MOD%i] * MOD // i % MOD finv[i] = finv[i - 1] * inv[i] % MOD coef[i] = (coef[i - 1] * i) % MOD + fac[i - 1] % MOD def main(): N = i2n() n = N - 1 x = i2nn() total = 0 for i in range(1, N): d = x[i] - x[i - 1] total = (total + (((coef[i] * fac[n]) % MOD * finv[i]) % MOD) * d % MOD) % MOD print(total % MOD) return main()
# -*- coding: utf-8 -*- # dwacon6th-prelims/dwacon6th_prelims_b import sys s2nn = lambda s: [int(c) for c in s.split(' ')] ss2nn = lambda ss: [int(s) for s in list(ss)] ss2nnn = lambda ss: [s2nn(s) for s in list(ss)] i2s = lambda: sys.stdin.readline().rstrip() i2n = lambda: int(i2s()) i2nn = lambda: s2nn(i2s()) ii2ss = lambda n: [i2s() for _ in range(n)] ii2nn = lambda n: ss2nn(ii2ss(n)) ii2nnn = lambda n: ss2nnn(ii2ss(n)) MAX = 10**5 + 100 MOD = 10**9 + 7 fac = [0] * MAX finv = [0] * MAX inv = [0] * MAX coef = [0] * MAX fac[0:2] = (1, 1) finv[0:2] = (1, 1) inv[1] = 1 coef[0:2] = (1, 1) for i in range(2, MAX): fac[i] = fac[i - 1] * i % MOD inv[i] = MOD - inv[MOD%i] * int(MOD / i) % MOD finv[i] = finv[i - 1] * inv[i] % MOD coef[i] = (coef[i - 1] * i) % MOD + fac[i - 1] % MOD def main(): N = i2n() n = N - 1 x = i2nn() total = 0 for i in range(1, N): d = x[i] - x[i - 1] total = (total + (((coef[i] * fac[n]) % MOD * finv[i]) % MOD) * d % MOD) % MOD print(total % MOD) return main()
[ "call.add", "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "call.arguments.change" ]
609,656
609,657
u106311097
python
p02807
n = int(input()) x = list(map(int, input().split())) mod = 10**9 + 7 fac = [1, 1] inv = [1, 1] finv = [1, 1] for i in range(2, n+5): fac.append(fac[i-1] * i % mod) inv.append(mod - inv[mod%i] * (mod//i) % mod) finv.append(finv[i-1] * inv[i] % mod) ans = 0 j_inv = [] num = 0 for j in range(1, n): num += inv[j] num %= mod j_inv.append(num) for i in range(n-1): ans += j_inv[i] ans *= (x[i+1] - x[i]) ans %= mod ans *=fac[n-1] ans %= mod print(ans)
n = int(input()) x = list(map(int, input().split())) mod = 10**9 + 7 fac = [1, 1] inv = [1, 1] finv = [1, 1] for i in range(2, n+5): fac.append(fac[i-1] * i % mod) inv.append(mod - inv[mod%i] * (mod//i) % mod) finv.append(finv[i-1] * inv[i] % mod) ans = 0 j_inv = [] num = 0 for j in range(1, n): num += inv[j] num %= mod j_inv.append(num) for i in range(n-1): ans += j_inv[i] * (x[i+1] - x[i]) ans %= mod ans *=fac[n-1] ans %= mod print(ans)
[]
609,682
609,683
u270681687
python
p02807
N = int(input()) A = list(map(int, input().split())) mod = 1e+9 + 7 p = mod - 2 S = [] while p != 0: S = [p%2] + S[:] p //= 2 frac = 1 for i in range(N - 1): frac *= i+1 frac %= mod T = 0 for i in range(N - 1): k = 1 for j in range(len(S)): if S[j] == 1: k *= i+1 k %= mod if j != len(S) - 1: k *= k k %= mod T += (frac * k * (A[N - 1] - A[i])) % mod T %= mod print(T%mod)
N = int(input()) A = list(map(int, input().split())) mod = int(1e+9 + 7) p = mod - 2 S = [] while p != 0: S = [p%2] + S[:] p //= 2 frac = 1 for i in range(N - 1): frac *= i+1 frac %= mod T = 0 for i in range(N - 1): k = 1 for j in range(len(S)): if S[j] == 1: k *= i+1 k %= mod if j != len(S) - 1: k *= k k %= mod T += (frac * k * (A[N - 1] - A[i])) % mod T %= mod print(T%mod)
[ "call.add", "call.arguments.change" ]
609,713
609,714
u984276646
python
p02807
mod=10**9+7 n=int(input()) arr=list(map(int,input().split())) acum=[1] for i in range(2,n+1): tmp=acum+pow(i,mod-2,mod) tmp%=mod acum.append(tmp) ans=0 for i in range(n-1): ans+=(arr[i+1]-arr[i])*acum[i] ans%=mod for i in range(1,n): ans*=i ans%=mod print(ans)
mod=10**9+7 n=int(input()) arr=list(map(int,input().split())) acum=[1] for i in range(2,n+1): tmp=acum[-1]+pow(i,mod-2,mod) tmp%=mod acum.append(tmp) ans=0 for i in range(n-1): ans+=(arr[i+1]-arr[i])*acum[i] ans%=mod for i in range(1,n): ans*=i ans%=mod print(ans)
[]
609,720
609,721
u163320134
python
p02807
import sys input = sys.stdin.readline N = int(input()) x = list(map(int, input().split())) mod = 10 ** 9 + 7 class Factorial: def __init__(self, n, mod): self.f = [1] for i in range(1, n + 1): self.f.append(self.f[-1] * i % mod) self.i = [pow(self.f[-1], mod - 2, mod)] for i in range(1, n + 1)[: : -1]: self.i.append(self.i[-1] * i % mod) self.i.reverse() def factorial(self, i): return self.f[i] def ifactorial(self, i): return self.i[i] def combi(self, n, k): return self.f[n] * self.i[n - k] % mod * self.i[k] % mod f = Factorial(N, mod) res = 0 t = [0] * (N + 1) for i in range(N): t[i + 1] = t[i] * (i + 1) + f.factorial(i) % mod t[i + 1] %= mod print(t) for i in range(N - 2, -1, -1): res += (x[i + 1] - x[i]) * t[i + 1] * f.factorial(N - 1) % mod * f.ifactorial(i + 1) % mod res %= mod print(res)
import sys input = sys.stdin.readline N = int(input()) x = list(map(int, input().split())) mod = 10 ** 9 + 7 class Factorial: def __init__(self, n, mod): self.f = [1] for i in range(1, n + 1): self.f.append(self.f[-1] * i % mod) self.i = [pow(self.f[-1], mod - 2, mod)] for i in range(1, n + 1)[: : -1]: self.i.append(self.i[-1] * i % mod) self.i.reverse() def factorial(self, i): return self.f[i] def ifactorial(self, i): return self.i[i] def combi(self, n, k): return self.f[n] * self.i[n - k] % mod * self.i[k] % mod f = Factorial(N, mod) res = 0 t = [0] * (N + 1) for i in range(N): t[i + 1] = t[i] * (i + 1) + f.factorial(i) % mod t[i + 1] %= mod #print(t) for i in range(N - 2, -1, -1): res += (x[i + 1] - x[i]) * t[i + 1] * f.factorial(N - 1) % mod * f.ifactorial(i + 1) % mod res %= mod print(res)
[ "call.remove" ]
609,725
609,726
u141610915
python
p02807
MOD = 10**9+7 N = int(input()) x = list(map(int,input().split())) def mod_pow(x,n,mod): res = 1 while(n > 0): if(n and 1): res = res * x % mod x = x * x % mod n >>= 1 return res prob = [] a = 0 for i in range(1,N): a += mod_pow(i,MOD-2,MOD) a %= MOD prob.append(a) ans = 0 for i in range(1,N): """for j in range(1,i+1): prob += 1/j """ ans += (x[i]-x[i-1]) * prob[i-1] ans %= MOD for i in range(1,N): ans *= i ans %= MOD ans = int(ans) print(ans)
MOD = 10**9+7 N = int(input()) x = list(map(int,input().split())) def mod_pow(x,n,mod): res = 1 while(n > 0): if n&1: res = res * x % mod x = x * x % mod n >>= 1 return res prob = [] a = 0 for i in range(1,N): a += mod_pow(i,MOD-2,MOD) #koko a %= MOD prob.append(a) ans = 0 for i in range(1,N): """for j in range(1,i+1): prob += 1/j """ ans += (x[i]-x[i-1]) * prob[i-1] ans %= MOD for i in range(1,N): ans *= i ans %= MOD ans = int(ans) print(ans)
[ "control_flow.branch.if.condition.change" ]
609,742
609,743
u434872492
python
p02805
import math from itertools import combinations eps = 10 ** -7 def midpoint(a, b): return (a[0] + b[0]) / 2, (a[1] + b[1]) / 2 def distance(a, b): return ((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) ** 0.5 def within(c, r, a): return (a[0] - c[0]) ** 2 + (a[1] - c[1]) ** 2 <= r ** 2 + eps def tcircle(t1, t2, t3): x1, y1 = t1 x2, y2 = t2 x3, y3 = t3 d = 2 * ((y1 - y3) * (x1 - x2) - (y1 - y2) * (x1 - x3)) if d == 0: return (0.0, 0.0), -1.0 x = ((y1 - y3) * (y1 ** 2 - y2 ** 2 + x1 ** 2 - x2 ** 2) - (y1 - y2) * (y1 ** 2 - y3 ** 2 + x1 ** 2 - x3 ** 2)) / d y = ((x1 - x3) * (x1 ** 2 - x2 ** 2 + y1 ** 2 - y2 ** 2) - (x1 - x2) * (x1 ** 2 - x3 ** 2 + y1 ** 2 - y3 ** 2)) / -d r = math.sqrt((x - x1) ** 2 + (y - y1) ** 2) return (x, y), r def main(): N = int(input()) L = [tuple(map(int, input().split())) for _ in range(N)] br = float('inf') for p, q in combinations(L, 2): c, r = midpoint(p, q), distance(p, q) / 2 if all(within(c, r, i) for i in L): return r ac, ar = (0.0, 0.0), 0.0 for i in L: if within(c, r, i): continue pc, pr = tcircle(p, q, i) if pr == -1: break if ar < pr: ac, ar = pc, pr else: if ar < br and all(within(ac, ar, i) for i in L): br = ar return ar print(main())
import math from itertools import combinations eps = 10 ** -7 def midpoint(a, b): return (a[0] + b[0]) / 2, (a[1] + b[1]) / 2 def distance(a, b): return ((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) ** 0.5 def within(c, r, a): return (a[0] - c[0]) ** 2 + (a[1] - c[1]) ** 2 <= r ** 2 + eps def tcircle(t1, t2, t3): x1, y1 = t1 x2, y2 = t2 x3, y3 = t3 d = 2 * ((y1 - y3) * (x1 - x2) - (y1 - y2) * (x1 - x3)) if d == 0: return (0.0, 0.0), -1.0 x = ((y1 - y3) * (y1 ** 2 - y2 ** 2 + x1 ** 2 - x2 ** 2) - (y1 - y2) * (y1 ** 2 - y3 ** 2 + x1 ** 2 - x3 ** 2)) / d y = ((x1 - x3) * (x1 ** 2 - x2 ** 2 + y1 ** 2 - y2 ** 2) - (x1 - x2) * (x1 ** 2 - x3 ** 2 + y1 ** 2 - y3 ** 2)) / -d r = math.sqrt((x - x1) ** 2 + (y - y1) ** 2) return (x, y), r def main(): N = int(input()) L = [tuple(map(int, input().split())) for _ in range(N)] br = float('inf') for p, q in combinations(L, 2): c, r = midpoint(p, q), distance(p, q) / 2 if all(within(c, r, i) for i in L): return r ac, ar = (0.0, 0.0), 0.0 for i in L: if within(c, r, i): continue pc, pr = tcircle(p, q, i) if pr == -1: break if ar < pr: ac, ar = pc, pr else: if ar < br and all(within(ac, ar, i) for i in L): br = ar return br print(main())
[ "identifier.change", "function.return_value.change" ]
609,780
609,781
u858742833
python
p02805
# ่งฃ่ชฌAC from math import sin, sqrt N = int(input()) XY = [[int(i) for i in input().split()] for _ in range(N)] INF = 10 ** 6 def circumcenter(i,j,k): """ 3็‚นใ‚’้€šใ‚‹ๅ††ใฎไธญๅฟƒ(ๅค–ๅฟƒ) """ a,b = XY[i] c,d = XY[j] e,f = XY[k] aa, bb, cc, dd, ee, ff = a**2, b**2, c**2, d**2, e**2, f**2 try: x = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f)) y = (2 * (b - f) * x - aa - bb + ee + ff) / (2 * (e - a)) if (c == a) else (2 * (b - d) * x - aa - bb + cc + dd) / (2 * (c - a)) except ZeroDivisionError as e: return (-INF, -INF) return x,y def radius(x,y): """ ๅŠๅพ„ใ‚’ๆฑ‚ใ‚ใ‚‹ """ dist = 0 for X,Y in XY: tmp = pow(X-x, 2) + pow(Y-y, 2) dist = max(dist, tmp) return sqrt(dist) def midpoint(a,b): """ 2็‚นใฎไธญ็‚น """ xa, ya = XY[a] xb, yb = XY[b] x = (xa + xb) / 2 y = (ya + yb) / 2 return (x, y) def main(): ans = float("inf") # 2็‚นใ‚’็›ดๅพ„ใจใ™ใ‚‹ๅ†† for a in range(N): for b in range(a+1,N): x,y = midpoint(a,b) r = radius(x,y) ans = min(ans, r) # 3็‚นใ‚’้€šใ‚‹ๅ†† for a in range(N): for b in range(a+1,N): for c in range(b+1,N): x,y = circumcenter(a,b,c) r = radius(x,y) ans = min(ans, r) print("{0:.7f}".format(ans)) if __name__ == "__main__": main()
# ่งฃ่ชฌAC from math import sin, sqrt N = int(input()) XY = [[int(i) for i in input().split()] for _ in range(N)] INF = 10 ** 6 def circumcenter(i,j,k): """ 3็‚นใ‚’้€šใ‚‹ๅ††ใฎไธญๅฟƒ(ๅค–ๅฟƒ) """ a,b = XY[i] c,d = XY[j] e,f = XY[k] aa, bb, cc, dd, ee, ff = a**2, b**2, c**2, d**2, e**2, f**2 try: y = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f)) x = (2 * (b - f) * y - aa - bb + ee + ff) / (2 * (e - a)) if (c == a) else (2 * (b - d) * y - aa - bb + cc + dd) / (2 * (c - a)) except ZeroDivisionError as e: return (-INF, -INF) return (x,y) def radius(x,y): """ ๅŠๅพ„ใ‚’ๆฑ‚ใ‚ใ‚‹ """ dist = 0 for X,Y in XY: tmp = pow(X-x, 2) + pow(Y-y, 2) dist = max(dist, tmp) return sqrt(dist) def midpoint(a,b): """ 2็‚นใฎไธญ็‚น """ xa, ya = XY[a] xb, yb = XY[b] x = (xa + xb) / 2 y = (ya + yb) / 2 return (x, y) def main(): ans = float("inf") # 2็‚นใ‚’็›ดๅพ„ใจใ™ใ‚‹ๅ†† for a in range(N): for b in range(a+1,N): x,y = midpoint(a,b) r = radius(x,y) ans = min(ans, r) # 3็‚นใ‚’้€šใ‚‹ๅ†† for a in range(N): for b in range(a+1,N): for c in range(b+1,N): x,y = circumcenter(a,b,c) r = radius(x,y) ans = min(ans, r) print("{0:.7f}".format(ans)) if __name__ == "__main__": main()
[ "assignment.variable.change", "identifier.change", "assignment.value.change", "expression.operation.binary.change", "function.return_value.change" ]
609,796
609,797
u561083515
python
p02805
printn = lambda x: print(x,end='') inn = lambda : int(input()) inl = lambda: list(map(int, input().split())) inm = lambda: map(int, input().split()) ins = lambda : input().strip() DBG = True # and False BIG = 10**18 R = 10**9 + 7 def ddprint(x): if DBG: print(x) import math def dist(xx,yy,u,v): return math.sqrt((xx-u)**2+(yy-v)**2) def do2(x1,y1,x2,y2): return ((x1+x2)/2, (y1+y2)/2, dist(x1,y1,x2,y2)/2) def do3(x1,y1,x2,y2,x3,y3): p = (x2-x1)*(y3-y1)+(x3-x1)*(y2-y1) if p==0: return (0,0,-1) x1s = x1**2 y1s = y1**2 x2s = x2**2 y2s = y2**2 x3s = x3**2 y3s = y3**2 u = ((x2s+y2s-x1s-y1s)*(y3-y1)-(x3s+y3s-x1s-y1s)*(y2-y1))/(2*p) v = ((x2s+y2s-x1s-y1s)*(x3-x1)-(x3s+y3s-x1s-y1s)*(x2-x1))/(2*p) r = dist(u,v,x1,y1) return (u,v,r) eps = 10**(-13) def fit(u,v,r): for i in range(n): if dist(x[i],y[i],u,v)>r+eps: return False return True n = inn() x = [] y = [] for i in range(n): xx,yy = inm() x.append(xx) y.append(yy) mn = 2000.0 for i in range(n-1): for j in range(i+1,n): u,v,r = do2(x[i],y[i],x[j],y[j]) if r>0 and fit(u,v,r): mn = min(mn,r) for i in range(n-2): for j in range(i+1,n-1): for k in range(j+1,n): u,v,r = do3(x[i],y[i],x[j],y[j],x[k],y[k]) if r>0 and fit(u,v,r): mn = min(mn,r) print(mn)
printn = lambda x: print(x,end='') inn = lambda : int(input()) inl = lambda: list(map(int, input().split())) inm = lambda: map(int, input().split()) ins = lambda : input().strip() DBG = True # and False BIG = 10**18 R = 10**9 + 7 def ddprint(x): if DBG: print(x) import math def dist(xx,yy,u,v): return math.sqrt((xx-u)**2+(yy-v)**2) def do2(x1,y1,x2,y2): return ((x1+x2)/2, (y1+y2)/2, dist(x1,y1,x2,y2)/2) def do3(x1,y1,x2,y2,x3,y3): p = (x2-x1)*(y3-y1)-(x3-x1)*(y2-y1) if p==0: return (0,0,-1) x1s = x1**2 y1s = y1**2 x2s = x2**2 y2s = y2**2 x3s = x3**2 y3s = y3**2 u = ((x2s+y2s-x1s-y1s)*(y3-y1)-(x3s+y3s-x1s-y1s)*(y2-y1))/(2*p) v = -((x2s+y2s-x1s-y1s)*(x3-x1)-(x3s+y3s-x1s-y1s)*(x2-x1))/(2*p) r = dist(u,v,x1,y1) #ddprint(f"f {x1} {y1} {x2} {y2} {x3} {y3} ret {u} {v} {r}") return (u,v,r) eps = 10**(-13) def fit(u,v,r): for i in range(n): if dist(x[i],y[i],u,v)>r+eps: return False return True n = inn() x = [] y = [] for i in range(n): xx,yy = inm() x.append(xx) y.append(yy) mn = 2000.0 for i in range(n-1): for j in range(i+1,n): u,v,r = do2(x[i],y[i],x[j],y[j]) if r>0 and fit(u,v,r): mn = min(mn,r) for i in range(n-2): for j in range(i+1,n-1): for k in range(j+1,n): u,v,r = do3(x[i],y[i],x[j],y[j],x[k],y[k]) if r>0 and fit(u,v,r): mn = min(mn,r) print(mn)
[ "misc.opposites", "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "expression.operation.unary.add" ]
609,832
609,833
u102445737
python
p02805
printn = lambda x: print(x,end='') inn = lambda : int(input()) inl = lambda: list(map(int, input().split())) inm = lambda: map(int, input().split()) ins = lambda : input().strip() DBG = True # and False BIG = 10**18 R = 10**9 + 7 def ddprint(x): if DBG: print(x) import math def dist(xx,yy,u,v): return math.sqrt((xx-u)**2+(yy-v)**2) def do2(x1,y1,x2,y2): return ((x1+x2)/2, (y1+y2)/2, dist(x1,y1,x2,y2)/2) def do3(x1,y1,x2,y2,x3,y3): p = (x2-x1)*(y3-y1)+(x3-x1)*(y2-y1) if p==0: return (0,0,-1) x1s = x1**2 y1s = y1**2 x2s = x2**2 y2s = y2**2 x3s = x3**2 y3s = y3**2 u = ((x2s+y2s-x1s-y1s)*(y3-y1)-(x3s+y3s-x1s-y1s)*(y2-y1))/(2*p) v = ((x2s+y2s-x1s-y1s)*(x3-x1)-(x3s+y3s-x1s-y1s)*(x2-x1))/(2*p) r = dist(u,v,x1,y1) return (u,v,r) eps = 10**(-10) def fit(u,v,r): for i in range(n): if dist(x[i],y[i],u,v)>r+eps: return False return True n = inn() x = [] y = [] for i in range(n): xx,yy = inm() x.append(xx) y.append(yy) mn = 2000.0 for i in range(n-1): for j in range(i+1,n): u,v,r = do2(x[i],y[i],x[j],y[j]) if r>0 and fit(u,v,r): mn = min(mn,r) for i in range(n-2): for j in range(i+1,n-1): for k in range(j+1,n): u,v,r = do3(x[i],y[i],x[j],y[j],x[k],y[k]) if r>0 and fit(u,v,r): mn = min(mn,r) print(mn)
printn = lambda x: print(x,end='') inn = lambda : int(input()) inl = lambda: list(map(int, input().split())) inm = lambda: map(int, input().split()) ins = lambda : input().strip() DBG = True # and False BIG = 10**18 R = 10**9 + 7 def ddprint(x): if DBG: print(x) import math def dist(xx,yy,u,v): return math.sqrt((xx-u)**2+(yy-v)**2) def do2(x1,y1,x2,y2): return ((x1+x2)/2, (y1+y2)/2, dist(x1,y1,x2,y2)/2) def do3(x1,y1,x2,y2,x3,y3): p = (x2-x1)*(y3-y1)-(x3-x1)*(y2-y1) if p==0: return (0,0,-1) x1s = x1**2 y1s = y1**2 x2s = x2**2 y2s = y2**2 x3s = x3**2 y3s = y3**2 u = ((x2s+y2s-x1s-y1s)*(y3-y1)-(x3s+y3s-x1s-y1s)*(y2-y1))/(2*p) v = -((x2s+y2s-x1s-y1s)*(x3-x1)-(x3s+y3s-x1s-y1s)*(x2-x1))/(2*p) r = dist(u,v,x1,y1) #ddprint(f"f {x1} {y1} {x2} {y2} {x3} {y3} ret {u} {v} {r}") return (u,v,r) eps = 10**(-13) def fit(u,v,r): for i in range(n): if dist(x[i],y[i],u,v)>r+eps: return False return True n = inn() x = [] y = [] for i in range(n): xx,yy = inm() x.append(xx) y.append(yy) mn = 2000.0 for i in range(n-1): for j in range(i+1,n): u,v,r = do2(x[i],y[i],x[j],y[j]) if r>0 and fit(u,v,r): mn = min(mn,r) for i in range(n-2): for j in range(i+1,n-1): for k in range(j+1,n): u,v,r = do3(x[i],y[i],x[j],y[j],x[k],y[k]) if r>0 and fit(u,v,r): mn = min(mn,r) print(mn)
[ "misc.opposites", "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "expression.operation.unary.add", "literal.number.integer.change" ]
609,834
609,833
u102445737
python
p02805
import sys input = sys.stdin.readline LOCAL = len(sys.argv) > 1 and sys.argv[1] == 'LOCAL' def dprint(*args): if LOCAL: print(*args) n = int(input()) xy = [list(map(int, input().split())) for _ in range(n)] import math import itertools def distanse(x1, y1, x2, y2): return math.sqrt((x1 - x2)**2 + (y1 - y2)**2) def isValid(ox, oy, r): # global ox, oy, r global xy for x, y in xy: if distanse(x, y, ox, oy) > r: return False return True rs = [] for (x1, y1), (x2, y2) in itertools.combinations(xy, r=2): dprint(x1, y1, x2, y2) r = distanse(x1, y1, x2, y2) / 2 ox = (x1 + x2) / 2 oy = (y1 + y2) / 2 dprint(ox, oy, r) if isValid(ox, oy, r): rs.append(r) # for c1, c2 in itertools.combinations(xy, r=2): # dprint(c1, c2) # r = distanse(c1, c2) # o=(c1+c2)/2 for (x1, y1), (x2, y2), (x3, y3) in itertools.combinations(xy, r=3): a = x1 * (y2 - y3) - y1 * (x2 - x3) + x2 * y3 - x3 * y2 b = (x1**2 + y1**2) * (y3 - y2) + (x2**2 + y2**2) * \ (y1 - y3) + (x3**2 + y3**2) * (y2 - y1) c = (x1**2 + y1**2) * (x2 - x3) + (x2**2 + y2**2) * \ (x3 - x1) + (x3**2 + y3**2) * (x1 - x2) d = (x1 ** 2 + y1 ** 2) * (x3 * y2 - x2 * y3) + (x2 ** 2 + y2 ** 2) * \ (x1 * y3 - x3 * y1) + (x3 ** 2 + y3 ** 2) * (x2 * y1 - x1 * y2) if a == 0: continue ox = -b / (2 * a) oy = -c / (2 * a) r = math.sqrt((b ** 2 + c ** 2 - 4 * a * d) / (4 * a ** 2)) if isValid(ox, oy, r): rs.append(r) dprint(rs) print(min(rs))
import sys input = sys.stdin.readline LOCAL = len(sys.argv) > 1 and sys.argv[1] == 'LOCAL' def dprint(*args): if LOCAL: print(*args) n = int(input()) xy = [list(map(int, input().split())) for _ in range(n)] import math import itertools def distanse(x1, y1, x2, y2): return math.sqrt((x1 - x2)**2 + (y1 - y2)**2) def isValid(ox, oy, r): # global ox, oy, r global xy for x, y in xy: if distanse(x, y, ox, oy) - r > 1e-6: return False return True rs = [] for (x1, y1), (x2, y2) in itertools.combinations(xy, r=2): dprint(x1, y1, x2, y2) r = distanse(x1, y1, x2, y2) / 2 ox = (x1 + x2) / 2 oy = (y1 + y2) / 2 dprint(ox, oy, r) if isValid(ox, oy, r): rs.append(r) # for c1, c2 in itertools.combinations(xy, r=2): # dprint(c1, c2) # r = distanse(c1, c2) # o=(c1+c2)/2 for (x1, y1), (x2, y2), (x3, y3) in itertools.combinations(xy, r=3): # http://www.ambrsoft.com/TrigoCalc/Circle3D.htm a = x1 * (y2 - y3) - y1 * (x2 - x3) + x2 * y3 - x3 * y2 b = (x1**2 + y1**2) * (y3 - y2) + (x2**2 + y2**2) * \ (y1 - y3) + (x3**2 + y3**2) * (y2 - y1) c = (x1**2 + y1**2) * (x2 - x3) + (x2**2 + y2**2) * \ (x3 - x1) + (x3**2 + y3**2) * (x1 - x2) d = (x1 ** 2 + y1 ** 2) * (x3 * y2 - x2 * y3) + (x2 ** 2 + y2 ** 2) * \ (x1 * y3 - x3 * y1) + (x3 ** 2 + y3 ** 2) * (x2 * y1 - x1 * y2) if a == 0: continue ox = -b / (2 * a) oy = -c / (2 * a) r = math.sqrt((b ** 2 + c ** 2 - 4 * a * d) / (4 * a ** 2)) if isValid(ox, oy, r): rs.append(r) dprint(rs) # print('{:.18f}'.format(min(rs))) print(min(rs))
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
609,854
609,855
u530606147
python
p02805
import sys input = sys.stdin.readline LOCAL = len(sys.argv) > 1 and sys.argv[1] == 'LOCAL' def dprint(*args): if LOCAL: print(*args) n = int(input()) xy = [list(map(int, input().split())) for _ in range(n)] import math import itertools def distanse(x1, y1, x2, y2): return math.sqrt((x1 - x2)**2 + (y1 - y2)**2) def isValid(ox, oy, r): # global ox, oy, r global xy for x, y in xy: if distanse(x, y, ox, oy) > r: return False return True rs = [] for (x1, y1), (x2, y2) in itertools.combinations(xy, r=2): dprint(x1, y1, x2, y2) r = distanse(x1, y1, x2, y2) / 2 ox = (x1 + x2) / 2 oy = (y1 + y2) / 2 dprint(ox, oy, r) if isValid(ox, oy, r): rs.append(r) # for c1, c2 in itertools.combinations(xy, r=2): # dprint(c1, c2) # r = distanse(c1, c2) # o=(c1+c2)/2 for (x1, y1), (x2, y2), (x3, y3) in itertools.combinations(xy, r=3): # http://www.ambrsoft.com/TrigoCalc/Circle3D.htm a = x1 * (y2 - y3) - y1 * (x2 - x3) + x2 * y3 - x3 * y2 b = (x1**2 + y1**2) * (y3 - y2) + (x2**2 + y2**2) * \ (y1 - y3) + (x3**2 + y3**2) * (y2 - y1) c = (x1**2 + y1**2) * (x2 - x3) + (x2**2 + y2**2) * \ (x3 - x1) + (x3**2 + y3**2) * (x1 - x2) d = (x1 ** 2 + y1 ** 2) * (x3 * y2 - x2 * y3) + (x2 ** 2 + y2 ** 2) * \ (x1 * y3 - x3 * y1) + (x3 ** 2 + y3 ** 2) * (x2 * y1 - x1 * y2) if a == 0: continue ox = -b / (2 * a) oy = -c / (2 * a) r = math.sqrt((b ** 2 + c ** 2 - 4 * a * d) / (4 * a ** 2)) if isValid(ox, oy, r): rs.append(r) dprint(rs) print('{:.18f}'.format(min(rs)))
import sys input = sys.stdin.readline LOCAL = len(sys.argv) > 1 and sys.argv[1] == 'LOCAL' def dprint(*args): if LOCAL: print(*args) n = int(input()) xy = [list(map(int, input().split())) for _ in range(n)] import math import itertools def distanse(x1, y1, x2, y2): return math.sqrt((x1 - x2)**2 + (y1 - y2)**2) def isValid(ox, oy, r): # global ox, oy, r global xy for x, y in xy: if distanse(x, y, ox, oy) - r > 1e-6: return False return True rs = [] for (x1, y1), (x2, y2) in itertools.combinations(xy, r=2): dprint(x1, y1, x2, y2) r = distanse(x1, y1, x2, y2) / 2 ox = (x1 + x2) / 2 oy = (y1 + y2) / 2 dprint(ox, oy, r) if isValid(ox, oy, r): rs.append(r) # for c1, c2 in itertools.combinations(xy, r=2): # dprint(c1, c2) # r = distanse(c1, c2) # o=(c1+c2)/2 for (x1, y1), (x2, y2), (x3, y3) in itertools.combinations(xy, r=3): # http://www.ambrsoft.com/TrigoCalc/Circle3D.htm a = x1 * (y2 - y3) - y1 * (x2 - x3) + x2 * y3 - x3 * y2 b = (x1**2 + y1**2) * (y3 - y2) + (x2**2 + y2**2) * \ (y1 - y3) + (x3**2 + y3**2) * (y2 - y1) c = (x1**2 + y1**2) * (x2 - x3) + (x2**2 + y2**2) * \ (x3 - x1) + (x3**2 + y3**2) * (x1 - x2) d = (x1 ** 2 + y1 ** 2) * (x3 * y2 - x2 * y3) + (x2 ** 2 + y2 ** 2) * \ (x1 * y3 - x3 * y1) + (x3 ** 2 + y3 ** 2) * (x2 * y1 - x1 * y2) if a == 0: continue ox = -b / (2 * a) oy = -c / (2 * a) r = math.sqrt((b ** 2 + c ** 2 - 4 * a * d) / (4 * a ** 2)) if isValid(ox, oy, r): rs.append(r) dprint(rs) print('{:.18f}'.format(min(rs)))
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
609,856
609,857
u530606147
python
p02805
N=int(input()) X,Y=[0]*N,[0]*N for i in range(N): X[i],Y[i]=map(int,input().split()) def check(a,b,r): if r<0:r=0 res=[0,0,0] flg=True for i in range(N): tmp=(X[i]-a)**2+(Y[i]-b)**2 if tmp>r**2: flg=False if tmp>res[0]: res=[tmp,X[i],Y[i]] res[0]=flg return res x_ave,y_ave=sum(X)/N,sum(Y)/N MIN=10**(-12) r=1500 r_diff=r/2 k=0.5 d=9/10 #print(x_ave,y_ave) while r_diff>MIN: tmpres = check(x_ave,y_ave,r) #print(r,x_ave,y_ave) if tmpres[0]: r-=r_diff else: r+=r_diff x_ave+=(tmpres[1]-x_ave)*k y_ave+=(tmpres[2]-y_ave)*k r_diff=r_diff*d k=k*d print(r)
N=int(input()) X,Y=[0]*N,[0]*N for i in range(N): X[i],Y[i]=map(int,input().split()) def check(a,b,r): if r<0:r=0 res=[0,0,0] flg=True for i in range(N): tmp=(X[i]-a)**2+(Y[i]-b)**2 if tmp>r**2: flg=False if tmp>res[0]: res=[tmp,X[i],Y[i]] res[0]=flg return res x_ave,y_ave=sum(X)/N,sum(Y)/N MIN=10**(-12) r=1500 r_diff=r/2 k=0.5 d=999/1000 #print(x_ave,y_ave) while r_diff>MIN: tmpres = check(x_ave,y_ave,r) #print(r,x_ave,y_ave) if tmpres[0]: r-=r_diff else: r+=r_diff x_ave+=(tmpres[1]-x_ave)*k y_ave+=(tmpres[2]-y_ave)*k r_diff=r_diff*d k=k*d print(r)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
609,881
609,880
u842170774
python
p02805
from itertools import combinations import math import sys read = sys.stdin.read readline = sys.stdin.readline n = int(readline()) m = map(float,read().split()) points = [[x, y] for x, y in zip(m, m)] def center(a, b, c): M = pow(a[0], 2) - pow(b[0], 2) + pow(a[1], 2) - pow(b[1], 2) N = pow(a[0], 2) - pow(c[0], 2) + pow(a[1], 2) - pow(c[1], 2) Yab = a[1] - b[1] Xab = a[0] - b[0] Yac = a[1] - c[1] Xac = a[0] - c[0] d1 = Yac * Xab - Yab * Xac d2 = Xac * Yab - Xab * Yac if d1 == 0 or d2 == 0: return None x = (M * Yac - N * Yab) / (2 * d1) y = (M * Xac - N * Xab) / (2 * d2) return (x, y) centers = [] for a, b, c in combinations(points, 3): cen = center(a, b, c) centers.append(cen) for a, b in combinations(points, 2): cen = ((a[0]+b[0])/2,(a[1]+b[1])/2) centers.append(cen) res = 1000 for cx, cy in centers: r = 0 for x, y in points: tr = math.hypot(x - cx, y - cy) if tr > r: r = tr if r < res: res = r print(res)
from itertools import combinations import math import sys read = sys.stdin.read readline = sys.stdin.readline n = int(readline()) m = map(float,read().split()) points = [[x, y] for x, y in zip(m, m)] def center(a, b, c): M = pow(a[0], 2) - pow(b[0], 2) + pow(a[1], 2) - pow(b[1], 2) N = pow(a[0], 2) - pow(c[0], 2) + pow(a[1], 2) - pow(c[1], 2) Yab = a[1] - b[1] Xab = a[0] - b[0] Yac = a[1] - c[1] Xac = a[0] - c[0] d1 = Yac * Xab - Yab * Xac d2 = Xac * Yab - Xab * Yac if d1 == 0 or d2 == 0: return None x = (M * Yac - N * Yab) / (2 * d1) y = (M * Xac - N * Xab) / (2 * d2) return (x, y) centers = [] for a, b, c in combinations(points, 3): cen = center(a, b, c) if cen is None: continue centers.append(cen) for a, b in combinations(points, 2): cen = ((a[0]+b[0])/2,(a[1]+b[1])/2) centers.append(cen) res = 1000 for cx, cy in centers: r = 0 for x, y in points: tr = math.hypot(x - cx, y - cy) if tr > r: r = tr if r < res: res = r print(res)
[ "control_flow.branch.if.add", "control_flow.continue.add" ]
609,926
609,927
u780475861
python
p02811
k, x = map(int, input()) if (500*k) >= x: print("Yes") else: print("No")
k, x = map(int, input().split()) if (500*k) >= x: print("Yes") else: print("No")
[ "call.add" ]
609,932
609,933
u995163736
python
p02811
K,X=map(int,input().split()) total = K*500 if total > X: print("Yes") else: print("No")
k, x = map(int, input().split()) total = k * 500 if total >= x: print("Yes") else: print("No")
[ "assignment.variable.change", "identifier.change", "assignment.value.change", "expression.operation.binary.change" ]
609,939
609,940
u853728588
python
p02811
K,X=map(int,input().split()) total = K*500 if total > X: print("Yes") else: print("No")
k, x = map(int,input().split()) total = k * 500 if total >= x: print("Yes") else: print("No")
[ "assignment.variable.change", "identifier.change", "assignment.value.change", "expression.operation.binary.change" ]
609,939
609,941
u853728588
python
p02811
K,X = map(int,input().split()) print('Yes' if K * 500 <= X else 'No')
K,X = map(int,input().split()) print('Yes' if K * 500 >= X else 'No')
[ "misc.opposites", "expression.operator.compare.change", "call.arguments.change", "io.output.change" ]
609,946
609,947
u732061897
python
p02811
k,x=map(int,input(),split()) print("Yes" if 500*k>=x else "No")
k,x=map(int,input().split()) print("Yes" if 500*k>=x else "No")
[ "assignment.value.change", "call.arguments.change" ]
609,977
609,978
u021657949
python
p02811
N,X=map(int, input(),split()) print("Yes" if 500*N >= X else "No")
N,X=map(int, input().split()) print("Yes" if 500*N >= X else "No")
[ "assignment.value.change", "call.arguments.change" ]
609,989
609,990
u054825571
python
p02811
k, x = map(int, input().split()) if 500*k >= x: print("yes") exit() else: print("No")
k, x = map(int, input().split()) if 500*k >= x: print("Yes") exit() else: print("No") exit()
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change", "call.add" ]
609,994
609,995
u974485376
python
p02811
K, X = list(map(int, input())) if K * 500 >= X: print('Yes') else: print('No')
K, X = list(map(int, input().split())) if K * 500 >= X: print('Yes') else: print('No')
[ "call.add" ]
610,011
610,012
u967822229
python
p02811
k,x = map(int,input().split()) if k*500 >= X: print('Yes') else: print('No')
k,x = map(int,input().split()) if k*500 >= x: print('Yes') else: print('No')
[ "identifier.change", "control_flow.branch.if.condition.change" ]
610,017
610,018
u855831834
python
p02811
k,x = map(int,input().split()) if k*500 >= X: print('Yes') else: print('No')
k,x = map(int,input().split()) if k*500 >= x: print('Yes') else: print('No')
[ "identifier.change", "control_flow.branch.if.condition.change" ]
610,019
610,018
u855831834
python
p02811
K,X = map(int,input().split()) if K*2>=X: print("Yes") else: print("No")
K,X = map(int,input().split()) if K*500>=X: print("Yes") else: print("No")
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
610,026
610,027
u068862866
python
p02811
k,x=map(int, input().split()) print('Yes' if k*500 > x else 'No')
k,x=map(int, input().split()) print('Yes' if k*500 >= x else 'No')
[ "expression.operator.compare.change", "call.arguments.change", "io.output.change" ]
610,118
610,119
u075303794
python
p02811
k,x=map(int,input().split()) print("No" if k*500<x else "yes")
k, x = map(int, input().split()) print("Yes" if k*500 >= x else "No")
[ "literal.string.change", "call.arguments.change", "io.output.change", "expression.operator.compare.change" ]
610,127
610,128
u896847891
python
p02811
k,x=map(int,input().split()) print("No" if k*500<x else "yes")
k,x=map(int,input().split()) print("No" if k*500<x else "Yes")
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
610,127
610,129
u896847891
python
p02811
K,X = map(int, input().split()) #็ท้ก SUM = 500*X #ๅˆคๅฎš if SUM >= X: print("Yes") else: print("No")
K,X = map(int, input().split()) #็ท้ก SUM = 500*K #ๅˆคๅฎš if SUM >= X: print("Yes") else: print("No")
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change" ]
610,136
610,137
u819663617
python
p02811
K, X = map(int, input().split) a = 500*K if a >= X: print("Yes") else: print("No")
K, X = map(int, input().split()) a = 500*K if a >= X: print("Yes") else: print("No")
[ "call.add" ]
610,146
610,147
u685244071
python
p02811
n.m=map(int,input().split()) if 500*n>=m: print("Yes") else: print("No")
n,m=map(int,input().split()) if 500*n >= m: print("Yes") else: print("No")
[ "misc.typo", "assignment.variable.change" ]
610,148
610,149
u901598613
python
p02811
import sys stdin=sys.stdin ns=lambda:stdin.readline().rstrip() ni=lambda:int(stdin.readline().rstrip()) nm=lambda:map(int,stdin.readline().rstrip()) nl=lambda:list(map(int,stdin,readline().rstrip())) K,X=nm() print('Yes' if X<=500*K else 'No')
import sys stdin = sys.stdin ns = lambda: stdin.readline().rstrip() ni = lambda: int(stdin.readline().rstrip()) nm = lambda: map(int, stdin.readline().split()) nl = lambda: list(map(int, stdin.readline().split())) K,X=nm() print('Yes' if X<=500*K else 'No')
[ "assignment.value.change", "identifier.change", "call.arguments.change" ]
610,174
610,175
u525796732
python
p02811
k,x = map(int, input().split()) print('No' if x*500<x else 'Yes')
k,x = map(int, input().split()) print('No' if k*500<x else 'Yes')
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
610,186
610,187
u725133562
python
p02811
import sys K, X = map(int, sys.stdin.readline().strip().split()) if K * 500 >= X: print('YES') else: print('NO')
import sys K, X = map(int, sys.stdin.readline().strip().split()) if K * 500 >= X: print('Yes') else: print('No')
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
610,188
610,189
u135454978
python
p02811
n, m = map(int, input().split()) if 500 * n > m: print("Yes") else: print("No")
n, m = map(int, input().split()) if 500 * n >= m: print("Yes") else: print("No")
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
610,192
610,193
u671060652
python
p02811
K, X = map(int, input().split()) print('Yes' if K*500 > X else 'No')
K, X = map(int, input().split()) print('Yes' if K*500 >= X else 'No')
[ "expression.operator.compare.change", "call.arguments.change", "io.output.change" ]
610,201
610,202
u821588465
python
p02811
K,X = map(int, input().split()) # N = int(input()) # s = int(input()) # C = int(input()) # s= input() print("Yes" if K * 2 >= X else "No")
K,X = map(int, input().split()) # N = int(input()) # s = int(input()) # C = int(input()) # s= input() print("Yes" if K * 500 >= X else "No")
[ "literal.number.integer.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
610,203
610,204
u027403702
python
p02811
k,x=map(int,input().split()) if (k*500>x): print("Yes") else: print("No")
k,x=map(int,input().split()) if (k*500>=x): print("Yes") else: print("No")
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
610,250
610,251
u877389510
python
p02811
k, x = list(map(int, input().split)) print('Yes') if k *500 <= x else print('No')
k, x = list(map(int, input().split())) print('Yes') if k *500 >= x else print('No')
[ "call.add", "misc.opposites", "expression.operator.compare.change" ]
610,258
610,259
u518929058
python
p02811
import sys K, X = map(int, next(sys.stdin).split()) print('Yes' if K * 500 <= X else 'No')
import sys K, X = map(int, next(sys.stdin).split()) print('Yes' if K * 500 >= X else 'No')
[ "misc.opposites", "expression.operator.compare.change", "call.arguments.change", "io.output.change" ]
610,276
610,277
u317423698
python
p02811
import sys, bisect, math, itertools, string, queue, copy # import numpy as np # import scipy # from collections import Counter,defaultdict,deque # from itertools import permutations, combinations # from heapq import heappop, heappush # # input = sys.stdin.readline # sys.setrecursionlimit(10**8) # mod = 10**9+7 def inp(): return int(input()) def inpm(): return map(int,input().split()) def inpl(): return list(map(int, input().split())) def inpls(): return list(input().split()) def inplm(n): return list(int(input()) for _ in range(n)) def inplL(n): return [list(input()) for _ in range(n)] def inplT(n): return [tuple(input()) for _ in range(n)] def inpll(n): return [list(map(int, input().split())) for _ in range(n)] def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) k, x = inpm() if(500 * k >= k): print('Yes') else: print('No')
import sys, bisect, math, itertools, string, queue, copy # import numpy as np # import scipy # from collections import Counter,defaultdict,deque # from itertools import permutations, combinations # from heapq import heappop, heappush # # input = sys.stdin.readline # sys.setrecursionlimit(10**8) # mod = 10**9+7 def inp(): return int(input()) def inpm(): return map(int,input().split()) def inpl(): return list(map(int, input().split())) def inpls(): return list(input().split()) def inplm(n): return list(int(input()) for _ in range(n)) def inplL(n): return [list(input()) for _ in range(n)] def inplT(n): return [tuple(input()) for _ in range(n)] def inpll(n): return [list(map(int, input().split())) for _ in range(n)] def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) k, x = inpm() if(500 * k >= x): print('Yes') else: print('No')
[ "identifier.change", "control_flow.branch.if.condition.change" ]
610,300
610,301
u773580152
python
p02811
k,x=[int(_) for _ in input().split()] print('Yes' if k*500>x else 'No')
k,x=[int(_) for _ in input().split()] print('Yes' if k*500>=x else 'No')
[ "expression.operator.compare.change", "call.arguments.change", "io.output.change" ]
610,324
610,325
u484229314
python
p02811
k,x = map(int,input().split) print("Yes" if 500*k>=x else "No")
k,x = map(int,input().split()) print("Yes" if 500*k>=x else "No")
[ "call.add" ]
610,328
610,329
u686536081
python
p02811
data = [int(k) for k in input().split()] print(data) takashi = 500 * data[0] if takashi >= data[1]: print('Yes') else: print('No')
data = [int(k) for k in input().split()] takashi = 500 * data[0] if takashi >= data[1]: print('Yes') else: print('No')
[ "call.remove" ]
610,336
610,337
u785354231
python
p02811
data = [int(k) for k in input().split()] takashi = 500 * data[0] if takashi >= data[1]: print('YES') else: print('NO')
data = [int(k) for k in input().split()] takashi = 500 * data[0] if takashi >= data[1]: print('Yes') else: print('No')
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
610,338
610,337
u785354231
python
p02811
data = [int(k) for k in input().split()] takashi = 500 * data[0] if takashi > data[1]: print('YES') else: print('NO')
data = [int(k) for k in input().split()] takashi = 500 * data[0] if takashi >= data[1]: print('Yes') else: print('No')
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
610,339
610,337
u785354231
python
p02811
n, s = map(int, input()) print("Yes" if 500*n >= s else "No")
n, s = map(int, input().split()) print("Yes" if 500*n >= s else "No")
[ "call.add" ]
610,342
610,343
u537818901
python
p02811
K, X = map(int, input().split()) print(["No", "Yes"][K*500>X])
K, X = map(int, input().split()) print(["No", "Yes"][K*500>=X])
[ "expression.operator.compare.change", "variable_access.subscript.index.change", "call.arguments.change", "io.output.change" ]
610,350
610,351
u770944306
python
p02811
K, X = map(int, input().split(" ")) if 500*K>X: print("Yes") else: print("No")
K, X = map(int, input().split(" ")) if 500*K>=X: print("Yes") else: print("No")
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
610,383
610,384
u416258526
python