user_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 1
value | submission_id_v0 stringlengths 10 10 | submission_id_v1 stringlengths 10 10 | cpu_time_v0 int64 10 38.3k | cpu_time_v1 int64 0 24.7k | memory_v0 int64 2.57k 1.02M | memory_v1 int64 2.57k 869k | status_v0 stringclasses 1
value | status_v1 stringclasses 1
value | improvement_frac float64 7.51 100 | input stringlengths 20 4.55k | target stringlengths 17 3.34k | code_v0_loc int64 1 148 | code_v1_loc int64 1 184 | code_v0_num_chars int64 13 4.55k | code_v1_num_chars int64 14 3.34k | code_v0_no_empty_lines stringlengths 21 6.88k | code_v1_no_empty_lines stringlengths 20 4.93k | code_same bool 1
class | relative_loc_diff_percent float64 0 79.8 | diff list | diff_only_import_comment bool 1
class | measured_runtime_v0 float64 0.01 4.45 | measured_runtime_v1 float64 0.01 4.31 | runtime_lift float64 0 359 | key list |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u078042885 | p01741 | python | s676302265 | s199650243 | 40 | 20 | 7,536 | 7,600 | Accepted | Accepted | 50 | import math
n=float(eval(input()))
print((int(n)+1 if n*math.sqrt(2)<int(n)+1 else n*math.sqrt(2))) | n=float(eval(input()))
print((int(n)+1 if n*2**0.5<int(n)+1 else n*2**0.5)) | 3 | 2 | 93 | 68 | import math
n = float(eval(input()))
print((int(n) + 1 if n * math.sqrt(2) < int(n) + 1 else n * math.sqrt(2)))
| n = float(eval(input()))
print((int(n) + 1 if n * 2**0.5 < int(n) + 1 else n * 2**0.5))
| false | 33.333333 | [
"-import math",
"-",
"-print((int(n) + 1 if n * math.sqrt(2) < int(n) + 1 else n * math.sqrt(2)))",
"+print((int(n) + 1 if n * 2**0.5 < int(n) + 1 else n * 2**0.5))"
] | false | 0.070971 | 0.075352 | 0.941852 | [
"s676302265",
"s199650243"
] |
u411858517 | p03290 | python | s040153155 | s641738793 | 52 | 37 | 3,188 | 3,188 | Accepted | Accepted | 28.85 | import itertools
D, G = list(map(int, input().split()))
L = [list(map(int, input().split())) for _ in range(D)]
num = D #生成するビット数
bit_list = list(itertools.product([0, 1], repeat=num))
tmp = 10 ** 6
for bit in bit_list:
count = 0
num = 0
for i in range(D):
if bit[i] == 1:
... | import itertools
def solve(D, G, problems):
bit_list = list(itertools.product([0, 1], repeat=D))
result_count = 10 ** 8
for pattern in bit_list:
score = 0 # スコアの合計
count = 0 # 解いた問題数
for i in range(D):
if pattern[i] == 1: # ビット値が1の難易度の問題は全て解く
... | 34 | 35 | 840 | 1,088 | import itertools
D, G = list(map(int, input().split()))
L = [list(map(int, input().split())) for _ in range(D)]
num = D # 生成するビット数
bit_list = list(itertools.product([0, 1], repeat=num))
tmp = 10**6
for bit in bit_list:
count = 0
num = 0
for i in range(D):
if bit[i] == 1:
count += L[i][... | import itertools
def solve(D, G, problems):
bit_list = list(itertools.product([0, 1], repeat=D))
result_count = 10**8
for pattern in bit_list:
score = 0 # スコアの合計
count = 0 # 解いた問題数
for i in range(D):
if pattern[i] == 1: # ビット値が1の難易度の問題は全て解く
score += (... | false | 2.857143 | [
"-D, G = list(map(int, input().split()))",
"-L = [list(map(int, input().split())) for _ in range(D)]",
"-num = D # 生成するビット数",
"-bit_list = list(itertools.product([0, 1], repeat=num))",
"-tmp = 10**6",
"-for bit in bit_list:",
"- count = 0",
"- num = 0",
"- for i in range(D):",
"- ... | false | 0.037761 | 0.039442 | 0.957377 | [
"s040153155",
"s641738793"
] |
u873134970 | p02971 | python | s495096499 | s249678483 | 667 | 535 | 23,232 | 15,548 | Accepted | Accepted | 19.79 | import numpy as np
n=int(eval(input()))
a=[int(eval(input())) for i in range(n)]
a_=sorted(a)
m=max(a)
for i in range(n):
if a[i]!=m:
print(m)
else:
print((a_[-2])) |
n=int(eval(input()))
a=[int(eval(input())) for i in range(n)]
a_=sorted(a)
m=a_[-1]
for i in range(n):
if a[i]!=m:
print(m)
else:
print((a_[-2])) | 10 | 10 | 171 | 153 | import numpy as np
n = int(eval(input()))
a = [int(eval(input())) for i in range(n)]
a_ = sorted(a)
m = max(a)
for i in range(n):
if a[i] != m:
print(m)
else:
print((a_[-2]))
| n = int(eval(input()))
a = [int(eval(input())) for i in range(n)]
a_ = sorted(a)
m = a_[-1]
for i in range(n):
if a[i] != m:
print(m)
else:
print((a_[-2]))
| false | 0 | [
"-import numpy as np",
"-",
"-m = max(a)",
"+m = a_[-1]"
] | false | 0.047639 | 0.046999 | 1.013629 | [
"s495096499",
"s249678483"
] |
u562935282 | p02603 | python | s483918067 | s025695484 | 34 | 26 | 9,028 | 9,128 | Accepted | Accepted | 23.53 | def main():
N = int(eval(input()))
*A, = list(map(int, input().split()))
money = 1000
low = A[0]
p = A[0]
for x in A:
if p > x:
money += (p - low) * (money // low)
low = x
p = x
money += (p - low) * (money // low)
print(money)
... | def main():
_ = int(eval(input()))
*A, = list(map(int, input().split()))
A += [0]
money = 1000
stock = 0
for a, b in zip(A, A[1:]):
money += stock * a
stock = 0
if a < b:
buy, rest = divmod(money, a)
stock = buy
money = re... | 21 | 19 | 351 | 373 | def main():
N = int(eval(input()))
(*A,) = list(map(int, input().split()))
money = 1000
low = A[0]
p = A[0]
for x in A:
if p > x:
money += (p - low) * (money // low)
low = x
p = x
money += (p - low) * (money // low)
print(money)
if __name__ == "_... | def main():
_ = int(eval(input()))
(*A,) = list(map(int, input().split()))
A += [0]
money = 1000
stock = 0
for a, b in zip(A, A[1:]):
money += stock * a
stock = 0
if a < b:
buy, rest = divmod(money, a)
stock = buy
money = rest
print... | false | 9.52381 | [
"- N = int(eval(input()))",
"+ _ = int(eval(input()))",
"+ A += [0]",
"- low = A[0]",
"- p = A[0]",
"- for x in A:",
"- if p > x:",
"- money += (p - low) * (money // low)",
"- low = x",
"- p = x",
"- money += (p - low) * (money // low)",
... | false | 0.045118 | 0.045251 | 0.99705 | [
"s483918067",
"s025695484"
] |
u539281377 | p02707 | python | s477204476 | s210742543 | 162 | 132 | 32,364 | 25,984 | Accepted | Accepted | 18.52 | N=int(eval(input()))
A=list(map(int,input().split()))
P=[0]*N
for i in range(N-1):
P[A[i]-1]+=1
for i in range(N):
print((P[i]))
| N=int(eval(input()))
n=[0]*N
for i in input().split():
n[int(i)-1]+=1
print((*n)) | 7 | 5 | 135 | 81 | N = int(eval(input()))
A = list(map(int, input().split()))
P = [0] * N
for i in range(N - 1):
P[A[i] - 1] += 1
for i in range(N):
print((P[i]))
| N = int(eval(input()))
n = [0] * N
for i in input().split():
n[int(i) - 1] += 1
print((*n))
| false | 28.571429 | [
"-A = list(map(int, input().split()))",
"-P = [0] * N",
"-for i in range(N - 1):",
"- P[A[i] - 1] += 1",
"-for i in range(N):",
"- print((P[i]))",
"+n = [0] * N",
"+for i in input().split():",
"+ n[int(i) - 1] += 1",
"+print((*n))"
] | false | 0.048141 | 0.045602 | 1.055679 | [
"s477204476",
"s210742543"
] |
u102278909 | p02843 | python | s515824316 | s461433734 | 265 | 211 | 65,284 | 43,504 | Accepted | Accepted | 20.38 | # coding: utf-8
import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : retu... | # coding: utf-8
import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : retu... | 46 | 27 | 1,245 | 855 | # coding: utf-8
import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10**10
MOD = 10**9 + 7
def input():
return sys.stdin.readline().strip()
def gcd(x, y):
return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y):
return (x * y) // gcd(x, y)
def I():
... | # coding: utf-8
import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10**10
MOD = 10**9 + 7
def input():
return sys.stdin.readline().strip()
def gcd(x, y):
return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y):
return (x * y) // gcd(x, y)
def I():
... | false | 41.304348 | [
"-K = I()",
"-N = 6",
"-a = [100, 101, 102, 103, 104, 105]",
"-m = [1000000 for i in range(N)]",
"-# initialize",
"-dp = [0 if i == 0 else -1 for i in range(K + 1)]",
"-# DP",
"-for i in range(N):",
"- dp_tmp = []",
"- for j in range(K + 1):",
"- if dp[j] >= 0:",
"- dp_... | false | 0.056153 | 0.062666 | 0.89607 | [
"s515824316",
"s461433734"
] |
u761320129 | p03345 | python | s890685284 | s894757833 | 20 | 18 | 3,316 | 2,940 | Accepted | Accepted | 10 | A,B,C,K = list(map(int,input().split()))
print((B-A if K%2 else A-B))
| A,B,C,K = list(map(int,input().split()))
if K%2:
print((B-A))
else:
print((A-B)) | 3 | 5 | 65 | 82 | A, B, C, K = list(map(int, input().split()))
print((B - A if K % 2 else A - B))
| A, B, C, K = list(map(int, input().split()))
if K % 2:
print((B - A))
else:
print((A - B))
| false | 40 | [
"-print((B - A if K % 2 else A - B))",
"+if K % 2:",
"+ print((B - A))",
"+else:",
"+ print((A - B))"
] | false | 0.229666 | 0.105363 | 2.179759 | [
"s890685284",
"s894757833"
] |
u773265208 | p02948 | python | s253018696 | s910244670 | 553 | 511 | 34,152 | 18,352 | Accepted | Accepted | 7.59 | import sys
import heapq
s = sys.stdin.readlines()
n,m = list(map(int,s[0].split()))
a = []
b = []
l = []
ans = 0
count = 0
for i in range(1,n+1):
a_dash,b_dash = list(map(int,s[i].split()))
a.append(-a_dash)
b.append(-b_dash)
c = list(zip(a,b))
c = sorted(c,reverse=True)
a,b = list(zip(*c))
a_l... | n,m = list(map(int,input().split()))
ab = [[] for _ in range(10**5)]
for i in range(n):
a,b = list(map(int,input().split()))
a -= 1
ab[a].append(b)
import heapq
q = []
heapq.heapify(q)
ans = 0
for i in range(m):
if len(ab[i]) != 0:
for j in range(len(ab[i])):
heapq.heappush(q,-1*ab[i][j])
... | 33 | 21 | 541 | 370 | import sys
import heapq
s = sys.stdin.readlines()
n, m = list(map(int, s[0].split()))
a = []
b = []
l = []
ans = 0
count = 0
for i in range(1, n + 1):
a_dash, b_dash = list(map(int, s[i].split()))
a.append(-a_dash)
b.append(-b_dash)
c = list(zip(a, b))
c = sorted(c, reverse=True)
a, b = list(zip(*c))
a_len... | n, m = list(map(int, input().split()))
ab = [[] for _ in range(10**5)]
for i in range(n):
a, b = list(map(int, input().split()))
a -= 1
ab[a].append(b)
import heapq
q = []
heapq.heapify(q)
ans = 0
for i in range(m):
if len(ab[i]) != 0:
for j in range(len(ab[i])):
heapq.heappush(q, -... | false | 36.363636 | [
"-import sys",
"+n, m = list(map(int, input().split()))",
"+ab = [[] for _ in range(10**5)]",
"+for i in range(n):",
"+ a, b = list(map(int, input().split()))",
"+ a -= 1",
"+ ab[a].append(b)",
"-s = sys.stdin.readlines()",
"-n, m = list(map(int, s[0].split()))",
"-a = []",
"-b = []",
... | false | 0.046411 | 0.088366 | 0.525209 | [
"s253018696",
"s910244670"
] |
u912237403 | p00018 | python | s264784654 | s493104511 | 20 | 10 | 4,188 | 4,188 | Accepted | Accepted | 50 | for e in sorted(map(int,input().split()))[::-1]:
print(e, end=' ') | x=sorted(map(int,input().split()))[::-1]
for e in x:
print(e, end=' ') | 2 | 3 | 66 | 71 | for e in sorted(map(int, input().split()))[::-1]:
print(e, end=" ")
| x = sorted(map(int, input().split()))[::-1]
for e in x:
print(e, end=" ")
| false | 33.333333 | [
"-for e in sorted(map(int, input().split()))[::-1]:",
"+x = sorted(map(int, input().split()))[::-1]",
"+for e in x:"
] | false | 0.084752 | 0.128972 | 0.657136 | [
"s264784654",
"s493104511"
] |
u411203878 | p02996 | python | s613103816 | s348473677 | 1,179 | 591 | 89,176 | 114,808 | Accepted | Accepted | 49.87 | n=int(eval(input()))
ab = []
for _ in range(n):
a, b = (int(x) for x in input().split())
ab.append([a, b])
ab = sorted(ab, key=lambda x: x[1])
limit = 0
for i, j in ab:
limit += i
if j < limit:
print('No')
exit()
print('Yes') | n=int(eval(input()))
ab = []
for _ in range(n):
a, b = (int(x) for x in input().split())
ab.append([a, b])
ab = sorted(ab, key=lambda x: x[1])
memo = 0
flag = True
for a,b in ab:
memo += a
if b < memo:
flag = False
break
if flag:
print('Yes')
else:
print('No') | 15 | 18 | 267 | 312 | n = int(eval(input()))
ab = []
for _ in range(n):
a, b = (int(x) for x in input().split())
ab.append([a, b])
ab = sorted(ab, key=lambda x: x[1])
limit = 0
for i, j in ab:
limit += i
if j < limit:
print("No")
exit()
print("Yes")
| n = int(eval(input()))
ab = []
for _ in range(n):
a, b = (int(x) for x in input().split())
ab.append([a, b])
ab = sorted(ab, key=lambda x: x[1])
memo = 0
flag = True
for a, b in ab:
memo += a
if b < memo:
flag = False
break
if flag:
print("Yes")
else:
print("No")
| false | 16.666667 | [
"-limit = 0",
"-for i, j in ab:",
"- limit += i",
"- if j < limit:",
"- print(\"No\")",
"- exit()",
"-print(\"Yes\")",
"+memo = 0",
"+flag = True",
"+for a, b in ab:",
"+ memo += a",
"+ if b < memo:",
"+ flag = False",
"+ break",
"+if flag:",
"+ ... | false | 0.068805 | 0.068451 | 1.00517 | [
"s613103816",
"s348473677"
] |
u718706790 | p02784 | python | s327286485 | s661489985 | 87 | 41 | 13,964 | 13,964 | Accepted | Accepted | 52.87 | h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=True)
sum = 0
for i in a:
sum += i
if sum >= h:
print('Yes')
exit()
print('No') | h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
if h - sum(a) <= 0:
print('Yes')
else:
print('No') | 13 | 7 | 190 | 130 | h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=True)
sum = 0
for i in a:
sum += i
if sum >= h:
print("Yes")
exit()
print("No")
| h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
if h - sum(a) <= 0:
print("Yes")
else:
print("No")
| false | 46.153846 | [
"-a.sort(reverse=True)",
"-sum = 0",
"-for i in a:",
"- sum += i",
"- if sum >= h:",
"- print(\"Yes\")",
"- exit()",
"-print(\"No\")",
"+if h - sum(a) <= 0:",
"+ print(\"Yes\")",
"+else:",
"+ print(\"No\")"
] | false | 0.037684 | 0.046056 | 0.818212 | [
"s327286485",
"s661489985"
] |
u280853184 | p02898 | python | s393774178 | s737287134 | 62 | 55 | 9,232 | 9,232 | Accepted | Accepted | 11.29 | N,K = list(map(int,input().split()))
h = list(map(int,input().split()))
ans = 0
for i in h:
if i >= K:
ans = ans + 1
print(ans) | N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
ans = 0
for i in A:
if i>=K:
ans = ans + 1
print(ans) | 9 | 7 | 144 | 132 | N, K = list(map(int, input().split()))
h = list(map(int, input().split()))
ans = 0
for i in h:
if i >= K:
ans = ans + 1
print(ans)
| N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
ans = 0
for i in A:
if i >= K:
ans = ans + 1
print(ans)
| false | 22.222222 | [
"-h = list(map(int, input().split()))",
"+A = list(map(int, input().split()))",
"-for i in h:",
"+for i in A:"
] | false | 0.034943 | 0.035338 | 0.988812 | [
"s393774178",
"s737287134"
] |
u312025627 | p02850 | python | s787527086 | s067772487 | 404 | 372 | 97,812 | 92,584 | Accepted | Accepted | 7.92 | def main():
N = int(eval(input()))
G = [[] for _ in range(N)]
edge = [-1] * (N-1)
for i in range(N-1):
a, b = (int(i)-1 for i in input().split())
G[a].append((b, i))
G[b].append((a, i))
max_deg = max(len(G[i]) for i in range(N))
from collections import deque
... | def main():
N = int(eval(input()))
G = [[] for _ in range(N)]
edge = [-1] * (N-1)
for i in range(N-1):
a, b = (int(i)-1 for i in input().split())
G[a].append(b*N + i)
G[b].append(a*N + i)
max_deg = max(len(G[i]) for i in range(N))
from collections import dequ... | 43 | 45 | 998 | 1,068 | def main():
N = int(eval(input()))
G = [[] for _ in range(N)]
edge = [-1] * (N - 1)
for i in range(N - 1):
a, b = (int(i) - 1 for i in input().split())
G[a].append((b, i))
G[b].append((a, i))
max_deg = max(len(G[i]) for i in range(N))
from collections import deque
de... | def main():
N = int(eval(input()))
G = [[] for _ in range(N)]
edge = [-1] * (N - 1)
for i in range(N - 1):
a, b = (int(i) - 1 for i in input().split())
G[a].append(b * N + i)
G[b].append(a * N + i)
max_deg = max(len(G[i]) for i in range(N))
from collections import deque
... | false | 4.444444 | [
"- G[a].append((b, i))",
"- G[b].append((a, i))",
"+ G[a].append(b * N + i)",
"+ G[b].append(a * N + i)",
"- for (v, i) in G[pos]:",
"+ for vi in G[pos]:",
"+ v, i = divmod(vi, N)",
"- for (v, i) in G[pos]:",
"+ f... | false | 0.042606 | 0.007779 | 5.477148 | [
"s787527086",
"s067772487"
] |
u644907318 | p02866 | python | s862829929 | s746274505 | 235 | 151 | 62,252 | 93,040 | Accepted | Accepted | 35.74 | INFTY = 998244353
N = int(eval(input()))
D = list(map(int,input().split()))
C = {}
dmax = 0
for i in range(N):
d = D[i]
dmax = max(dmax,d)
if d not in C:
C[d] = 0
C[d] += 1
if D[0]!=0 or C[0]!=1:
flag = 1
else:
flag = 0
for i in range(dmax+1):
if i not in C:
... | p=998244353
def pow(x,m):
if m==0:
return 1
if m==1:
return x
if m%2==0:
return (pow(x,m//2)**2)%p
else:
return (x*(pow(x,(m-1)//2)**2)%p)%p
N = int(eval(input()))
D = list(map(int,input().split()))
D.insert(0,0)
C = {i:0 for i in range(N)}
for i in range(1,... | 27 | 41 | 503 | 901 | INFTY = 998244353
N = int(eval(input()))
D = list(map(int, input().split()))
C = {}
dmax = 0
for i in range(N):
d = D[i]
dmax = max(dmax, d)
if d not in C:
C[d] = 0
C[d] += 1
if D[0] != 0 or C[0] != 1:
flag = 1
else:
flag = 0
for i in range(dmax + 1):
if i not in C:
... | p = 998244353
def pow(x, m):
if m == 0:
return 1
if m == 1:
return x
if m % 2 == 0:
return (pow(x, m // 2) ** 2) % p
else:
return (x * (pow(x, (m - 1) // 2) ** 2) % p) % p
N = int(eval(input()))
D = list(map(int, input().split()))
D.insert(0, 0)
C = {i: 0 for i in ran... | false | 34.146341 | [
"-INFTY = 998244353",
"+p = 998244353",
"+",
"+",
"+def pow(x, m):",
"+ if m == 0:",
"+ return 1",
"+ if m == 1:",
"+ return x",
"+ if m % 2 == 0:",
"+ return (pow(x, m // 2) ** 2) % p",
"+ else:",
"+ return (x * (pow(x, (m - 1) // 2) ** 2) % p) % p",
... | false | 0.039398 | 0.061042 | 0.645427 | [
"s862829929",
"s746274505"
] |
u762540523 | p02662 | python | s697547727 | s696342462 | 179 | 159 | 68,316 | 68,232 | Accepted | Accepted | 11.17 | def resolve():
n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 998244353
dp = [0] * (s + 1)
dp[0] = 1
for i in a:
for j in range(s - i, -1, -1):
dp[j + i] = dp[j + i] * 2 + dp[j]
dp[j + i] %= mod
for j in range(mi... | def resolve():
n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 998244353
modinv = pow(2, mod - 2, mod)
dp = [0] * (s + 1)
dp[0] = pow(2, n, mod)
for i in a:
for j in range(s - i, -1, -1):
dp[j + i] += dp[j] * modinv
d... | 18 | 16 | 444 | 396 | def resolve():
n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 998244353
dp = [0] * (s + 1)
dp[0] = 1
for i in a:
for j in range(s - i, -1, -1):
dp[j + i] = dp[j + i] * 2 + dp[j]
dp[j + i] %= mod
for j in range(min(i, s + 1... | def resolve():
n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 998244353
modinv = pow(2, mod - 2, mod)
dp = [0] * (s + 1)
dp[0] = pow(2, n, mod)
for i in a:
for j in range(s - i, -1, -1):
dp[j + i] += dp[j] * modinv
dp[j + i] %... | false | 11.111111 | [
"+ modinv = pow(2, mod - 2, mod)",
"- dp[0] = 1",
"+ dp[0] = pow(2, n, mod)",
"- dp[j + i] = dp[j + i] * 2 + dp[j]",
"+ dp[j + i] += dp[j] * modinv",
"- for j in range(min(i, s + 1)):",
"- dp[j] *= 2",
"- dp[j] %= mod"
] | false | 0.006928 | 0.103234 | 0.067114 | [
"s697547727",
"s696342462"
] |
u796942881 | p03262 | python | s700811330 | s307579296 | 92 | 81 | 16,224 | 14,548 | Accepted | Accepted | 11.96 | from sys import stdin
from functools import reduce
# バージョン 3.4.X 以前
import fractions
# バージョン 3.4.X より 後
# import math
input = stdin.readline
N, X = list(map(int, input().split()))
xn = [abs(X - int(i)) for i in input().split()]
def main():
print((reduce(fractions.gcd, xn)))
return
main... | from functools import reduce
def gcd(a, b):
while b:
a, b = b, a % b
return a
def gcd_n(numbers):
return reduce(gcd, numbers)
def main():
N, X, *x = list(map(int, open(0).read().split()))
x = [abs(X - int(i)) for i in x]
print((gcd_n(x)))
return
main()
| 20 | 21 | 315 | 309 | from sys import stdin
from functools import reduce
# バージョン 3.4.X 以前
import fractions
# バージョン 3.4.X より 後
# import math
input = stdin.readline
N, X = list(map(int, input().split()))
xn = [abs(X - int(i)) for i in input().split()]
def main():
print((reduce(fractions.gcd, xn)))
return
main()
| from functools import reduce
def gcd(a, b):
while b:
a, b = b, a % b
return a
def gcd_n(numbers):
return reduce(gcd, numbers)
def main():
N, X, *x = list(map(int, open(0).read().split()))
x = [abs(X - int(i)) for i in x]
print((gcd_n(x)))
return
main()
| false | 4.761905 | [
"-from sys import stdin",
"-# バージョン 3.4.X 以前",
"-import fractions",
"-# バージョン 3.4.X より 後",
"-# import math",
"-input = stdin.readline",
"-N, X = list(map(int, input().split()))",
"-xn = [abs(X - int(i)) for i in input().split()]",
"+def gcd(a, b):",
"+ while b:",
"+ a, b = b, a % b",
... | false | 0.049813 | 0.046463 | 1.072106 | [
"s700811330",
"s307579296"
] |
u738898077 | p02785 | python | s351461402 | s509435662 | 198 | 153 | 25,740 | 26,016 | Accepted | Accepted | 22.73 | import math
n,k = list(map(int,input().split()))
als = list(map(int,input().split()))
als.sort(reverse=1)
ans = 0
for i in range(k,n):
ans += als[i]
print(ans)
| n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
a.sort(reverse=1)
print((sum(a[k:])))
| 9 | 4 | 167 | 105 | import math
n, k = list(map(int, input().split()))
als = list(map(int, input().split()))
als.sort(reverse=1)
ans = 0
for i in range(k, n):
ans += als[i]
print(ans)
| n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=1)
print((sum(a[k:])))
| false | 55.555556 | [
"-import math",
"-",
"-als = list(map(int, input().split()))",
"-als.sort(reverse=1)",
"-ans = 0",
"-for i in range(k, n):",
"- ans += als[i]",
"-print(ans)",
"+a = list(map(int, input().split()))",
"+a.sort(reverse=1)",
"+print((sum(a[k:])))"
] | false | 0.04611 | 0.043412 | 1.062166 | [
"s351461402",
"s509435662"
] |
u569960318 | p02401 | python | s262693904 | s066781681 | 30 | 20 | 7,664 | 7,604 | Accepted | Accepted | 33.33 | while True:
a,op,b=input().split()
if op=='?': break
elif op=='+': print(( int(a) + int(b) ))
elif op=='-': print(( int(a) - int(b) ))
elif op=='*': print(( int(a) * int(b) ))
elif op=='/': print(( int(a) // int(b) )) | while True:
a,op,b=input().split()
if op=='?': break
eval("print( int(int(a) {0} int(b)) )".format(op)) | 7 | 4 | 242 | 118 | while True:
a, op, b = input().split()
if op == "?":
break
elif op == "+":
print((int(a) + int(b)))
elif op == "-":
print((int(a) - int(b)))
elif op == "*":
print((int(a) * int(b)))
elif op == "/":
print((int(a) // int(b)))
| while True:
a, op, b = input().split()
if op == "?":
break
eval("print( int(int(a) {0} int(b)) )".format(op))
| false | 42.857143 | [
"- elif op == \"+\":",
"- print((int(a) + int(b)))",
"- elif op == \"-\":",
"- print((int(a) - int(b)))",
"- elif op == \"*\":",
"- print((int(a) * int(b)))",
"- elif op == \"/\":",
"- print((int(a) // int(b)))",
"+ eval(\"print( int(int(a) {0} int(b)) )\".... | false | 0.047531 | 0.044175 | 1.075982 | [
"s262693904",
"s066781681"
] |
u488178971 | p03478 | python | s662556457 | s141692804 | 46 | 33 | 3,060 | 2,940 | Accepted | Accepted | 28.26 | #083 B
N,A,B =list(map(int,input().split()))
ans = 0
for i in range(N+1):
tmp=0
for j in range(len(str(i))):
tmp+=int(str(i)[j])
if A<=tmp<=B:
ans +=i
print(ans) | # B - Some Sums
N,A,B= list(map(int,input().split()))
cnt = 0
for n in range(1,N+1):
tmp = sum([int(i) for i in str(n)])
if A<=tmp and tmp <= B:
cnt+=n
print(cnt) | 11 | 8 | 194 | 179 | # 083 B
N, A, B = list(map(int, input().split()))
ans = 0
for i in range(N + 1):
tmp = 0
for j in range(len(str(i))):
tmp += int(str(i)[j])
if A <= tmp <= B:
ans += i
print(ans)
| # B - Some Sums
N, A, B = list(map(int, input().split()))
cnt = 0
for n in range(1, N + 1):
tmp = sum([int(i) for i in str(n)])
if A <= tmp and tmp <= B:
cnt += n
print(cnt)
| false | 27.272727 | [
"-# 083 B",
"+# B - Some Sums",
"-ans = 0",
"-for i in range(N + 1):",
"- tmp = 0",
"- for j in range(len(str(i))):",
"- tmp += int(str(i)[j])",
"- if A <= tmp <= B:",
"- ans += i",
"-print(ans)",
"+cnt = 0",
"+for n in range(1, N + 1):",
"+ tmp = sum([int(i) for i ... | false | 0.049053 | 0.085188 | 0.575823 | [
"s662556457",
"s141692804"
] |
u616169109 | p02947 | python | s177056088 | s220240743 | 1,921 | 335 | 98,464 | 19,472 | Accepted | Accepted | 82.56 | import collections
import sys
N = int(eval(input()))
s = [sorted(collections.Counter(sys.stdin.readline().rstrip()).items()) for _ in range(N)]
counted = {}
for s_count in s:
if str(s_count) not in counted:
counted[str(s_count)] = 1
else:
counted[str(s_count)] += 1
count = 0 ... | n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
for i in range(n):
s[i] = ''.join(sorted(s[i]))
t = {}
for i in range(n):
if s[i] in t:
t[s[i]] += 1
else:
t[s[i]] = 1
print((sum(t[k] * (t[k] -1) // 2 for k in t))) | 19 | 11 | 406 | 236 | import collections
import sys
N = int(eval(input()))
s = [
sorted(collections.Counter(sys.stdin.readline().rstrip()).items()) for _ in range(N)
]
counted = {}
for s_count in s:
if str(s_count) not in counted:
counted[str(s_count)] = 1
else:
counted[str(s_count)] += 1
count = 0
for n in list... | n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
for i in range(n):
s[i] = "".join(sorted(s[i]))
t = {}
for i in range(n):
if s[i] in t:
t[s[i]] += 1
else:
t[s[i]] = 1
print((sum(t[k] * (t[k] - 1) // 2 for k in t)))
| false | 42.105263 | [
"-import collections",
"-import sys",
"-",
"-N = int(eval(input()))",
"-s = [",
"- sorted(collections.Counter(sys.stdin.readline().rstrip()).items()) for _ in range(N)",
"-]",
"-counted = {}",
"-for s_count in s:",
"- if str(s_count) not in counted:",
"- counted[str(s_count)] = 1",
... | false | 0.099154 | 0.097639 | 1.015516 | [
"s177056088",
"s220240743"
] |
u021763820 | p03835 | python | s241464402 | s872881942 | 1,845 | 1,483 | 2,940 | 2,940 | Accepted | Accepted | 19.62 | # -*- coding: utf-8 -*-
K, S = list(map(int, input().split()))
cnt = 0
for X in range(0, K+1):
for Y in range(0, K+1):
if 0<=S-X-Y and S-X-Y<=K:
cnt += 1
print(cnt) | # -*- coding: utf-8 -*-
k, s = list(map(int,input().split()))
cnt = 0
for x in range(k + 1):
for y in range(k + 1):
z = s - x - y
if (0 <= z <= k):
cnt += 1
print(cnt) | 10 | 9 | 215 | 202 | # -*- coding: utf-8 -*-
K, S = list(map(int, input().split()))
cnt = 0
for X in range(0, K + 1):
for Y in range(0, K + 1):
if 0 <= S - X - Y and S - X - Y <= K:
cnt += 1
print(cnt)
| # -*- coding: utf-8 -*-
k, s = list(map(int, input().split()))
cnt = 0
for x in range(k + 1):
for y in range(k + 1):
z = s - x - y
if 0 <= z <= k:
cnt += 1
print(cnt)
| false | 10 | [
"-K, S = list(map(int, input().split()))",
"+k, s = list(map(int, input().split()))",
"-for X in range(0, K + 1):",
"- for Y in range(0, K + 1):",
"- if 0 <= S - X - Y and S - X - Y <= K:",
"+for x in range(k + 1):",
"+ for y in range(k + 1):",
"+ z = s - x - y",
"+ if 0 <... | false | 0.082834 | 0.04325 | 1.915218 | [
"s241464402",
"s872881942"
] |
u924691798 | p02861 | python | s334937628 | s697772961 | 257 | 81 | 9,132 | 73,812 | Accepted | Accepted | 68.48 | import itertools
import math
N = int(eval(input()))
XY = [tuple(map(int, input().split())) for _ in range(N)]
cnt = 0
tot = 0
for arr in itertools.permutations(list(range(N))):
now = XY[arr[0]]
cnt += 1
for i in arr[1:]:
nex = XY[i]
tot += math.sqrt(pow(now[0]-nex[0], 2)+pow(now... | import itertools
import math
N = int(eval(input()))
XY = [tuple(map(int, input().split())) for _ in range(N)]
cnt = 0
tot = 0
for ptn in itertools.permutations(XY):
now = ptn[0]
cnt += 1
for nex in ptn[1:]:
tot += math.sqrt(pow(now[0]-nex[0], 2)+pow(now[1]-nex[1], 2))
now = nex
... | 14 | 14 | 340 | 330 | import itertools
import math
N = int(eval(input()))
XY = [tuple(map(int, input().split())) for _ in range(N)]
cnt = 0
tot = 0
for arr in itertools.permutations(list(range(N))):
now = XY[arr[0]]
cnt += 1
for i in arr[1:]:
nex = XY[i]
tot += math.sqrt(pow(now[0] - nex[0], 2) + pow(now[1] - ne... | import itertools
import math
N = int(eval(input()))
XY = [tuple(map(int, input().split())) for _ in range(N)]
cnt = 0
tot = 0
for ptn in itertools.permutations(XY):
now = ptn[0]
cnt += 1
for nex in ptn[1:]:
tot += math.sqrt(pow(now[0] - nex[0], 2) + pow(now[1] - nex[1], 2))
now = nex
print(... | false | 0 | [
"-for arr in itertools.permutations(list(range(N))):",
"- now = XY[arr[0]]",
"+for ptn in itertools.permutations(XY):",
"+ now = ptn[0]",
"- for i in arr[1:]:",
"- nex = XY[i]",
"+ for nex in ptn[1:]:",
"+ now = nex"
] | false | 0.008878 | 0.039483 | 0.224845 | [
"s334937628",
"s697772961"
] |
u385244248 | p02948 | python | s149585078 | s285972829 | 1,014 | 519 | 73,176 | 17,804 | Accepted | Accepted | 48.82 | import heapq
N,M = list(map(int,input().split()))
l = [tuple(map(int,input().split())) for _ in range(N)]
l = sorted(l,reverse=True)
heap = []
ans = 0
for i in range(1,M+1):
while l and l[-1][0] == i:
heapq.heappush(heap, (l.pop()[1]*(-1)))
if heap :
ans -= (heapq.heapp... | import heapq
N,M = list(map(int,input().split()))
l = [tuple(map(int,input().split())) for _ in range(N)]
l = sorted(l,reverse=True)
heap = []
ans = 0
for i in range(1,M+1):
while l and l[-1][0] == i:
heapq.heappush(heap, -(l.pop()[1]))
if heap :
ans -= (heapq.heappop(h... | 12 | 15 | 336 | 338 | import heapq
N, M = list(map(int, input().split()))
l = [tuple(map(int, input().split())) for _ in range(N)]
l = sorted(l, reverse=True)
heap = []
ans = 0
for i in range(1, M + 1):
while l and l[-1][0] == i:
heapq.heappush(heap, (l.pop()[1] * (-1)))
if heap:
ans -= heapq.heappop(heap)
print(ans... | import heapq
N, M = list(map(int, input().split()))
l = [tuple(map(int, input().split())) for _ in range(N)]
l = sorted(l, reverse=True)
heap = []
ans = 0
for i in range(1, M + 1):
while l and l[-1][0] == i:
heapq.heappush(heap, -(l.pop()[1]))
if heap:
ans -= heapq.heappop(heap)
print(ans)
| false | 20 | [
"- heapq.heappush(heap, (l.pop()[1] * (-1)))",
"+ heapq.heappush(heap, -(l.pop()[1]))"
] | false | 0.046596 | 0.089612 | 0.519978 | [
"s149585078",
"s285972829"
] |
u223663729 | p04025 | python | s329655850 | s577218012 | 171 | 21 | 39,024 | 3,064 | Accepted | Accepted | 87.72 | # AtCoder Regular Contest 059
# C - いっしょ
# https://atcoder.jp/contests/arc059/tasks/arc059_a
N = int(eval(input()))
*A, = list(map(int, input().split()))
mincost = 10**10
for i in range(-100, 101):
cost = 0
for a in A:
cost += (a-i)*(a-i)
if cost < mincost:
mincost = cost
p... | N, *A = list(map(int, open(0).read().split()))
ans = 10**10
for i in range(-100, 101):
sn = sum((a-i)*(a-i) for a in A)
if sn < ans:
ans = sn
print(ans)
| 16 | 8 | 322 | 171 | # AtCoder Regular Contest 059
# C - いっしょ
# https://atcoder.jp/contests/arc059/tasks/arc059_a
N = int(eval(input()))
(*A,) = list(map(int, input().split()))
mincost = 10**10
for i in range(-100, 101):
cost = 0
for a in A:
cost += (a - i) * (a - i)
if cost < mincost:
mincost = cost
print(minco... | N, *A = list(map(int, open(0).read().split()))
ans = 10**10
for i in range(-100, 101):
sn = sum((a - i) * (a - i) for a in A)
if sn < ans:
ans = sn
print(ans)
| false | 50 | [
"-# AtCoder Regular Contest 059",
"-# C - いっしょ",
"-# https://atcoder.jp/contests/arc059/tasks/arc059_a",
"-N = int(eval(input()))",
"-(*A,) = list(map(int, input().split()))",
"-mincost = 10**10",
"+N, *A = list(map(int, open(0).read().split()))",
"+ans = 10**10",
"- cost = 0",
"- for a in A... | false | 0.038883 | 0.03866 | 1.005781 | [
"s329655850",
"s577218012"
] |
u761320129 | p02837 | python | s194737687 | s064421066 | 149 | 81 | 3,064 | 3,064 | Accepted | Accepted | 45.64 | N = int(eval(input()))
xs = [[] for i in range(N)]
for i in range(N):
a = int(eval(input()))
for j in range(a):
x,y = list(map(int,input().split()))
xs[i].append((x-1,y))
ans = 0
for b in range(1<<N):
mujun = False
for k,z in enumerate(xs):
for x,y in z:
i... | N = int(eval(input()))
xys = [[] for _ in range(N)]
for i in range(N):
A = int(eval(input()))
for j in range(A):
x,y = list(map(int,input().split()))
xys[i].append((x-1,y))
ans = 0
for b in range(1<<N):
cnt = bin(b).count('1')
if cnt <= ans: continue
for i in range(N):
... | 27 | 24 | 679 | 582 | N = int(eval(input()))
xs = [[] for i in range(N)]
for i in range(N):
a = int(eval(input()))
for j in range(a):
x, y = list(map(int, input().split()))
xs[i].append((x - 1, y))
ans = 0
for b in range(1 << N):
mujun = False
for k, z in enumerate(xs):
for x, y in z:
if b... | N = int(eval(input()))
xys = [[] for _ in range(N)]
for i in range(N):
A = int(eval(input()))
for j in range(A):
x, y = list(map(int, input().split()))
xys[i].append((x - 1, y))
ans = 0
for b in range(1 << N):
cnt = bin(b).count("1")
if cnt <= ans:
continue
for i in range(N):... | false | 11.111111 | [
"-xs = [[] for i in range(N)]",
"+xys = [[] for _ in range(N)]",
"- a = int(eval(input()))",
"- for j in range(a):",
"+ A = int(eval(input()))",
"+ for j in range(A):",
"- xs[i].append((x - 1, y))",
"+ xys[i].append((x - 1, y))",
"- mujun = False",
"- for k, z in en... | false | 0.125121 | 0.085342 | 1.466116 | [
"s194737687",
"s064421066"
] |
u694467277 | p02688 | python | s443599356 | s364419463 | 31 | 22 | 9,080 | 9,116 | Accepted | Accepted | 29.03 | n,k=list(map(int,input().split()))
LI=list(range(1,n+1))
kari=n+1
for i in range(1,k+1):
d=int(eval(input()))
li=list(map(int,input().split()))
for x in range(1,n+1):
if li.count(x)!=0:
if LI.count(x)!=0:
LI.remove(x)
print((len(LI)))
| n,k=list(map(int,input().split()))
cnt=[0]*(n)
for i in range(k):
d=int(eval(input()))
kou=list(map(int,input().split()))
for j in kou:
cnt[j-1]=1
print((cnt.count(0))) | 14 | 8 | 276 | 171 | n, k = list(map(int, input().split()))
LI = list(range(1, n + 1))
kari = n + 1
for i in range(1, k + 1):
d = int(eval(input()))
li = list(map(int, input().split()))
for x in range(1, n + 1):
if li.count(x) != 0:
if LI.count(x) != 0:
LI.remove(x)
print((len(LI)))
| n, k = list(map(int, input().split()))
cnt = [0] * (n)
for i in range(k):
d = int(eval(input()))
kou = list(map(int, input().split()))
for j in kou:
cnt[j - 1] = 1
print((cnt.count(0)))
| false | 42.857143 | [
"-LI = list(range(1, n + 1))",
"-kari = n + 1",
"-for i in range(1, k + 1):",
"+cnt = [0] * (n)",
"+for i in range(k):",
"- li = list(map(int, input().split()))",
"- for x in range(1, n + 1):",
"- if li.count(x) != 0:",
"- if LI.count(x) != 0:",
"- LI.remove(... | false | 0.041258 | 0.038903 | 1.060532 | [
"s443599356",
"s364419463"
] |
u279493135 | p02947 | python | s829866783 | s705350017 | 298 | 273 | 12,732 | 21,508 | Accepted | Accepted | 8.39 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upp... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digi... | 34 | 27 | 864 | 808 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
fro... | false | 20.588235 | [
"-from itertools import permutations, combinations, product, accumulate",
"+from itertools import permutations, combinations, product",
"+from bisect import bisect",
"-s.sort()",
"+dic = defaultdict(int)",
"+for x in s:",
"+ dic[x] += 1",
"-count = 0",
"-tmp = \"\"",
"-for i in s:",
"- if ... | false | 0.036454 | 0.034455 | 1.058028 | [
"s829866783",
"s705350017"
] |
u383416302 | p02756 | python | s459534991 | s282553219 | 1,662 | 370 | 4,516 | 4,468 | Accepted | Accepted | 77.74 | def main():
S = eval(input())
Q = int(eval(input()))
reverse = False
head = ''
tail = ''
for _ in range(Q):
query= eval(input())
if query == '1':
reverse = not reverse
head, tail = tail, head
else:
_, f, c = query.spli... | def main():
S = eval(input())
Q = int(eval(input()))
reverse = False
head = ''
tail = ''
for _ in range(Q):
query= eval(input())
if query == '1':
reverse = not reverse
head, tail = tail, head
else:
_, f, c = query.spli... | 28 | 30 | 561 | 617 | def main():
S = eval(input())
Q = int(eval(input()))
reverse = False
head = ""
tail = ""
for _ in range(Q):
query = eval(input())
if query == "1":
reverse = not reverse
head, tail = tail, head
else:
_, f, c = query.split()
i... | def main():
S = eval(input())
Q = int(eval(input()))
reverse = False
head = ""
tail = ""
for _ in range(Q):
query = eval(input())
if query == "1":
reverse = not reverse
head, tail = tail, head
else:
_, f, c = query.split()
i... | false | 6.666667 | [
"- head = \"\".join([head, c])",
"+ # head = ''.join([head,c])",
"+ head += c",
"- tail = \"\".join([tail, c])",
"+ # tail = ''.join([tail,c])",
"+ tail += c"
] | false | 0.112161 | 0.036428 | 3.079005 | [
"s459534991",
"s282553219"
] |
u775681539 | p03086 | python | s755818559 | s780336272 | 21 | 18 | 3,316 | 3,060 | Accepted | Accepted | 14.29 | #python3
from collections import Counter
def main():
s = eval(input())
ans = 0
cnt = 0
for i in range(len(s)):
if (s[i] == "A") | (s[i] == "T") | (s[i] == "C") | (s[i] == "G"):
cnt += 1
else:
cnt = 0
ans = max(ans, cnt)
print(ans)
main()
| #python3
def main():
s = eval(input())
ans = 0
cnt = 0
for i in range(len(s)):
if (s[i] == "A") | (s[i] == "T") | (s[i] == "C") | (s[i] == "G"):
cnt += 1
else:
cnt = 0
ans = max(ans, cnt)
print(ans)
main()
| 14 | 13 | 313 | 280 | # python3
from collections import Counter
def main():
s = eval(input())
ans = 0
cnt = 0
for i in range(len(s)):
if (s[i] == "A") | (s[i] == "T") | (s[i] == "C") | (s[i] == "G"):
cnt += 1
else:
cnt = 0
ans = max(ans, cnt)
print(ans)
main()
| # python3
def main():
s = eval(input())
ans = 0
cnt = 0
for i in range(len(s)):
if (s[i] == "A") | (s[i] == "T") | (s[i] == "C") | (s[i] == "G"):
cnt += 1
else:
cnt = 0
ans = max(ans, cnt)
print(ans)
main()
| false | 7.142857 | [
"-from collections import Counter",
"-",
"-"
] | false | 0.044282 | 0.038529 | 1.149312 | [
"s755818559",
"s780336272"
] |
u029315034 | p03286 | python | s335348811 | s415671445 | 20 | 18 | 2,940 | 2,940 | Accepted | Accepted | 10 | N = int(eval(input()))
ans = 0
if N != 0:
s = ''
while N != 0:
if N % 2 != 0:
N -= 1
s = '1' + s
else:
s = '0' + s
N //= -2
ans = s
print(ans) | n = int(eval(input()))
ans = 0
if n != 0:
s = ''
while n != 0:
if n % 2 != 0:
n -= 1
s = '1' + s
else:
s = '0' + s
n //= -2
ans = s
print(ans) | 15 | 15 | 224 | 224 | N = int(eval(input()))
ans = 0
if N != 0:
s = ""
while N != 0:
if N % 2 != 0:
N -= 1
s = "1" + s
else:
s = "0" + s
N //= -2
ans = s
print(ans)
| n = int(eval(input()))
ans = 0
if n != 0:
s = ""
while n != 0:
if n % 2 != 0:
n -= 1
s = "1" + s
else:
s = "0" + s
n //= -2
ans = s
print(ans)
| false | 0 | [
"-N = int(eval(input()))",
"+n = int(eval(input()))",
"-if N != 0:",
"+if n != 0:",
"- while N != 0:",
"- if N % 2 != 0:",
"- N -= 1",
"+ while n != 0:",
"+ if n % 2 != 0:",
"+ n -= 1",
"- N //= -2",
"+ n //= -2"
] | false | 0.044357 | 0.046797 | 0.947862 | [
"s335348811",
"s415671445"
] |
u853952087 | p04001 | python | s553731102 | s547957035 | 28 | 21 | 3,064 | 3,064 | Accepted | Accepted | 25 | s=int(eval(input()))
S=str(s)
w=len(str(s))-1
l=[]
L=[]
if w==0:
print(s)
else:
for i in range(2**w):
l.append(format(i, '0{}b'.format(w)))
for e in l:
q=[]
x=int(S[0])
for i in range(len(e)):
if e[i]=='0':
x=x*10+int(S[i+1])
... | S=eval(input())
w=len(S)-1
l=[]
L=[]
#S一桁の時の例外処理
if w==0:
print((int(S)))
else:
for i in range(2**w):
#format(i,'0?b')で好きな長さの2進数表示にできる
l.append(format(i, '0{}b'.format(w)))
#+が入るなら区切り、入らないなら⋆10して足す
for e in l:
q=[]
x=int(S[0])
for i in range(len(e))... | 22 | 24 | 451 | 521 | s = int(eval(input()))
S = str(s)
w = len(str(s)) - 1
l = []
L = []
if w == 0:
print(s)
else:
for i in range(2**w):
l.append(format(i, "0{}b".format(w)))
for e in l:
q = []
x = int(S[0])
for i in range(len(e)):
if e[i] == "0":
x = x * 10 + int(S[i ... | S = eval(input())
w = len(S) - 1
l = []
L = []
# S一桁の時の例外処理
if w == 0:
print((int(S)))
else:
for i in range(2**w):
# format(i,'0?b')で好きな長さの2進数表示にできる
l.append(format(i, "0{}b".format(w)))
# +が入るなら区切り、入らないなら⋆10して足す
for e in l:
q = []
x = int(S[0])
for i in range(len... | false | 8.333333 | [
"-s = int(eval(input()))",
"-S = str(s)",
"-w = len(str(s)) - 1",
"+S = eval(input())",
"+w = len(S) - 1",
"+# S一桁の時の例外処理",
"- print(s)",
"+ print((int(S)))",
"+ # format(i,'0?b')で好きな長さの2進数表示にできる",
"+ # +が入るなら区切り、入らないなら⋆10して足す"
] | false | 0.039811 | 0.040247 | 0.989162 | [
"s553731102",
"s547957035"
] |
u002459665 | p03338 | python | s904293882 | s095467026 | 19 | 17 | 3,064 | 3,060 | Accepted | Accepted | 10.53 | def func(s1, s2):
set1 = set(s1)
set2 = set(s2)
cnt = 0
for _ in range(len(set1)):
s = set1.pop()
if s in set2:
cnt += 1
return cnt
def main():
n = int(eval(input()))
s = eval(input())
mx = 0
for i in range(len(s) - 1):
s1 = s... | def check(s1, s2):
ss1 = set(s1)
ss2 = set(s2)
count = 0
for si in ss1:
if si in ss2:
count += 1;
return count
def main():
n = int(eval(input()))
s = eval(input())
mx = 0
for i in range(1, len(s)):
s1 = s[:i]
s2 = s[i:]
... | 30 | 25 | 524 | 398 | def func(s1, s2):
set1 = set(s1)
set2 = set(s2)
cnt = 0
for _ in range(len(set1)):
s = set1.pop()
if s in set2:
cnt += 1
return cnt
def main():
n = int(eval(input()))
s = eval(input())
mx = 0
for i in range(len(s) - 1):
s1 = s[: i + 1]
s2... | def check(s1, s2):
ss1 = set(s1)
ss2 = set(s2)
count = 0
for si in ss1:
if si in ss2:
count += 1
return count
def main():
n = int(eval(input()))
s = eval(input())
mx = 0
for i in range(1, len(s)):
s1 = s[:i]
s2 = s[i:]
mx = max(check(s1, ... | false | 16.666667 | [
"-def func(s1, s2):",
"- set1 = set(s1)",
"- set2 = set(s2)",
"- cnt = 0",
"- for _ in range(len(set1)):",
"- s = set1.pop()",
"- if s in set2:",
"- cnt += 1",
"- return cnt",
"+def check(s1, s2):",
"+ ss1 = set(s1)",
"+ ss2 = set(s2)",
"+ cou... | false | 0.048684 | 0.054391 | 0.895079 | [
"s904293882",
"s095467026"
] |
u745561510 | p03401 | python | s481986734 | s622251482 | 261 | 226 | 13,928 | 13,920 | Accepted | Accepted | 13.41 | N = int(eval(input()))
a = list(map(int, input().split()))
a.insert(0,0)
a.append(0)
all_sum = 0
for i in range(0,N+1):
all_sum += abs(a[i+1] - a[i])
for i in range(1, N+1):
if a[i-1] <= a[i] <= a[i+1] or a[i-1] >= a[i] >= a[i+1]:
print(all_sum)
elif a[i-1] <= a[i] and a[i-1] >= ... | N = int(eval(input()))
a = list(map(int, input().split()))
a.insert(0,0)
a.append(0)
all_sum = 0
for i in range(0,N+1):
all_sum += abs(a[i+1] - a[i])
for i in range(1, N+1):
print((all_sum - (abs(a[i-1] - a[i]) + abs(a[i+1] - a[i])) + abs(a[i+1] - a[i-1]))) | 28 | 13 | 756 | 273 | N = int(eval(input()))
a = list(map(int, input().split()))
a.insert(0, 0)
a.append(0)
all_sum = 0
for i in range(0, N + 1):
all_sum += abs(a[i + 1] - a[i])
for i in range(1, N + 1):
if a[i - 1] <= a[i] <= a[i + 1] or a[i - 1] >= a[i] >= a[i + 1]:
print(all_sum)
elif a[i - 1] <= a[i] and a[i - 1] >= ... | N = int(eval(input()))
a = list(map(int, input().split()))
a.insert(0, 0)
a.append(0)
all_sum = 0
for i in range(0, N + 1):
all_sum += abs(a[i + 1] - a[i])
for i in range(1, N + 1):
print(
(
all_sum
- (abs(a[i - 1] - a[i]) + abs(a[i + 1] - a[i]))
+ abs(a[i + 1] - a[i ... | false | 53.571429 | [
"- if a[i - 1] <= a[i] <= a[i + 1] or a[i - 1] >= a[i] >= a[i + 1]:",
"- print(all_sum)",
"- elif a[i - 1] <= a[i] and a[i - 1] >= a[i + 1]:",
"- # 増減",
"- print((all_sum - abs(a[i] - a[i - 1]) * 2))",
"- elif a[i - 1] <= a[i] and a[i - 1] <= a[i + 1]:",
"- # 増減",
... | false | 0.092293 | 0.090342 | 1.021594 | [
"s481986734",
"s622251482"
] |
u320121447 | p02270 | python | s637345587 | s402200952 | 770 | 650 | 9,564 | 9,560 | Accepted | Accepted | 15.58 | n, k = [int(t) for t in input().split()]
w = [int(eval(input())) for i in range(n)]
hi = sum(w)
lo = max(w)
def canMove(w, P, k):
s = 0
for i in range(len(w)):
if s + w[i] > P:
s = 0
k -= 1
if k <= 0: return False
s += w[i]
return True
P... | n, k = [int(t) for t in input().split()]
w = [int(eval(input())) for i in range(n)]
def canMove(w, P, k):
s = 0
for i in range(len(w)):
if s + w[i] > P:
s = 0
k -= 1
if k <= 0: return False
s += w[i]
return True
hi = sum(w)
lo = max(w)
P... | 27 | 27 | 462 | 462 | n, k = [int(t) for t in input().split()]
w = [int(eval(input())) for i in range(n)]
hi = sum(w)
lo = max(w)
def canMove(w, P, k):
s = 0
for i in range(len(w)):
if s + w[i] > P:
s = 0
k -= 1
if k <= 0:
return False
s += w[i]
return True
... | n, k = [int(t) for t in input().split()]
w = [int(eval(input())) for i in range(n)]
def canMove(w, P, k):
s = 0
for i in range(len(w)):
if s + w[i] > P:
s = 0
k -= 1
if k <= 0:
return False
s += w[i]
return True
hi = sum(w)
lo = max(w)
... | false | 0 | [
"-hi = sum(w)",
"-lo = max(w)",
"+hi = sum(w)",
"+lo = max(w)"
] | false | 0.057269 | 0.036145 | 1.584433 | [
"s637345587",
"s402200952"
] |
u797673668 | p02297 | python | s906138512 | s675888007 | 70 | 30 | 7,716 | 7,704 | Accepted | Accepted | 57.14 | n = int(eval(input()))
points = [tuple(map(int, input().split())) for _ in range(n)]
result = 0
px, py = points[0]
while points:
x, y = points.pop()
result += x * py - px * y
px, py = x, y
print((abs(result) / 2)) | n = int(eval(input()))
points = [complex(*list(map(int, input().split()))) for _ in range(n)]
result, prev = 0, points[0]
while points:
point = points.pop()
result += point.real * prev.imag - prev.real * point.imag
prev = point
print((abs(result) / 2)) | 9 | 8 | 225 | 257 | n = int(eval(input()))
points = [tuple(map(int, input().split())) for _ in range(n)]
result = 0
px, py = points[0]
while points:
x, y = points.pop()
result += x * py - px * y
px, py = x, y
print((abs(result) / 2))
| n = int(eval(input()))
points = [complex(*list(map(int, input().split()))) for _ in range(n)]
result, prev = 0, points[0]
while points:
point = points.pop()
result += point.real * prev.imag - prev.real * point.imag
prev = point
print((abs(result) / 2))
| false | 11.111111 | [
"-points = [tuple(map(int, input().split())) for _ in range(n)]",
"-result = 0",
"-px, py = points[0]",
"+points = [complex(*list(map(int, input().split()))) for _ in range(n)]",
"+result, prev = 0, points[0]",
"- x, y = points.pop()",
"- result += x * py - px * y",
"- px, py = x, y",
"+ ... | false | 0.043933 | 0.037153 | 1.182477 | [
"s906138512",
"s675888007"
] |
u759412327 | p02785 | python | s602356884 | s625003911 | 151 | 109 | 26,180 | 31,544 | Accepted | Accepted | 27.81 | N,K = list(map(int,input().split()))
H = sorted(list(map(int,input().split())))
print((sum(H[:N-min(N,K)]))) | N,K = list(map(int,input().split()))
H = sorted(list(map(int,input().split())))[::-1]
print((sum(H[K:]))) | 3 | 3 | 102 | 99 | N, K = list(map(int, input().split()))
H = sorted(list(map(int, input().split())))
print((sum(H[: N - min(N, K)])))
| N, K = list(map(int, input().split()))
H = sorted(list(map(int, input().split())))[::-1]
print((sum(H[K:])))
| false | 0 | [
"-H = sorted(list(map(int, input().split())))",
"-print((sum(H[: N - min(N, K)])))",
"+H = sorted(list(map(int, input().split())))[::-1]",
"+print((sum(H[K:])))"
] | false | 0.031784 | 0.035695 | 0.890424 | [
"s602356884",
"s625003911"
] |
u098012509 | p03050 | python | s061664841 | s001078918 | 397 | 116 | 2,940 | 3,272 | Accepted | Accepted | 70.78 | N = int(eval(input()))
ans = 0
for i in range(1, N + 1):
x = (N - i) // i
if x <= i:
break
if (N - i) % i == 0:
ans += x
print(ans)
| N = int(eval(input()))
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n//i)
# divisors.sort()
return divisors
divs = make_divisors(N)
ans = 0
for... | 15 | 27 | 175 | 436 | N = int(eval(input()))
ans = 0
for i in range(1, N + 1):
x = (N - i) // i
if x <= i:
break
if (N - i) % i == 0:
ans += x
print(ans)
| N = int(eval(input()))
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5) + 1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n // i)
# divisors.sort()
return divisors
divs = make_divisors(N)
ans = 0
for d in divs:
... | false | 44.444444 | [
"+",
"+",
"+def make_divisors(n):",
"+ divisors = []",
"+ for i in range(1, int(n**0.5) + 1):",
"+ if n % i == 0:",
"+ divisors.append(i)",
"+ if i != n // i:",
"+ divisors.append(n // i)",
"+ # divisors.sort()",
"+ return divisors",
"+",... | false | 0.811389 | 0.1353 | 5.996941 | [
"s061664841",
"s001078918"
] |
u140201022 | p02393 | python | s371361581 | s868954163 | 20 | 10 | 4,188 | 4,188 | Accepted | Accepted | 50 | m=list(map(int, input().split()))
m.sort()
print(' '.join(map(str, m))) | a=list(map(int,input().split()));a.sort();print(a[0],a[1],a[2]) | 3 | 1 | 70 | 60 | m = list(map(int, input().split()))
m.sort()
print(" ".join(map(str, m)))
| a = list(map(int, input().split()))
a.sort()
print(a[0], a[1], a[2])
| false | 66.666667 | [
"-m = list(map(int, input().split()))",
"-m.sort()",
"-print(\" \".join(map(str, m)))",
"+a = list(map(int, input().split()))",
"+a.sort()",
"+print(a[0], a[1], a[2])"
] | false | 0.041157 | 0.039242 | 1.048792 | [
"s371361581",
"s868954163"
] |
u184898414 | p03170 | python | s976816260 | s726365703 | 278 | 232 | 41,836 | 45,040 | Accepted | Accepted | 16.55 | n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
dp=[0]*(k+1)
for i in range(1,k+1):
for j in a:
if i>=j and dp[i-j]==0:
dp[i]=1
break
if dp[k]:
print("First")
else:
print("Second") | n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
dp = [0 for i in range(k+1)]
dp[0]=2
for i in range(1,k+1):
l=0
for j in range(n):
if dp[i-a[j]]==2:
l=l+1
break
if l==1:
dp[i]=1
else:
dp[i]=2
if dp[k]==1:
print("F... | 12 | 18 | 259 | 355 | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = [0] * (k + 1)
for i in range(1, k + 1):
for j in a:
if i >= j and dp[i - j] == 0:
dp[i] = 1
break
if dp[k]:
print("First")
else:
print("Second")
| n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = [0 for i in range(k + 1)]
dp[0] = 2
for i in range(1, k + 1):
l = 0
for j in range(n):
if dp[i - a[j]] == 2:
l = l + 1
break
if l == 1:
dp[i] = 1
else:
dp[i] = 2
if dp[k] == 1:... | false | 33.333333 | [
"-dp = [0] * (k + 1)",
"+dp = [0 for i in range(k + 1)]",
"+dp[0] = 2",
"- for j in a:",
"- if i >= j and dp[i - j] == 0:",
"- dp[i] = 1",
"+ l = 0",
"+ for j in range(n):",
"+ if dp[i - a[j]] == 2:",
"+ l = l + 1",
"-if dp[k]:",
"+ if l == 1:",
... | false | 0.043159 | 0.049691 | 0.868535 | [
"s976816260",
"s726365703"
] |
u941753895 | p03731 | python | s433316484 | s017803979 | 147 | 127 | 26,708 | 27,756 | Accepted | Accepted | 13.61 | n,t=list(map(int,input().split()))
l=list(map(int,input().split()))
l.append(l[-1]+t)
s=0
for i in range(len(l)-1):
s+=min(l[i+1]-l[i],t)
print(s) | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
def LI(): return list(map(int,input().split()))
def I(): return int(eval(input()))
def LS(): return input().split()
def S(): return eval(input())
def main():
n,t=... | 7 | 28 | 148 | 473 | n, t = list(map(int, input().split()))
l = list(map(int, input().split()))
l.append(l[-1] + t)
s = 0
for i in range(len(l) - 1):
s += min(l[i + 1] - l[i], t)
print(s)
| import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
def LI():
return list(map(int, input().split()))
def I():
return int(eval(input()))
def LS():
return input().split()
def S():
return eval... | false | 75 | [
"-n, t = list(map(int, input().split()))",
"-l = list(map(int, input().split()))",
"-l.append(l[-1] + t)",
"-s = 0",
"-for i in range(len(l) - 1):",
"- s += min(l[i + 1] - l[i], t)",
"-print(s)",
"+import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time",... | false | 0.04509 | 0.008072 | 5.586119 | [
"s433316484",
"s017803979"
] |
u021019433 | p02837 | python | s689288750 | s423553431 | 63 | 58 | 3,064 | 3,064 | Accepted | Accepted | 7.94 | from itertools import combinations
n = int(eval(input()))
r = list(range(n))
a = [([], []) for _ in r]
for i in r:
for _ in range(int(eval(input()))):
x, y = list(map(int, input().split()))
a[i][y].append(x - 1)
fail = lambda x: not all(x.isdisjoint(a[i][0]) and x.issuperset(a[i][1]) for i in x)
... | from itertools import combinations
n = int(eval(input()))
r = list(range(n))
a = [(set(), set()) for _ in r]
for i in r:
for _ in range(int(eval(input()))):
x, y = list(map(int, input().split()))
a[i][y].add(x - 1)
fail = lambda x: not all(a[i][0].isdisjoint(x) and a[i][1] < x for i in x)
wh... | 15 | 15 | 370 | 366 | from itertools import combinations
n = int(eval(input()))
r = list(range(n))
a = [([], []) for _ in r]
for i in r:
for _ in range(int(eval(input()))):
x, y = list(map(int, input().split()))
a[i][y].append(x - 1)
fail = lambda x: not all(x.isdisjoint(a[i][0]) and x.issuperset(a[i][1]) for i in x)
wh... | from itertools import combinations
n = int(eval(input()))
r = list(range(n))
a = [(set(), set()) for _ in r]
for i in r:
for _ in range(int(eval(input()))):
x, y = list(map(int, input().split()))
a[i][y].add(x - 1)
fail = lambda x: not all(a[i][0].isdisjoint(x) and a[i][1] < x for i in x)
while all... | false | 0 | [
"-a = [([], []) for _ in r]",
"+a = [(set(), set()) for _ in r]",
"- a[i][y].append(x - 1)",
"-fail = lambda x: not all(x.isdisjoint(a[i][0]) and x.issuperset(a[i][1]) for i in x)",
"+ a[i][y].add(x - 1)",
"+fail = lambda x: not all(a[i][0].isdisjoint(x) and a[i][1] < x for i in x)"
] | false | 0.045241 | 0.047468 | 0.953097 | [
"s689288750",
"s423553431"
] |
u821251381 | p02691 | python | s212679278 | s120149126 | 314 | 194 | 59,508 | 40,312 | Accepted | Accepted | 38.22 | from collections import defaultdict
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 0
R = defaultdict(int)
#R= defaultdict(lambda:0)
for i ,Ai in enumerate(A,1):
R[i+Ai]+=1
L = defaultdict(int)
for j ,Aj in enumerate(A,1):
L[j-Aj]+=1
for i in R:
ans+=R.get(i,0)*L.get(i,... | n = int(eval(input()))
la = [int(i) for i in input().split()]
ia = {}
pair = 0
for j, a in enumerate(la):
ia[j + a] = ia.get(j + a, 0) + 1
for j, a in enumerate(la):
pair += ia.get(j - a, 0)
print(pair)
| 21 | 12 | 330 | 216 | from collections import defaultdict
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 0
R = defaultdict(int)
# R= defaultdict(lambda:0)
for i, Ai in enumerate(A, 1):
R[i + Ai] += 1
L = defaultdict(int)
for j, Aj in enumerate(A, 1):
L[j - Aj] += 1
for i in R:
ans += R.get(i, 0) * L.get(i, 0)
... | n = int(eval(input()))
la = [int(i) for i in input().split()]
ia = {}
pair = 0
for j, a in enumerate(la):
ia[j + a] = ia.get(j + a, 0) + 1
for j, a in enumerate(la):
pair += ia.get(j - a, 0)
print(pair)
| false | 42.857143 | [
"-from collections import defaultdict",
"-",
"-N = int(eval(input()))",
"-A = list(map(int, input().split()))",
"-ans = 0",
"-R = defaultdict(int)",
"-# R= defaultdict(lambda:0)",
"-for i, Ai in enumerate(A, 1):",
"- R[i + Ai] += 1",
"-L = defaultdict(int)",
"-for j, Aj in enumerate(A, 1):",
... | false | 0.034098 | 0.034568 | 0.986396 | [
"s212679278",
"s120149126"
] |
u882460931 | p03284 | python | s894358385 | s234888877 | 19 | 17 | 3,188 | 2,940 | Accepted | Accepted | 10.53 | import re
match = re.fullmatch(r'(?P<N>[0-9]+) (?P<K>[0-9]+)', eval(input()))
n = int(match.group('N'))
k = int(match.group('K'))
if n % k == 0:
print((0))
else:
print((1)) | split = input().split()
n = int(split[0])
k = int(split[1])
if n % k == 0:
print((0))
else:
print((1)) | 11 | 8 | 183 | 114 | import re
match = re.fullmatch(r"(?P<N>[0-9]+) (?P<K>[0-9]+)", eval(input()))
n = int(match.group("N"))
k = int(match.group("K"))
if n % k == 0:
print((0))
else:
print((1))
| split = input().split()
n = int(split[0])
k = int(split[1])
if n % k == 0:
print((0))
else:
print((1))
| false | 27.272727 | [
"-import re",
"-",
"-match = re.fullmatch(r\"(?P<N>[0-9]+) (?P<K>[0-9]+)\", eval(input()))",
"-n = int(match.group(\"N\"))",
"-k = int(match.group(\"K\"))",
"+split = input().split()",
"+n = int(split[0])",
"+k = int(split[1])"
] | false | 0.069483 | 0.04575 | 1.518744 | [
"s894358385",
"s234888877"
] |
u997521090 | p03128 | python | s416035102 | s730479279 | 225 | 134 | 15,268 | 15,796 | Accepted | Accepted | 40.44 | n,m,*a=list(map(int,open(0).read().split()))
d=[0]*n*9
for i in range(n):
for j in a:c=i+int("0255456376"[j]);d[c]=max(d[c],(d[i]*10+j)*(i<1or d[i]>0))###
print((d[n])) | n,m,*a=list(map(int,open(0).read().split()))
d=[0]*n*9+[-1]*n*9
for i in range(1,n+1):d[i]=max(d[i-int("0255456376"[j])]*10+j for j in a)
print((d[n])) | 5 | 4 | 165 | 146 | n, m, *a = list(map(int, open(0).read().split()))
d = [0] * n * 9
for i in range(n):
for j in a:
c = i + int("0255456376"[j])
d[c] = max(d[c], (d[i] * 10 + j) * (i < 1 or d[i] > 0)) ###
print((d[n]))
| n, m, *a = list(map(int, open(0).read().split()))
d = [0] * n * 9 + [-1] * n * 9
for i in range(1, n + 1):
d[i] = max(d[i - int("0255456376"[j])] * 10 + j for j in a)
print((d[n]))
| false | 20 | [
"-d = [0] * n * 9",
"-for i in range(n):",
"- for j in a:",
"- c = i + int(\"0255456376\"[j])",
"- d[c] = max(d[c], (d[i] * 10 + j) * (i < 1 or d[i] > 0)) ###",
"+d = [0] * n * 9 + [-1] * n * 9",
"+for i in range(1, n + 1):",
"+ d[i] = max(d[i - int(\"0255456376\"[j])] * 10 + j fo... | false | 0.036848 | 0.103673 | 0.355425 | [
"s416035102",
"s730479279"
] |
u871934301 | p02678 | python | s469559230 | s774025328 | 793 | 649 | 66,476 | 37,496 | Accepted | Accepted | 18.16 | from collections import deque
mi = lambda:list(map(int,input().split()))
mix = lambda x:list(mi() for _ in range(x))
##########
def main(n,m,l):
#グラフの作成
g = creategraph(n,l)
#独立した部屋がある場合はNG
for i in range(1,len(g)):
if len(g[i]) == 0:
print("No")
return
... | from collections import deque
N,M=list(map(int,input().split()))
graph=[[] for i in range(N+1)]
for i in range(M):
A,B=list(map(int,input().split()))
graph[A].append(B)
graph[B].append(A)
dist=[-1]*(N+1)
dist[0]=0
dist[1]=0
d=deque()
d.append(1)
ans=[0]*(N+1)
while d:
v=d.popleft()
... | 56 | 184 | 1,172 | 976 | from collections import deque
mi = lambda: list(map(int, input().split()))
mix = lambda x: list(mi() for _ in range(x))
##########
def main(n, m, l):
# グラフの作成
g = creategraph(n, l)
# 独立した部屋がある場合はNG
for i in range(1, len(g)):
if len(g[i]) == 0:
print("No")
return
# BF... | from collections import deque
N, M = list(map(int, input().split()))
graph = [[] for i in range(N + 1)]
for i in range(M):
A, B = list(map(int, input().split()))
graph[A].append(B)
graph[B].append(A)
dist = [-1] * (N + 1)
dist[0] = 0
dist[1] = 0
d = deque()
d.append(1)
ans = [0] * (N + 1)
while d:
v = ... | false | 69.565217 | [
"-mi = lambda: list(map(int, input().split()))",
"-mix = lambda x: list(mi() for _ in range(x))",
"-##########",
"-def main(n, m, l):",
"- # グラフの作成",
"- g = creategraph(n, l)",
"- # 独立した部屋がある場合はNG",
"- for i in range(1, len(g)):",
"- if len(g[i]) == 0:",
"- print(\"No... | false | 0.065535 | 0.097133 | 0.674693 | [
"s469559230",
"s774025328"
] |
u797673668 | p02270 | python | s167120867 | s865759754 | 520 | 400 | 11,596 | 11,664 | Accepted | Accepted | 23.08 | def check_p(p):
global k, ws
ct, nt = 0, 1
for w in ws:
if ct + w <= p:
ct += w
else:
nt += 1
if nt > k:
return False
ct = w
return True
n, k = list(map(int, input().split()))
ws = [int(eval(input())) for ... | def check_p(p):
global k, ws
lt, nt = 0, 1 # loadage_of_current_truck, num_of_truck
for w in ws:
lt += w
if lt > p:
nt += 1
if nt > k:
return False
lt = w
return True
n, k = list(map(int, input().split()))
ws = [int(e... | 27 | 26 | 472 | 490 | def check_p(p):
global k, ws
ct, nt = 0, 1
for w in ws:
if ct + w <= p:
ct += w
else:
nt += 1
if nt > k:
return False
ct = w
return True
n, k = list(map(int, input().split()))
ws = [int(eval(input())) for _ in range(n)]
l,... | def check_p(p):
global k, ws
lt, nt = 0, 1 # loadage_of_current_truck, num_of_truck
for w in ws:
lt += w
if lt > p:
nt += 1
if nt > k:
return False
lt = w
return True
n, k = list(map(int, input().split()))
ws = [int(eval(input())) fo... | false | 3.703704 | [
"- ct, nt = 0, 1",
"+ lt, nt = 0, 1 # loadage_of_current_truck, num_of_truck",
"- if ct + w <= p:",
"- ct += w",
"- else:",
"+ lt += w",
"+ if lt > p:",
"- ct = w",
"+ lt = w"
] | false | 0.038678 | 0.042615 | 0.907605 | [
"s167120867",
"s865759754"
] |
u936985471 | p03262 | python | s192059390 | s510109605 | 132 | 117 | 14,224 | 14,252 | Accepted | Accepted | 11.36 | N,X=list(map(int,input().split()))
x=list(map(int,input().split()))
x.append(X)
x=sorted(x)
dif=[0]*(len(x)-1)
for i in range(len(x)-1):
dif[i]=x[i+1]-x[i]
def gcd(a,b):
if b>a:
a,b=b,a
while True:
if a%b==0:
return b
else:
a,b=b,a%b
ans=dif[0]
for i in range(1,len(dif)... | n,x=list(map(int,input().split()))
p=sorted(list(map(int,input().split())))
def gcd(a,b):
if a<b:
a,b=b,a
while a%b>0:
a,b=b,a%b
return b
ans=abs(x-p[0])
for i in range(1,n):
ans=gcd(ans,p[i]-p[i-1])
print(ans) | 22 | 13 | 353 | 235 | N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
x = sorted(x)
dif = [0] * (len(x) - 1)
for i in range(len(x) - 1):
dif[i] = x[i + 1] - x[i]
def gcd(a, b):
if b > a:
a, b = b, a
while True:
if a % b == 0:
return b
else:
... | n, x = list(map(int, input().split()))
p = sorted(list(map(int, input().split())))
def gcd(a, b):
if a < b:
a, b = b, a
while a % b > 0:
a, b = b, a % b
return b
ans = abs(x - p[0])
for i in range(1, n):
ans = gcd(ans, p[i] - p[i - 1])
print(ans)
| false | 40.909091 | [
"-N, X = list(map(int, input().split()))",
"-x = list(map(int, input().split()))",
"-x.append(X)",
"-x = sorted(x)",
"-dif = [0] * (len(x) - 1)",
"-for i in range(len(x) - 1):",
"- dif[i] = x[i + 1] - x[i]",
"+n, x = list(map(int, input().split()))",
"+p = sorted(list(map(int, input().split())))"... | false | 0.044986 | 0.124697 | 0.360759 | [
"s192059390",
"s510109605"
] |
u118642796 | p03576 | python | s305012989 | s420044885 | 755 | 28 | 118,068 | 3,064 | Accepted | Accepted | 96.29 | import sys
def LI(): return([int(x) for x in sys.stdin.readline().split()])
N,K = LI()
XY = [LI() for _ in range(N)]
X = []
Y = []
for x,y in XY:
if not(x in X):
X.append(x)
if not(y in Y):
Y.append(y)
X.sort()
Y.sort()
dic_XoYo = {}
dic_XcYo = {}
dic_XoYc = {}
dic_... | import sys
I = lambda:[int(x) for x in sys.stdin.readline().split()]
N,K = I()
Z = [I() for _ in range(N)]
Z.sort()
INF = 10**20
ans = INF
for i in range(N):
for j in range(i+K-1,N):
l = sorted(t[1] for t in Z[i:j+1])
ans_tmp = [(Z[j][0]-Z[i][0])*(v-u) for u,v in zip(l,l[K-1:])]
... | 54 | 15 | 1,219 | 359 | import sys
def LI():
return [int(x) for x in sys.stdin.readline().split()]
N, K = LI()
XY = [LI() for _ in range(N)]
X = []
Y = []
for x, y in XY:
if not (x in X):
X.append(x)
if not (y in Y):
Y.append(y)
X.sort()
Y.sort()
dic_XoYo = {}
dic_XcYo = {}
dic_XoYc = {}
dic_XcYc = {}
for x1 in... | import sys
I = lambda: [int(x) for x in sys.stdin.readline().split()]
N, K = I()
Z = [I() for _ in range(N)]
Z.sort()
INF = 10**20
ans = INF
for i in range(N):
for j in range(i + K - 1, N):
l = sorted(t[1] for t in Z[i : j + 1])
ans_tmp = [(Z[j][0] - Z[i][0]) * (v - u) for u, v in zip(l, l[K - 1 :]... | false | 72.222222 | [
"-",
"-def LI():",
"- return [int(x) for x in sys.stdin.readline().split()]",
"-",
"-",
"-N, K = LI()",
"-XY = [LI() for _ in range(N)]",
"-X = []",
"-Y = []",
"-for x, y in XY:",
"- if not (x in X):",
"- X.append(x)",
"- if not (y in Y):",
"- Y.append(y)",
"-X.sor... | false | 0.114132 | 0.031995 | 3.567145 | [
"s305012989",
"s420044885"
] |
u788137651 | p03274 | python | s703247465 | s668954386 | 147 | 70 | 18,980 | 14,252 | Accepted | Accepted | 52.38 | #ans = min(b - a + min(abs(a), abs(b)) for a, b in zip(x, x[K-1:]))
N, K = list(map(int, input().split()))
INF = 10**10
x_first = [-INF for i in range(K)]
x_ap = [int(i) for i in input().split()]
x_last = [INF for i in range(K)]
x = x_first + x_ap + x_last + [0]
x.sort()
zero_index = x.index(0)
key = []
f... | N, K = list(map(int, input().split()))
x = [int(i) for i in input().split()]
key = []
for left, right in zip(x, x[K - 1:]):
key.append(right-left+min(abs(left), abs(right)))
print((min(key)))
| 22 | 6 | 568 | 193 | # ans = min(b - a + min(abs(a), abs(b)) for a, b in zip(x, x[K-1:]))
N, K = list(map(int, input().split()))
INF = 10**10
x_first = [-INF for i in range(K)]
x_ap = [int(i) for i in input().split()]
x_last = [INF for i in range(K)]
x = x_first + x_ap + x_last + [0]
x.sort()
zero_index = x.index(0)
key = []
for i in range... | N, K = list(map(int, input().split()))
x = [int(i) for i in input().split()]
key = []
for left, right in zip(x, x[K - 1 :]):
key.append(right - left + min(abs(left), abs(right)))
print((min(key)))
| false | 72.727273 | [
"-# ans = min(b - a + min(abs(a), abs(b)) for a, b in zip(x, x[K-1:]))",
"-INF = 10**10",
"-x_first = [-INF for i in range(K)]",
"-x_ap = [int(i) for i in input().split()]",
"-x_last = [INF for i in range(K)]",
"-x = x_first + x_ap + x_last + [0]",
"-x.sort()",
"-zero_index = x.index(0)",
"+x = [int... | false | 0.047344 | 0.046858 | 1.010373 | [
"s703247465",
"s668954386"
] |
u716529032 | p04013 | python | s143309269 | s552751590 | 172 | 26 | 5,228 | 3,188 | Accepted | Accepted | 84.88 | N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
s = [{} for i in range(N+1)]
s[0][0] = 1
for i in range(N):
cur = X[i]
for j in range(N, 0, -1):
for k, v in list(s[j-1].items()):
s[j][cur + k] = s[j].get(cur + k, 0) + v
ans = 0
for i in range(1, N+1):
ans += s[i... | N, A = list(map(int, input().split()))
X = list([int(x) - A for x in input().split()])
d = {0: 1}
for cur in X:
for k, v in list(d.items()):
d[cur + k] = d.get(cur + k, 0) + v
print((d[0]-1)) | 15 | 10 | 333 | 210 | N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
s = [{} for i in range(N + 1)]
s[0][0] = 1
for i in range(N):
cur = X[i]
for j in range(N, 0, -1):
for k, v in list(s[j - 1].items()):
s[j][cur + k] = s[j].get(cur + k, 0) + v
ans = 0
for i in range(1, N + 1):
ans... | N, A = list(map(int, input().split()))
X = list([int(x) - A for x in input().split()])
d = {0: 1}
for cur in X:
for k, v in list(d.items()):
d[cur + k] = d.get(cur + k, 0) + v
print((d[0] - 1))
| false | 33.333333 | [
"-X = list(map(int, input().split()))",
"-s = [{} for i in range(N + 1)]",
"-s[0][0] = 1",
"-for i in range(N):",
"- cur = X[i]",
"- for j in range(N, 0, -1):",
"- for k, v in list(s[j - 1].items()):",
"- s[j][cur + k] = s[j].get(cur + k, 0) + v",
"-ans = 0",
"-for i in ran... | false | 0.048343 | 0.039245 | 1.231812 | [
"s143309269",
"s552751590"
] |
u790922244 | p03013 | python | s783968940 | s239186426 | 265 | 206 | 8,624 | 8,648 | Accepted | Accepted | 22.26 | OK = 0
BRO = 1
MOD = 1000000007
N,M=list(map(int, input().split()))
Broken=[int(eval(input())) for i in range(M)]
#K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))
K = list(0 for i in range(N+1))
for i in range(M):
K[Broken[i]] = 1
dp=[0 for i in range(N+1)]
dp[0]=1
for i in range(N)... | OK = 0
BRO = 1
N,M=list(map(int, input().split()))
Broken=[int(eval(input())) for i in range(M)]
#K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))
K = list(0 for i in range(N+1))
for i in range(M):
K[Broken[i]] = 1
if N == 1:
print((1))
exit()
c=[0 for i in range(N+1)]
if K[... | 20 | 33 | 427 | 686 | OK = 0
BRO = 1
MOD = 1000000007
N, M = list(map(int, input().split()))
Broken = [int(eval(input())) for i in range(M)]
# K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))
K = list(0 for i in range(N + 1))
for i in range(M):
K[Broken[i]] = 1
dp = [0 for i in range(N + 1)]
dp[0] = 1
for i in range(N):... | OK = 0
BRO = 1
N, M = list(map(int, input().split()))
Broken = [int(eval(input())) for i in range(M)]
# K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))
K = list(0 for i in range(N + 1))
for i in range(M):
K[Broken[i]] = 1
if N == 1:
print((1))
exit()
c = [0 for i in range(N + 1)]
if K[N - ... | false | 39.393939 | [
"-MOD = 1000000007",
"-dp = [0 for i in range(N + 1)]",
"-dp[0] = 1",
"-for i in range(N):",
"- for j in range(i + 1, min(i + 2 + 1, N + 1)):",
"- if K[j] == OK:",
"- dp[j] += dp[i]",
"- dp[j] %= MOD",
"-print((dp[N]))",
"+if N == 1:",
"+ print((1))",
"+ e... | false | 0.03609 | 0.036355 | 0.992721 | [
"s783968940",
"s239186426"
] |
u762420987 | p02983 | python | s917611825 | s264450873 | 1,521 | 807 | 2,940 | 2,940 | Accepted | Accepted | 46.94 | L, R = list(map(int, input().split()))
mod = 2019
ans = 10**9 + 7
for i in range(L, min(L + mod, R)):
for j in range(i + 1, min(i + mod + 1, R + 1)):
ans = min((i * j) % mod, ans)
print(ans)
| L, R = list(map(int, input().split()))
mod = 2019
ans = 10**9
for i in range(L, min(R+1, L+2030)):
for j in range(i+1, min(R+1, L+2030)):
ans = min(ans, (i*j)%mod)
print(ans)
| 7 | 7 | 197 | 187 | L, R = list(map(int, input().split()))
mod = 2019
ans = 10**9 + 7
for i in range(L, min(L + mod, R)):
for j in range(i + 1, min(i + mod + 1, R + 1)):
ans = min((i * j) % mod, ans)
print(ans)
| L, R = list(map(int, input().split()))
mod = 2019
ans = 10**9
for i in range(L, min(R + 1, L + 2030)):
for j in range(i + 1, min(R + 1, L + 2030)):
ans = min(ans, (i * j) % mod)
print(ans)
| false | 0 | [
"-ans = 10**9 + 7",
"-for i in range(L, min(L + mod, R)):",
"- for j in range(i + 1, min(i + mod + 1, R + 1)):",
"- ans = min((i * j) % mod, ans)",
"+ans = 10**9",
"+for i in range(L, min(R + 1, L + 2030)):",
"+ for j in range(i + 1, min(R + 1, L + 2030)):",
"+ ans = min(ans, (i * ... | false | 0.123811 | 0.168643 | 0.734162 | [
"s917611825",
"s264450873"
] |
u597374218 | p02993 | python | s537516131 | s840057871 | 22 | 17 | 3,060 | 2,940 | Accepted | Accepted | 22.73 | s=eval(input())
print(("Good" if s[0]!=s[1] and s[1]!=s[2] and s[2]!=s[3] else "Bad")) | a,b,c,d=eval(input())
print(("Good" if a!=b and b!=c and c!=d else "Bad")) | 2 | 2 | 79 | 67 | s = eval(input())
print(("Good" if s[0] != s[1] and s[1] != s[2] and s[2] != s[3] else "Bad"))
| a, b, c, d = eval(input())
print(("Good" if a != b and b != c and c != d else "Bad"))
| false | 0 | [
"-s = eval(input())",
"-print((\"Good\" if s[0] != s[1] and s[1] != s[2] and s[2] != s[3] else \"Bad\"))",
"+a, b, c, d = eval(input())",
"+print((\"Good\" if a != b and b != c and c != d else \"Bad\"))"
] | false | 0.15195 | 0.060493 | 2.511858 | [
"s537516131",
"s840057871"
] |
u716530146 | p02936 | python | s305468930 | s900407517 | 1,787 | 790 | 232,496 | 94,720 | Accepted | Accepted | 55.79 | #!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7
def dfs(node):
tmp = data[node]
for v in G[node]:
if not visited[v]:
visited[v]=1
data[v]+=tmp
dfs(v)
return 0
... | #!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7
n,q=list(map(int,input().split()))
G=[[] for i in range(n)]
for i in range(n-1):
a,b=list(map(int,input().split()))
a-=1;b-=1
G[a].append(b)
G[b].... | 33 | 35 | 628 | 636 | #!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
inf = float("inf")
mod = 10**9 + 7
def dfs(node):
tmp = data[node]
for v in G[node]:
if not visited[v]:
visited[v] = 1
data[v] += tmp
dfs(v)
return 0
n, q... | #!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
inf = float("inf")
mod = 10**9 + 7
n, q = list(map(int, input().split()))
G = [[] for i in range(n)]
for i in range(n - 1):
a, b = list(map(int, input().split()))
a -= 1
b -= 1
G[a].append(b)
G[... | false | 5.714286 | [
"-",
"-",
"-def dfs(node):",
"- tmp = data[node]",
"- for v in G[node]:",
"- if not visited[v]:",
"- visited[v] = 1",
"- data[v] += tmp",
"- dfs(v)",
"- return 0",
"-",
"-",
"-dfs(0)",
"+stack = [0]",
"+while stack:",
"+ node = stack.... | false | 0.04068 | 0.038129 | 1.066893 | [
"s305468930",
"s900407517"
] |
u316341119 | p03031 | python | s534532165 | s337452567 | 23 | 20 | 3,188 | 3,064 | Accepted | Accepted | 13.04 | N, M = list(map(int, input().split()))
kss = []
for i in range(M):
tmp = list(map(int, input().split()))
k = tmp[0]
s = tmp[1:]
kss.append([k, s])
ps = list(map(int, input().split()))
def check_on(s_all, s, p):
oncnt = 0
for i in s:
if s_all[i]:
oncnt += 1
... | N, M = list(map(int, input().split()))
onptns = []
for i in range(M):
k, *s= list(map(int, input().split()))
onptn = 0
for i in s:
onptn += 1 << (i - 1)
onptns.append(onptn)
ps = list(map(int, input().split()))
ans = 0
s = 0
while s < (1 << N):
ans += 1
for onptn, p in z... | 46 | 22 | 961 | 445 | N, M = list(map(int, input().split()))
kss = []
for i in range(M):
tmp = list(map(int, input().split()))
k = tmp[0]
s = tmp[1:]
kss.append([k, s])
ps = list(map(int, input().split()))
def check_on(s_all, s, p):
oncnt = 0
for i in s:
if s_all[i]:
oncnt += 1
if oncnt % 2 ... | N, M = list(map(int, input().split()))
onptns = []
for i in range(M):
k, *s = list(map(int, input().split()))
onptn = 0
for i in s:
onptn += 1 << (i - 1)
onptns.append(onptn)
ps = list(map(int, input().split()))
ans = 0
s = 0
while s < (1 << N):
ans += 1
for onptn, p in zip(onptns, ps):
... | false | 52.173913 | [
"-kss = []",
"+onptns = []",
"- tmp = list(map(int, input().split()))",
"- k = tmp[0]",
"- s = tmp[1:]",
"- kss.append([k, s])",
"+ k, *s = list(map(int, input().split()))",
"+ onptn = 0",
"+ for i in s:",
"+ onptn += 1 << (i - 1)",
"+ onptns.append(onptn)",
"-",... | false | 0.072734 | 0.071234 | 1.021068 | [
"s534532165",
"s337452567"
] |
u226108478 | p03137 | python | s844486667 | s433327465 | 105 | 83 | 13,968 | 20,484 | Accepted | Accepted | 20.95 | # -*- coding: utf-8 -*-
def main():
n, m = list(map(int, input().split()))
xs = sorted(list(map(int, input().split())))
if n >= m:
print((0))
else:
ans = xs[-1] - xs[0]
diff = [0 for _ in range(m - 1)]
for i in range(m - 1):
diff[i] = xs[i + ... | # -*- coding: utf-8 -*-
def main():
n, m = list(map(int, input().split()))
x = sorted(list(map(int, input().split())))
diff = list()
for i, j in zip(x, x[1:]):
diff.append(abs(i - j))
diff = sorted(diff, reverse=True)
print((sum(diff) - sum(diff[:n - 1])))
if __name_... | 21 | 17 | 431 | 341 | # -*- coding: utf-8 -*-
def main():
n, m = list(map(int, input().split()))
xs = sorted(list(map(int, input().split())))
if n >= m:
print((0))
else:
ans = xs[-1] - xs[0]
diff = [0 for _ in range(m - 1)]
for i in range(m - 1):
diff[i] = xs[i + 1] - xs[i]
... | # -*- coding: utf-8 -*-
def main():
n, m = list(map(int, input().split()))
x = sorted(list(map(int, input().split())))
diff = list()
for i, j in zip(x, x[1:]):
diff.append(abs(i - j))
diff = sorted(diff, reverse=True)
print((sum(diff) - sum(diff[: n - 1])))
if __name__ == "__main__":
... | false | 19.047619 | [
"- xs = sorted(list(map(int, input().split())))",
"- if n >= m:",
"- print((0))",
"- else:",
"- ans = xs[-1] - xs[0]",
"- diff = [0 for _ in range(m - 1)]",
"- for i in range(m - 1):",
"- diff[i] = xs[i + 1] - xs[i]",
"- print((ans - sum(sorted(... | false | 0.110128 | 0.03839 | 2.868655 | [
"s844486667",
"s433327465"
] |
u150984829 | p02257 | python | s559344264 | s731894858 | 610 | 320 | 5,704 | 5,668 | Accepted | Accepted | 47.54 | c=0
n=int(eval(input()))
for _ in range(n):
x=int(eval(input()))
for i in range(2,int(x**.5+1)):
if x%i==0:c+=1;break
print((n-c))
| c=0
n=int(eval(input()))
for _ in range(n):
x=int(eval(input()))
if x!=2 and x%2==0:c+=1;continue
for i in range(3,int(x**.5+1),2):
if x%i==0:c+=1;break
print((n-c))
| 7 | 8 | 127 | 164 | c = 0
n = int(eval(input()))
for _ in range(n):
x = int(eval(input()))
for i in range(2, int(x**0.5 + 1)):
if x % i == 0:
c += 1
break
print((n - c))
| c = 0
n = int(eval(input()))
for _ in range(n):
x = int(eval(input()))
if x != 2 and x % 2 == 0:
c += 1
continue
for i in range(3, int(x**0.5 + 1), 2):
if x % i == 0:
c += 1
break
print((n - c))
| false | 12.5 | [
"- for i in range(2, int(x**0.5 + 1)):",
"+ if x != 2 and x % 2 == 0:",
"+ c += 1",
"+ continue",
"+ for i in range(3, int(x**0.5 + 1), 2):"
] | false | 0.061459 | 0.033548 | 1.831983 | [
"s559344264",
"s731894858"
] |
u562935282 | p03170 | python | s465820337 | s456759479 | 1,922 | 94 | 3,828 | 4,596 | Accepted | Accepted | 95.11 | n, k = list(map(int, input().split()))
a = tuple(map(int, input().split()))
dp = [None] * (k + 1)
# dp[手番の石の数] := 手番の勝敗
# True(勝ち) / None(負け)
for my_remains in range(k + 1):
for my_take in a:
opponent_remains = my_remains - my_take # 相手が操作を行う石の数
if opponent_remains >= 0 and dp[opponent_... | n, k = list(map(int, input().split()))
a = tuple(map(int, input().split()))
dp = [None] * (k + k + 1)
# dp[手番の石の数] := 手番の勝敗
# True(勝ち) / None(負け)
for opponent_remains in range(k): # 自分が石を取った残りなので、k未満
if dp[opponent_remains] is None: # 相手が負ける場合
for my_take in a: # 自分が取る石の数
my_remai... | 15 | 15 | 419 | 459 | n, k = list(map(int, input().split()))
a = tuple(map(int, input().split()))
dp = [None] * (k + 1)
# dp[手番の石の数] := 手番の勝敗
# True(勝ち) / None(負け)
for my_remains in range(k + 1):
for my_take in a:
opponent_remains = my_remains - my_take # 相手が操作を行う石の数
if opponent_remains >= 0 and dp[opponent_remains] is ... | n, k = list(map(int, input().split()))
a = tuple(map(int, input().split()))
dp = [None] * (k + k + 1)
# dp[手番の石の数] := 手番の勝敗
# True(勝ち) / None(負け)
for opponent_remains in range(k): # 自分が石を取った残りなので、k未満
if dp[opponent_remains] is None: # 相手が負ける場合
for my_take in a: # 自分が取る石の数
my_remains = opponen... | false | 0 | [
"-dp = [None] * (k + 1)",
"+dp = [None] * (k + k + 1)",
"-for my_remains in range(k + 1):",
"- for my_take in a:",
"- opponent_remains = my_remains - my_take # 相手が操作を行う石の数",
"- if opponent_remains >= 0 and dp[opponent_remains] is None:",
"+for opponent_remains in range(k): # 自分が石を取った残... | false | 0.085912 | 0.033688 | 2.550222 | [
"s465820337",
"s456759479"
] |
u021019433 | p02744 | python | s595325686 | s649719014 | 195 | 119 | 17,992 | 14,688 | Accepted | Accepted | 38.97 | n = int(input())
r = 'a',
for _ in range(n - 1):
r = {s + c for s in r for c in s + chr(ord(max(s)) + 1)}
print(*sorted(r), sep='\n')
| n = int(input())
r = 'a',
for _ in range(n - 1):
r = [s + c for s in r for c in set(s + chr(ord(max(s)) + 1))]
print(*sorted(r), sep='\n')
| 5 | 5 | 140 | 145 | n = int(input())
r = ("a",)
for _ in range(n - 1):
r = {s + c for s in r for c in s + chr(ord(max(s)) + 1)}
print(*sorted(r), sep="\n")
| n = int(input())
r = ("a",)
for _ in range(n - 1):
r = [s + c for s in r for c in set(s + chr(ord(max(s)) + 1))]
print(*sorted(r), sep="\n")
| false | 0 | [
"- r = {s + c for s in r for c in s + chr(ord(max(s)) + 1)}",
"+ r = [s + c for s in r for c in set(s + chr(ord(max(s)) + 1))]"
] | false | 0.076784 | 0.127274 | 0.603298 | [
"s595325686",
"s649719014"
] |
u970197315 | p02881 | python | s326710359 | s172326618 | 261 | 143 | 3,060 | 3,060 | Accepted | Accepted | 45.21 | n=int(eval(input()))
ans=10**13
for i in range(1,int(n**0.5)+1):
j=n//i
if n%i==0:
ans=min(ans,i+j)
print((ans-2))
| n=int(eval(input()))
ans=10**18
for i in range(1,int(n**0.5)+1):
if n%i!=0:continue
j=n//i
t=i+j-2
ans=min(t,ans)
print(ans) | 7 | 8 | 129 | 141 | n = int(eval(input()))
ans = 10**13
for i in range(1, int(n**0.5) + 1):
j = n // i
if n % i == 0:
ans = min(ans, i + j)
print((ans - 2))
| n = int(eval(input()))
ans = 10**18
for i in range(1, int(n**0.5) + 1):
if n % i != 0:
continue
j = n // i
t = i + j - 2
ans = min(t, ans)
print(ans)
| false | 12.5 | [
"-ans = 10**13",
"+ans = 10**18",
"+ if n % i != 0:",
"+ continue",
"- if n % i == 0:",
"- ans = min(ans, i + j)",
"-print((ans - 2))",
"+ t = i + j - 2",
"+ ans = min(t, ans)",
"+print(ans)"
] | false | 0.05326 | 0.050362 | 1.057547 | [
"s326710359",
"s172326618"
] |
u099450021 | p03212 | python | s424625476 | s544076836 | 81 | 74 | 6,896 | 4,852 | Accepted | Accepted | 8.64 | Ns = eval(input())
N = int(Ns)
Nl = len(Ns)
ret = set()
def doit(t, f , s, now):
if t + f + s == 0:
if int(now) <= N:
ret.add(now)
return
if t > 0:
doit(t - 1, f, s, now + str(3))
if f > 0:
doit(t, f - 1, s, now + str(5))
if s > 0:
doit... | Ns = eval(input())
N = int(Ns)
Nl = len(Ns)
ret = []
def doit(t, f , s, now):
if t + f + s == 0:
if int(now) <= N:
ret.append(now)
return
if t > 0:
doit(t - 1, f, s, now + str(3))
if f > 0:
doit(t, f - 1, s, now + str(5))
if s > 0:
doit... | 24 | 23 | 561 | 559 | Ns = eval(input())
N = int(Ns)
Nl = len(Ns)
ret = set()
def doit(t, f, s, now):
if t + f + s == 0:
if int(now) <= N:
ret.add(now)
return
if t > 0:
doit(t - 1, f, s, now + str(3))
if f > 0:
doit(t, f - 1, s, now + str(5))
if s > 0:
doit(t, f, s - 1, n... | Ns = eval(input())
N = int(Ns)
Nl = len(Ns)
ret = []
def doit(t, f, s, now):
if t + f + s == 0:
if int(now) <= N:
ret.append(now)
return
if t > 0:
doit(t - 1, f, s, now + str(3))
if f > 0:
doit(t, f - 1, s, now + str(5))
if s > 0:
doit(t, f, s - 1, n... | false | 4.166667 | [
"-ret = set()",
"+ret = []",
"- ret.add(now)",
"+ ret.append(now)"
] | false | 0.008484 | 0.073899 | 0.114805 | [
"s424625476",
"s544076836"
] |
u466335531 | p03240 | python | s537934290 | s495355954 | 354 | 81 | 3,064 | 3,064 | Accepted | Accepted | 77.12 | N=int(eval(input()))
data=[]
for _ in range(N):
x,y,h=list(map(int,input().split()))
data.append([x,y,h])
def test():
for cx in range(101):
for cy in range(101):
for i in range(N):
if data[i][2]:
temph=data[i][2]+abs(data... | N=int(eval(input()))
data=[]
for _ in range(N):
x,y,h=list(map(int,input().split()))
data.append([x,y,h])
def test():
for cx in range(101):
for cy in range(101):
for i in range(N):
if data[i][2]:
temph=data[i][2]+abs(data... | 27 | 28 | 659 | 686 | N = int(eval(input()))
data = []
for _ in range(N):
x, y, h = list(map(int, input().split()))
data.append([x, y, h])
def test():
for cx in range(101):
for cy in range(101):
for i in range(N):
if data[i][2]:
temph = data[i][2] + abs(data[i][0] - cx) +... | N = int(eval(input()))
data = []
for _ in range(N):
x, y, h = list(map(int, input().split()))
data.append([x, y, h])
def test():
for cx in range(101):
for cy in range(101):
for i in range(N):
if data[i][2]:
temph = data[i][2] + abs(data[i][0] - cx) +... | false | 3.571429 | [
"+ break"
] | false | 0.084388 | 0.068969 | 1.223558 | [
"s537934290",
"s495355954"
] |
u116002573 | p02957 | python | s303742732 | s429454040 | 19 | 17 | 3,316 | 3,060 | Accepted | Accepted | 10.53 | ab = input().split()
A, B = int(ab[0]), int(ab[1])
if A == B:
print((1))
elif A % 2 != B % 2:
print("IMPOSSIBLE")
else:
K = (A+B) // 2
if abs(A-K) == abs(B-K):
print(K)
else:
print("IMPOSSIBLE") | ab = input().split()
A, B = int(ab[0]), int(ab[1])
out = None
if A == B:
out = None
elif A % 2 != B % 2:
out = "IMPOSSIBLE"
else:
K = (A+B) // 2
if abs(A-K) == abs(B-K):
out = K
else:
out = "IMPOSSIBLE"
print(out) | 13 | 16 | 241 | 266 | ab = input().split()
A, B = int(ab[0]), int(ab[1])
if A == B:
print((1))
elif A % 2 != B % 2:
print("IMPOSSIBLE")
else:
K = (A + B) // 2
if abs(A - K) == abs(B - K):
print(K)
else:
print("IMPOSSIBLE")
| ab = input().split()
A, B = int(ab[0]), int(ab[1])
out = None
if A == B:
out = None
elif A % 2 != B % 2:
out = "IMPOSSIBLE"
else:
K = (A + B) // 2
if abs(A - K) == abs(B - K):
out = K
else:
out = "IMPOSSIBLE"
print(out)
| false | 18.75 | [
"+out = None",
"- print((1))",
"+ out = None",
"- print(\"IMPOSSIBLE\")",
"+ out = \"IMPOSSIBLE\"",
"- print(K)",
"+ out = K",
"- print(\"IMPOSSIBLE\")",
"+ out = \"IMPOSSIBLE\"",
"+print(out)"
] | false | 0.051329 | 0.049339 | 1.040334 | [
"s303742732",
"s429454040"
] |
u414980766 | p02890 | python | s375331198 | s252490733 | 705 | 547 | 28,252 | 49,852 | Accepted | Accepted | 22.41 | N = int(eval(input()))
A = list(map(int, input().split()))
C = [0]*N
for a in A:
C[a - 1] += 1
D = [0]*(N + 1)
for c in C:
D[c] += 1
Dk_accum = [0]*(N + 1)
for i in range(1, N + 1):
Dk_accum[i] = Dk_accum[i - 1] + i*D[i]
D_sum = sum(D)
D_accum = [0]*(N + 2)
D_accum[0] = D_sum
for i in ... | from collections import Counter
N = int(eval(input()))
C = sorted(list(Counter(list(map(int, input().split()))).values()))
rest = N
removed = 0
for K in range(1, N + 1):
d = K - removed
while C and C[- 1] > rest//d:
rest -= C[- 1]
C.pop()
removed += 1
d -= 1
pri... | 29 | 14 | 571 | 320 | N = int(eval(input()))
A = list(map(int, input().split()))
C = [0] * N
for a in A:
C[a - 1] += 1
D = [0] * (N + 1)
for c in C:
D[c] += 1
Dk_accum = [0] * (N + 1)
for i in range(1, N + 1):
Dk_accum[i] = Dk_accum[i - 1] + i * D[i]
D_sum = sum(D)
D_accum = [0] * (N + 2)
D_accum[0] = D_sum
for i in range(1, N +... | from collections import Counter
N = int(eval(input()))
C = sorted(list(Counter(list(map(int, input().split()))).values()))
rest = N
removed = 0
for K in range(1, N + 1):
d = K - removed
while C and C[-1] > rest // d:
rest -= C[-1]
C.pop()
removed += 1
d -= 1
print((rest // d... | false | 51.724138 | [
"+from collections import Counter",
"+",
"-A = list(map(int, input().split()))",
"-C = [0] * N",
"-for a in A:",
"- C[a - 1] += 1",
"-D = [0] * (N + 1)",
"-for c in C:",
"- D[c] += 1",
"-Dk_accum = [0] * (N + 1)",
"-for i in range(1, N + 1):",
"- Dk_accum[i] = Dk_accum[i - 1] + i * D[... | false | 0.039193 | 0.04259 | 0.92024 | [
"s375331198",
"s252490733"
] |
u677121387 | p02755 | python | s041287419 | s271479306 | 22 | 18 | 2,940 | 3,060 | Accepted | Accepted | 18.18 | a,b = list(map(int,input().split()))
v = 1
while True:
if (v*0.08)//1 == a and (v*0.1)//1 == b:
ans = v
break
v += 1
if v > 10100:
ans = -1
break
print(ans)
| a,b = list(map(int,input().split()))
v = 1
for v in range(1,1010):
if (v*0.08)//1 == a and (v*0.1)//1 == b:
ans = v
break
else:
ans = -1
print(ans) | 11 | 9 | 205 | 173 | a, b = list(map(int, input().split()))
v = 1
while True:
if (v * 0.08) // 1 == a and (v * 0.1) // 1 == b:
ans = v
break
v += 1
if v > 10100:
ans = -1
break
print(ans)
| a, b = list(map(int, input().split()))
v = 1
for v in range(1, 1010):
if (v * 0.08) // 1 == a and (v * 0.1) // 1 == b:
ans = v
break
else:
ans = -1
print(ans)
| false | 18.181818 | [
"-while True:",
"+for v in range(1, 1010):",
"- v += 1",
"- if v > 10100:",
"- ans = -1",
"- break",
"+else:",
"+ ans = -1"
] | false | 0.080117 | 0.09917 | 0.807876 | [
"s041287419",
"s271479306"
] |
u057964173 | p03971 | python | s096977092 | s946882030 | 99 | 88 | 4,712 | 4,704 | Accepted | Accepted | 11.11 | def resolve():
n,a,b=list(map(int, input().split()))
s=list(eval(input()))
cnt=0
cnt_b=0
for i in range(n):
if s[i]=='c':
print('No')
elif s[i]=='a':
if cnt<a+b:
print('Yes')
cnt+=1
else:
... | def resolve():
n,a,b=list(map(int, input().split()))
s=list(eval(input()))
cnt=0
cnt_b=0
for i in range(n):
if s[i]=='b' and cnt<a+b and cnt_b<b:
print('Yes')
cnt+=1
cnt_b+=1
elif s[i]=='a' and cnt<a+b:
print('Yes')
... | 22 | 16 | 511 | 369 | def resolve():
n, a, b = list(map(int, input().split()))
s = list(eval(input()))
cnt = 0
cnt_b = 0
for i in range(n):
if s[i] == "c":
print("No")
elif s[i] == "a":
if cnt < a + b:
print("Yes")
cnt += 1
else:
... | def resolve():
n, a, b = list(map(int, input().split()))
s = list(eval(input()))
cnt = 0
cnt_b = 0
for i in range(n):
if s[i] == "b" and cnt < a + b and cnt_b < b:
print("Yes")
cnt += 1
cnt_b += 1
elif s[i] == "a" and cnt < a + b:
print... | false | 27.272727 | [
"- if s[i] == \"c\":",
"+ if s[i] == \"b\" and cnt < a + b and cnt_b < b:",
"+ print(\"Yes\")",
"+ cnt += 1",
"+ cnt_b += 1",
"+ elif s[i] == \"a\" and cnt < a + b:",
"+ print(\"Yes\")",
"+ cnt += 1",
"+ else:",
"- ... | false | 0.034589 | 0.036075 | 0.958799 | [
"s096977092",
"s946882030"
] |
u963009166 | p03457 | python | s015785587 | s912412925 | 237 | 161 | 3,064 | 3,316 | Accepted | Accepted | 32.07 | import sys
input = sys.stdin.readline
class Deer:
def __init__(self):
self.x = 0
self.y = 0
self.t = 0
def move(self, ti, xi, yi):
time_interval = ti - self.t
manhattan_distance = abs(xi - self.x) + abs(yi - self.y)
val = time_interval - manhattan_di... | import sys
input = sys.stdin.readline
N = int(eval(input()))
flag = True
for _ in range(N):
t, x, y = list(map(int, input().split()))
if (t < x + y) or (x + y + t) % 2:
flag = False
if flag:
print('Yes')
else:
print('No')
| 34 | 16 | 732 | 253 | import sys
input = sys.stdin.readline
class Deer:
def __init__(self):
self.x = 0
self.y = 0
self.t = 0
def move(self, ti, xi, yi):
time_interval = ti - self.t
manhattan_distance = abs(xi - self.x) + abs(yi - self.y)
val = time_interval - manhattan_distance
... | import sys
input = sys.stdin.readline
N = int(eval(input()))
flag = True
for _ in range(N):
t, x, y = list(map(int, input().split()))
if (t < x + y) or (x + y + t) % 2:
flag = False
if flag:
print("Yes")
else:
print("No")
| false | 52.941176 | [
"-",
"-",
"-class Deer:",
"- def __init__(self):",
"- self.x = 0",
"- self.y = 0",
"- self.t = 0",
"-",
"- def move(self, ti, xi, yi):",
"- time_interval = ti - self.t",
"- manhattan_distance = abs(xi - self.x) + abs(yi - self.y)",
"- val = time_... | false | 0.06943 | 0.035813 | 1.93867 | [
"s015785587",
"s912412925"
] |
u248424983 | p02418 | python | s173728514 | s025067333 | 30 | 20 | 7,468 | 5,560 | Accepted | Accepted | 33.33 | p=eval(input())
s=eval(input())
ret = 'Yes'
try: (p+p).index(s)
except : ret = 'No'
print(ret) | s = eval(input())
p = eval(input())
ret = 'No'
tts = s + s[:len(p)]
if p in tts: ret = 'Yes'
print(ret)
| 7 | 6 | 89 | 97 | p = eval(input())
s = eval(input())
ret = "Yes"
try:
(p + p).index(s)
except:
ret = "No"
print(ret)
| s = eval(input())
p = eval(input())
ret = "No"
tts = s + s[: len(p)]
if p in tts:
ret = "Yes"
print(ret)
| false | 14.285714 | [
"+s = eval(input())",
"-s = eval(input())",
"-ret = \"Yes\"",
"-try:",
"- (p + p).index(s)",
"-except:",
"- ret = \"No\"",
"+ret = \"No\"",
"+tts = s + s[: len(p)]",
"+if p in tts:",
"+ ret = \"Yes\""
] | false | 0.046673 | 0.110516 | 0.422315 | [
"s173728514",
"s025067333"
] |
u852690916 | p02763 | python | s314920739 | s413906125 | 672 | 468 | 116,300 | 116,300 | Accepted | Accepted | 30.36 | def main():
N = int(eval(input()))
S = eval(input())
tree = SegmentTree(initial_values=S, f=lambda x,y:x|y, converter=lambda c: 1 << (ord(c)-ord('a')))
Q = int(eval(input()))
update = tree.update
query = tree.query
for _ in range(Q):
t, a, b = input().split()
if t ==... | import sys
def main():
input = sys.stdin.readline
N = int(eval(input()))
S = input().rstrip()
tree = SegmentTree(initial_values=S, f=lambda x,y:x|y, converter=lambda c: 1 << (ord(c)-ord('a')))
Q = int(eval(input()))
update = tree.update
query = tree.query
for _ in range(Q):
... | 44 | 47 | 1,695 | 1,760 | def main():
N = int(eval(input()))
S = eval(input())
tree = SegmentTree(
initial_values=S,
f=lambda x, y: x | y,
converter=lambda c: 1 << (ord(c) - ord("a")),
)
Q = int(eval(input()))
update = tree.update
query = tree.query
for _ in range(Q):
t, a, b = inp... | import sys
def main():
input = sys.stdin.readline
N = int(eval(input()))
S = input().rstrip()
tree = SegmentTree(
initial_values=S,
f=lambda x, y: x | y,
converter=lambda c: 1 << (ord(c) - ord("a")),
)
Q = int(eval(input()))
update = tree.update
query = tree.que... | false | 6.382979 | [
"+import sys",
"+",
"+",
"+ input = sys.stdin.readline",
"- S = eval(input())",
"+ S = input().rstrip()",
"- t, a, b = input().split()",
"+ t, a, b = input().rstrip().split()"
] | false | 0.044751 | 0.083718 | 0.534548 | [
"s314920739",
"s413906125"
] |
u216015528 | p03162 | python | s266761273 | s221937243 | 1,923 | 984 | 49,300 | 50,312 | Accepted | Accepted | 48.83 | def resolve():
import sys
import itertools
import numpy as np
readline = sys.stdin.readline
N = int(readline())
lst = [list(map(int, readline().split())) for _ in [0] * N]
dp = np.full((N, 3), -1, np.int32)
for i in range(N):
for a, b in itertools.permutations([0, ... | #!/usr/bin/env python3
def main():
import numpy as np
N = int(eval(input()))
happiness = [list(map(int, input().split())) for _ in range(N)]
dp = np.zeros((N, 3), dtype=np.int64)
dp[0] = happiness[0]
for i in range(1, N):
for a, yesterday in enumerate(dp[i - 1]):
... | 22 | 20 | 567 | 543 | def resolve():
import sys
import itertools
import numpy as np
readline = sys.stdin.readline
N = int(readline())
lst = [list(map(int, readline().split())) for _ in [0] * N]
dp = np.full((N, 3), -1, np.int32)
for i in range(N):
for a, b in itertools.permutations([0, 1, 2], 2):
... | #!/usr/bin/env python3
def main():
import numpy as np
N = int(eval(input()))
happiness = [list(map(int, input().split())) for _ in range(N)]
dp = np.zeros((N, 3), dtype=np.int64)
dp[0] = happiness[0]
for i in range(1, N):
for a, yesterday in enumerate(dp[i - 1]):
for b, toda... | false | 9.090909 | [
"-def resolve():",
"- import sys",
"- import itertools",
"+#!/usr/bin/env python3",
"+def main():",
"- readline = sys.stdin.readline",
"- N = int(readline())",
"- lst = [list(map(int, readline().split())) for _ in [0] * N]",
"- dp = np.full((N, 3), -1, np.int32)",
"- for i in ... | false | 0.935784 | 0.766117 | 1.221463 | [
"s266761273",
"s221937243"
] |
u349449706 | p02888 | python | s842305429 | s654211582 | 741 | 372 | 74,988 | 74,748 | Accepted | Accepted | 49.8 | def is_ok1(a,b,c):
return L[b] < L[c] + L[a]
def is_ok2(a,b,c):
return L[c] < L[a] + L[b]
def meguru_bisect(ng, ok, is_ok, a, b):
'''
初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す
まずis_okを定義すべし
ng ok は とり得る最小の値-1 とり得る最大の値+1
最大最小が逆の場合はよしなにひっくり返す
'''
while (abs(ok - ng) > 1):
... | def is_ok(a,b,c):
return L[a] < L[b] + L[c]
def meguru_bisect(ng, ok, a, b):
'''
初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す
まずis_okを定義すべし
ng ok は とり得る最小の値-1 とり得る最大の値+1
最大最小が逆の場合はよしなにひっくり返す
'''
while (abs(ok - ng) > 1):
mid = (ok + ng) // 2
if is_ok(a, b, mid):
... | 25 | 23 | 675 | 577 | def is_ok1(a, b, c):
return L[b] < L[c] + L[a]
def is_ok2(a, b, c):
return L[c] < L[a] + L[b]
def meguru_bisect(ng, ok, is_ok, a, b):
"""
初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す
まずis_okを定義すべし
ng ok は とり得る最小の値-1 とり得る最大の値+1
最大最小が逆の場合はよしなにひっくり返す
"""
while abs(ok - ng) > 1:
mid... | def is_ok(a, b, c):
return L[a] < L[b] + L[c]
def meguru_bisect(ng, ok, a, b):
"""
初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す
まずis_okを定義すべし
ng ok は とり得る最小の値-1 とり得る最大の値+1
最大最小が逆の場合はよしなにひっくり返す
"""
while abs(ok - ng) > 1:
mid = (ok + ng) // 2
if is_ok(a, b, mid):
ok... | false | 8 | [
"-def is_ok1(a, b, c):",
"- return L[b] < L[c] + L[a]",
"+def is_ok(a, b, c):",
"+ return L[a] < L[b] + L[c]",
"-def is_ok2(a, b, c):",
"- return L[c] < L[a] + L[b]",
"-",
"-",
"-def meguru_bisect(ng, ok, is_ok, a, b):",
"+def meguru_bisect(ng, ok, a, b):",
"-L = sorted(list(map(int, in... | false | 0.068258 | 0.049383 | 1.382238 | [
"s842305429",
"s654211582"
] |
u353919145 | p03555 | python | s004185346 | s475624966 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | a=eval(input())
b=eval(input())
rev = ''.join(reversed(a))
if rev==b:
print("YES")
else:
print("NO") | str1=eval(input())
str2=eval(input())
str2=str2[::-1]
if(str1==str2):
print('YES')
else:
print('NO') | 7 | 9 | 102 | 106 | a = eval(input())
b = eval(input())
rev = "".join(reversed(a))
if rev == b:
print("YES")
else:
print("NO")
| str1 = eval(input())
str2 = eval(input())
str2 = str2[::-1]
if str1 == str2:
print("YES")
else:
print("NO")
| false | 22.222222 | [
"-a = eval(input())",
"-b = eval(input())",
"-rev = \"\".join(reversed(a))",
"-if rev == b:",
"+str1 = eval(input())",
"+str2 = eval(input())",
"+str2 = str2[::-1]",
"+if str1 == str2:"
] | false | 0.066934 | 0.065527 | 1.021472 | [
"s004185346",
"s475624966"
] |
u131984977 | p02414 | python | s558625795 | s712435472 | 550 | 430 | 7,760 | 8,372 | Accepted | Accepted | 21.82 | (n, m, l) = [int(i) for i in input().split()]
A = []
for nc in range(n):
A.append([int(i) for i in input().split()])
B = []
for mc in range(m):
B.append([int(i) for i in input().split()])
product = [[0 for d in range(l)] for dd in range(n)]
for nc in range(n):
for lc in range(l):
f... | (n, m, l) = [int(i) for i in input().split()]
A = []
B = []
for _ in range(n):
A.append([int(i) for i in input().split()])
for _ in range(m):
B.append([int(i) for i in input().split()])
for i in range(n):
C = [0 for _ in range(l)]
for j in range(l):
for k in range(m):
... | 19 | 15 | 455 | 387 | (n, m, l) = [int(i) for i in input().split()]
A = []
for nc in range(n):
A.append([int(i) for i in input().split()])
B = []
for mc in range(m):
B.append([int(i) for i in input().split()])
product = [[0 for d in range(l)] for dd in range(n)]
for nc in range(n):
for lc in range(l):
for mc in range(m):... | (n, m, l) = [int(i) for i in input().split()]
A = []
B = []
for _ in range(n):
A.append([int(i) for i in input().split()])
for _ in range(m):
B.append([int(i) for i in input().split()])
for i in range(n):
C = [0 for _ in range(l)]
for j in range(l):
for k in range(m):
C[j] += A[i][k]... | false | 21.052632 | [
"-for nc in range(n):",
"+B = []",
"+for _ in range(n):",
"-B = []",
"-for mc in range(m):",
"+for _ in range(m):",
"-product = [[0 for d in range(l)] for dd in range(n)]",
"-for nc in range(n):",
"- for lc in range(l):",
"- for mc in range(m):",
"- product[nc][lc] += A[nc][... | false | 0.04703 | 0.045885 | 1.024957 | [
"s558625795",
"s712435472"
] |
u936985471 | p04035 | python | s511420041 | s678427575 | 122 | 100 | 14,060 | 19,856 | Accepted | Accepted | 18.03 | n,l=list(map(int,input().split()))
a=list(map(int,input().split()))
last=-1
for i in range(n-1):
if a[i]+a[i+1]>=l:
last=i+1
break
if last==-1:
print("Impossible")
else:
print("Possible")
for i in range(1,last):
print(i)
for i in range(len(a)-1,last-1,-1):
print(i)
| import sys
readline = sys.stdin.readline
N,L = list(map(int,readline().split()))
A = list(map(int,readline().split()))
# 2個でL以上の隣合うペアがどこかにあれば、そこを最後に残せば大丈夫
target = -1
for i in range(1,len(A)):
if A[i] + A[i - 1] >= L:
target = i
break
if target == -1:
print("Impossible")
exit(0)
left = ... | 15 | 30 | 300 | 528 | n, l = list(map(int, input().split()))
a = list(map(int, input().split()))
last = -1
for i in range(n - 1):
if a[i] + a[i + 1] >= l:
last = i + 1
break
if last == -1:
print("Impossible")
else:
print("Possible")
for i in range(1, last):
print(i)
for i in range(len(a) - 1, last... | import sys
readline = sys.stdin.readline
N, L = list(map(int, readline().split()))
A = list(map(int, readline().split()))
# 2個でL以上の隣合うペアがどこかにあれば、そこを最後に残せば大丈夫
target = -1
for i in range(1, len(A)):
if A[i] + A[i - 1] >= L:
target = i
break
if target == -1:
print("Impossible")
exit(0)
left = ... | false | 50 | [
"-n, l = list(map(int, input().split()))",
"-a = list(map(int, input().split()))",
"-last = -1",
"-for i in range(n - 1):",
"- if a[i] + a[i + 1] >= l:",
"- last = i + 1",
"+import sys",
"+",
"+readline = sys.stdin.readline",
"+N, L = list(map(int, readline().split()))",
"+A = list(map... | false | 0.04964 | 0.050144 | 0.989967 | [
"s511420041",
"s678427575"
] |
u392319141 | p03946 | python | s361854109 | s052611497 | 118 | 94 | 15,020 | 14,244 | Accepted | Accepted | 20.34 | N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
mx = [0] * (N + 1)
for i, a in enumerate(A[::-1], start=1):
mx[-i] = max(mx[-i + 1], a)
mxD = 0
ans = 0
for i, a in enumerate(A):
d = mx[i + 1] - a
if mxD < d:
mxD = d
ans = 0
if mxD == d:
... | N, _ = list(map(int, input().split()))
A = list(map(int, input().split()))
mi = 10**18
mx = -10**18
ans = 0
for a in A:
if mx < a - mi:
ans = 0
mx = a - mi
if mx == a - mi:
ans += 1
mi = min(mi, a)
print(ans)
| 18 | 15 | 338 | 255 | N, T = list(map(int, input().split()))
A = list(map(int, input().split()))
mx = [0] * (N + 1)
for i, a in enumerate(A[::-1], start=1):
mx[-i] = max(mx[-i + 1], a)
mxD = 0
ans = 0
for i, a in enumerate(A):
d = mx[i + 1] - a
if mxD < d:
mxD = d
ans = 0
if mxD == d:
ans += 1
print(a... | N, _ = list(map(int, input().split()))
A = list(map(int, input().split()))
mi = 10**18
mx = -(10**18)
ans = 0
for a in A:
if mx < a - mi:
ans = 0
mx = a - mi
if mx == a - mi:
ans += 1
mi = min(mi, a)
print(ans)
| false | 16.666667 | [
"-N, T = list(map(int, input().split()))",
"+N, _ = list(map(int, input().split()))",
"-mx = [0] * (N + 1)",
"-for i, a in enumerate(A[::-1], start=1):",
"- mx[-i] = max(mx[-i + 1], a)",
"-mxD = 0",
"+mi = 10**18",
"+mx = -(10**18)",
"-for i, a in enumerate(A):",
"- d = mx[i + 1] - a",
"- ... | false | 0.039657 | 0.046339 | 0.855802 | [
"s361854109",
"s052611497"
] |
u046187684 | p03472 | python | s708588535 | s188436676 | 1,025 | 229 | 21,660 | 27,268 | Accepted | Accepted | 77.66 | #!/usr/bin/env python3
# coding=utf-8
import sys
import math
import numpy as np
n, h = list(map(int, sys.stdin.readline().strip().split(" ")))
a = []
b = []
for _ in range(n):
_a, _b = list(map(int, sys.stdin.readline().strip().split(" ")))
a.append(_a)
b.append(_b)
max_a = max(a)
cnt = 0
b ... | from math import ceil
def solve(string):
n, h, * ab = list(map(int, string.split()))
max_a = max(ab[::2])
cnt = 0
b = sorted([b for b in ab[1::2] if b > max_a], reverse=True)
if sum(b) < h:
cnt = len(b) + ceil((h-sum(b)) / max_a)
else:
for _b in b:
cnt +... | 24 | 22 | 481 | 558 | #!/usr/bin/env python3
# coding=utf-8
import sys
import math
import numpy as np
n, h = list(map(int, sys.stdin.readline().strip().split(" ")))
a = []
b = []
for _ in range(n):
_a, _b = list(map(int, sys.stdin.readline().strip().split(" ")))
a.append(_a)
b.append(_b)
max_a = max(a)
cnt = 0
b = np.asarray(so... | from math import ceil
def solve(string):
n, h, *ab = list(map(int, string.split()))
max_a = max(ab[::2])
cnt = 0
b = sorted([b for b in ab[1::2] if b > max_a], reverse=True)
if sum(b) < h:
cnt = len(b) + ceil((h - sum(b)) / max_a)
else:
for _b in b:
cnt += 1
... | false | 8.333333 | [
"-#!/usr/bin/env python3",
"-# coding=utf-8",
"-import sys",
"-import math",
"-import numpy as np",
"+from math import ceil",
"-n, h = list(map(int, sys.stdin.readline().strip().split(\" \")))",
"-a = []",
"-b = []",
"-for _ in range(n):",
"- _a, _b = list(map(int, sys.stdin.readline().strip(... | false | 0.305796 | 0.03844 | 7.955072 | [
"s708588535",
"s188436676"
] |
u077291787 | p02756 | python | s429034890 | s182633371 | 387 | 83 | 8,564 | 21,224 | Accepted | Accepted | 78.55 | # D - String Formation
from collections import deque
def main():
S = input().rstrip()
Q = int(eval(input()))
queue = deque(S)
is_reversed = 0
for _ in range(Q):
query = input().split()
if query[0] == "1":
is_reversed ^= 1
continue
com, ... | # D - String Formation
import sys
from collections import deque
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
S = readline().rstrip()
_ = readline()
queries = readlines()
queue = deque(S)
to_beginning, to_end = queue.appendleft, queue.append
is_revers... | 31 | 31 | 755 | 755 | # D - String Formation
from collections import deque
def main():
S = input().rstrip()
Q = int(eval(input()))
queue = deque(S)
is_reversed = 0
for _ in range(Q):
query = input().split()
if query[0] == "1":
is_reversed ^= 1
continue
com, c = query[1], ... | # D - String Formation
import sys
from collections import deque
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
S = readline().rstrip()
_ = readline()
queries = readlines()
queue = deque(S)
to_beginning, to_end = queue.appendleft, queue.append
is_reversed = 0
for... | false | 0 | [
"+import sys",
"+",
"+readline = sys.stdin.readline",
"+readlines = sys.stdin.readlines",
"- S = input().rstrip()",
"- Q = int(eval(input()))",
"+ S = readline().rstrip()",
"+ _ = readline()",
"+ queries = readlines()",
"+ to_beginning, to_end = queue.appendleft, queue.append",
... | false | 0.044775 | 0.037872 | 1.182278 | [
"s429034890",
"s182633371"
] |
u179750651 | p02712 | python | s308840515 | s129586468 | 147 | 135 | 53,580 | 52,624 | Accepted | Accepted | 8.16 | n=int(eval(input()))
n=list(range(1,n+1))
n=([i for i in n if i % 3 != 0])
n=([i for i in n if i % 5 != 0])
print((sum(n))) | n=int(eval(input()))
n=list(range(1,n+1))
n=([i for i in n if i % 3 != 0 and i % 5 != 0])
print((sum(n)))
| 5 | 4 | 119 | 101 | n = int(eval(input()))
n = list(range(1, n + 1))
n = [i for i in n if i % 3 != 0]
n = [i for i in n if i % 5 != 0]
print((sum(n)))
| n = int(eval(input()))
n = list(range(1, n + 1))
n = [i for i in n if i % 3 != 0 and i % 5 != 0]
print((sum(n)))
| false | 20 | [
"-n = [i for i in n if i % 3 != 0]",
"-n = [i for i in n if i % 5 != 0]",
"+n = [i for i in n if i % 3 != 0 and i % 5 != 0]"
] | false | 0.111569 | 0.101394 | 1.100353 | [
"s308840515",
"s129586468"
] |
u782098901 | p03244 | python | s885073796 | s348528765 | 118 | 108 | 20,700 | 20,700 | Accepted | Accepted | 8.47 | import collections
n = int(eval(input()))
v = list(map(int, input().split()))
v1 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 0]).most_common()
v2 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 1]).most_common()
v1.append((0, 0))
v2.append((0, 0))
max_v1 = v1[0][1]
max_v2 = v2[... | import collections
n = int(eval(input()))
v = list(map(int, input().split()))
v1 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 0]).most_common()
v2 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 1]).most_common()
v1.append((0, 0))
v2.append((0, 0))
if v1[0][0] != v2[0][0]:
... | 30 | 13 | 700 | 419 | import collections
n = int(eval(input()))
v = list(map(int, input().split()))
v1 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 0]).most_common()
v2 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 1]).most_common()
v1.append((0, 0))
v2.append((0, 0))
max_v1 = v1[0][1]
max_v2 = v2[0][1]
if ... | import collections
n = int(eval(input()))
v = list(map(int, input().split()))
v1 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 0]).most_common()
v2 = collections.Counter([x for i, x in enumerate(v) if i % 2 == 1]).most_common()
v1.append((0, 0))
v2.append((0, 0))
if v1[0][0] != v2[0][0]:
print((n -... | false | 56.666667 | [
"-max_v1 = v1[0][1]",
"-max_v2 = v2[0][1]",
"-if v1[0][0] == v2[0][0]:",
"- if max_v1 == max_v2:",
"- if v1[1][1] >= v2[1][1]:",
"- max_v1 = v1[1][1]",
"- else:",
"- max_v2 = v2[1][1]",
"- elif max_v1 > max_v2:",
"- max_v2 = v2[1][1]",
"- elif ... | false | 0.035697 | 0.061657 | 0.578959 | [
"s885073796",
"s348528765"
] |
u141574039 | p02818 | python | s094469676 | s400297832 | 24 | 17 | 2,940 | 3,060 | Accepted | Accepted | 29.17 | A,B,K=list(map(int,input().split()))
C=A+B-K
if C<=0:
A=0
B=0
else:
if A>=K:
A=A-K
else:
B=B-(K-A)
A=0
print((A,B)) | A,B,K=list(map(int,input().split()))
t,a=0,0
if K>(A+B):
print((t,a))
else:
if K>=A:
t=0
a=B+(A-K)
else:
t=A-K
a=B
print((t,a)) | 12 | 12 | 138 | 152 | A, B, K = list(map(int, input().split()))
C = A + B - K
if C <= 0:
A = 0
B = 0
else:
if A >= K:
A = A - K
else:
B = B - (K - A)
A = 0
print((A, B))
| A, B, K = list(map(int, input().split()))
t, a = 0, 0
if K > (A + B):
print((t, a))
else:
if K >= A:
t = 0
a = B + (A - K)
else:
t = A - K
a = B
print((t, a))
| false | 0 | [
"-C = A + B - K",
"-if C <= 0:",
"- A = 0",
"- B = 0",
"+t, a = 0, 0",
"+if K > (A + B):",
"+ print((t, a))",
"- if A >= K:",
"- A = A - K",
"+ if K >= A:",
"+ t = 0",
"+ a = B + (A - K)",
"- B = B - (K - A)",
"- A = 0",
"-print((A, B))",... | false | 0.036944 | 0.059294 | 0.623063 | [
"s094469676",
"s400297832"
] |
u130900604 | p02640 | python | s143451716 | s609565555 | 76 | 56 | 64,744 | 61,856 | Accepted | Accepted | 26.32 | def LI():return list(map(int,input().split()))
def MI():return list(map(int,open(0).read().split()))
def I():return int(eval(input()))
def yes():print("Yes")
def no():print("No")
from collections import deque, Counter
from heapq import heappop, heappush
INF=float("inf")
# import math
# pi=math.pi
# import... | x,y=list(map(int,input().split()))
for a in range(0,x+1):
b=x-a
if 2*a+4*b==y:
print("Yes")
exit()
print("No") | 24 | 7 | 448 | 134 | def LI():
return list(map(int, input().split()))
def MI():
return list(map(int, open(0).read().split()))
def I():
return int(eval(input()))
def yes():
print("Yes")
def no():
print("No")
from collections import deque, Counter
from heapq import heappop, heappush
INF = float("inf")
# import ... | x, y = list(map(int, input().split()))
for a in range(0, x + 1):
b = x - a
if 2 * a + 4 * b == y:
print("Yes")
exit()
print("No")
| false | 70.833333 | [
"-def LI():",
"- return list(map(int, input().split()))",
"-",
"-",
"-def MI():",
"- return list(map(int, open(0).read().split()))",
"-",
"-",
"-def I():",
"- return int(eval(input()))",
"-",
"-",
"-def yes():",
"- print(\"Yes\")",
"-",
"-",
"-def no():",
"- print(\"... | false | 0.038207 | 0.0745 | 0.512855 | [
"s143451716",
"s609565555"
] |
u730769327 | p03575 | python | s924296769 | s163972439 | 1,199 | 107 | 59,612 | 75,400 | Accepted | Accepted | 91.08 | n,m=list(map(int,input().split()))
e=[[] for _ in range(n)]
b=[]
for i in range(m):
x,y=list(map(int,input().split()))
e[x-1].append(y-1)
e[y-1].append(x-1)
b.append([x-1,y-1])
def ne(now,s,visit):
visit.append(now)
for i in e[now]:
if i not in visit:
ne(i, s, visit[:])
elif l... | from itertools import combinations
class UnionFind():
def __init__(self, n):
self.n = n
self.root = [-1]*(n+1)
self.rnk = [0]*(n+1)
def Find_Root(self, x):
if(self.root[x] < 0):
return x
else:
self.root[x] = self.Find_Root(self.root[x])
... | 27 | 45 | 594 | 1,279 | n, m = list(map(int, input().split()))
e = [[] for _ in range(n)]
b = []
for i in range(m):
x, y = list(map(int, input().split()))
e[x - 1].append(y - 1)
e[y - 1].append(x - 1)
b.append([x - 1, y - 1])
def ne(now, s, visit):
visit.append(now)
for i in e[now]:
if i not in visit:
... | from itertools import combinations
class UnionFind:
def __init__(self, n):
self.n = n
self.root = [-1] * (n + 1)
self.rnk = [0] * (n + 1)
def Find_Root(self, x):
if self.root[x] < 0:
return x
else:
self.root[x] = self.Find_Root(self.root[x])
... | false | 40 | [
"-n, m = list(map(int, input().split()))",
"-e = [[] for _ in range(n)]",
"-b = []",
"-for i in range(m):",
"- x, y = list(map(int, input().split()))",
"- e[x - 1].append(y - 1)",
"- e[y - 1].append(x - 1)",
"- b.append([x - 1, y - 1])",
"+from itertools import combinations",
"-def ne(... | false | 0.052612 | 0.007855 | 6.698214 | [
"s924296769",
"s163972439"
] |
u577170763 | p02921 | python | s164867889 | s415723448 | 180 | 21 | 38,384 | 3,436 | Accepted | Accepted | 88.33 | import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)
def geta(fn=lambda s: s.decode()):
return list(map(fn, readline().split()))
def gete(fn=lambda s: s.decode()):
return fn(readline().rstrip())
def main():
s = gete()
t =... | import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)
def geta(fn=lambda s: s.decode()):
return list(map(fn, readline().split()))
def gete(fn=lambda s: s.decode()):
return fn(readline().rstrip())
def main():
s = gete()
t =... | 27 | 26 | 473 | 455 | import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**8)
def geta(fn=lambda s: s.decode()):
return list(map(fn, readline().split()))
def gete(fn=lambda s: s.decode()):
return fn(readline().rstrip())
def main():
s = gete()
t = gete()
ans ... | import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**8)
def geta(fn=lambda s: s.decode()):
return list(map(fn, readline().split()))
def gete(fn=lambda s: s.decode()):
return fn(readline().rstrip())
def main():
s = gete()
t = gete()
ans ... | false | 3.703704 | [
"- for i in range(len(s)):",
"+ for i in range(3):"
] | false | 0.035564 | 0.035385 | 1.005058 | [
"s164867889",
"s415723448"
] |
u440566786 | p02886 | python | s520602319 | s870853725 | 183 | 164 | 39,024 | 38,384 | Accepted | Accepted | 10.38 | import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# input=lambda :sys.stdin.readline().rstrip()
def resolve():
n=int(eval(input()))
D=list(map(int,input().split()))
ans=0
for i in range(n):
for j in range(i+1,n):
ans+=D[i]*D[j]
print(ans)
reso... | import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
n=int(eval(input()))
A=list(map(int,input().split()))
s=sum(A)
t=sum(a**2 for a in A)
print(((s**2-t)//2))
resolve() | 14 | 12 | 319 | 271 | import sys
sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
# input=lambda :sys.stdin.readline().rstrip()
def resolve():
n = int(eval(input()))
D = list(map(int, input().split()))
ans = 0
for i in range(n):
for j in range(i + 1, n):
ans += D[i] * D[j]
print(a... | import sys
sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
input = lambda: sys.stdin.readline().rstrip()
def resolve():
n = int(eval(input()))
A = list(map(int, input().split()))
s = sum(A)
t = sum(a**2 for a in A)
print(((s**2 - t) // 2))
resolve()
| false | 14.285714 | [
"-# input=lambda :sys.stdin.readline().rstrip()",
"+input = lambda: sys.stdin.readline().rstrip()",
"+",
"+",
"- D = list(map(int, input().split()))",
"- ans = 0",
"- for i in range(n):",
"- for j in range(i + 1, n):",
"- ans += D[i] * D[j]",
"- print(ans)",
"+ A... | false | 0.043122 | 0.044979 | 0.958711 | [
"s520602319",
"s870853725"
] |
u627600101 | p02574 | python | s827306757 | s795284731 | 588 | 443 | 215,580 | 205,108 | Accepted | Accepted | 24.66 | from math import gcd
from collections import deque
# = map(int, input().split())
N = int(eval(input()))
A = deque(list(map(int, input().split())))
mA = max(A)
counter = [0 for _ in range(mA+1)]
primenum = [2]
sgn = [-1 for _ in range(int(mA**0.5)+1)]
k = 3
while k**2 <= mA:
if sgn[k] == -1:
primenum.a... | from math import gcd
# = map(int, input().split())
N = int(eval(input()))
A = list(map(int, input().split()))
flag = True
c2 = 0
c3 = 0
c5 = 0
for k in range(N):
if A[k] %2 ==0:
c2 += 1
if c2 > 1:
flag = False
break
elif A[k] %3 ==0:
c3 += 1
if c3 > 1:
flag = F... | 62 | 83 | 1,099 | 1,433 | from math import gcd
from collections import deque
# = map(int, input().split())
N = int(eval(input()))
A = deque(list(map(int, input().split())))
mA = max(A)
counter = [0 for _ in range(mA + 1)]
primenum = [2]
sgn = [-1 for _ in range(int(mA**0.5) + 1)]
k = 3
while k**2 <= mA:
if sgn[k] == -1:
primenum.ap... | from math import gcd
# = map(int, input().split())
N = int(eval(input()))
A = list(map(int, input().split()))
flag = True
c2 = 0
c3 = 0
c5 = 0
for k in range(N):
if A[k] % 2 == 0:
c2 += 1
if c2 > 1:
flag = False
break
elif A[k] % 3 == 0:
c3 += 1
if c3 > 1... | false | 25.301205 | [
"-from collections import deque",
"-A = deque(list(map(int, input().split())))",
"-mA = max(A)",
"-counter = [0 for _ in range(mA + 1)]",
"-primenum = [2]",
"-sgn = [-1 for _ in range(int(mA**0.5) + 1)]",
"-k = 3",
"-while k**2 <= mA:",
"- if sgn[k] == -1:",
"- primenum.append(k)",
"- ... | false | 0.040861 | 0.123148 | 0.331808 | [
"s827306757",
"s795284731"
] |
u019637926 | p03166 | python | s593755657 | s973829396 | 878 | 590 | 143,904 | 135,344 | Accepted | Accepted | 32.8 | import sys
sys.setrecursionlimit(10 ** 5 * 2)
N, M = list(map(int, input().split()))
Ps = [[] for _ in range(N)]
for i in range(M):
x, y = list(map(int, input().split()))
Ps[x - 1].append(y - 1)
mem = [-1] * N
def rec(n):
if mem[n] > -1:
return mem[n]
elif len(Ps[n]) == 0:
... | import sys
sys.setrecursionlimit(10 ** 5 * 2)
input = sys.stdin.readline
N, M = list(map(int, input().split()))
Ps = [[] for _ in range(N)]
for i in range(M):
x, y = list(map(int, input().split()))
Ps[x - 1].append(y - 1)
mem = [-1] * N
def rec(n):
if mem[n] > -1:
return mem[n]
... | 26 | 27 | 504 | 532 | import sys
sys.setrecursionlimit(10**5 * 2)
N, M = list(map(int, input().split()))
Ps = [[] for _ in range(N)]
for i in range(M):
x, y = list(map(int, input().split()))
Ps[x - 1].append(y - 1)
mem = [-1] * N
def rec(n):
if mem[n] > -1:
return mem[n]
elif len(Ps[n]) == 0:
mem[n] = 0
... | import sys
sys.setrecursionlimit(10**5 * 2)
input = sys.stdin.readline
N, M = list(map(int, input().split()))
Ps = [[] for _ in range(N)]
for i in range(M):
x, y = list(map(int, input().split()))
Ps[x - 1].append(y - 1)
mem = [-1] * N
def rec(n):
if mem[n] > -1:
return mem[n]
elif len(Ps[n]) ... | false | 3.703704 | [
"+input = sys.stdin.readline"
] | false | 0.078247 | 0.036976 | 2.116148 | [
"s593755657",
"s973829396"
] |
u281303342 | p03351 | python | s189643024 | s027543344 | 19 | 17 | 3,316 | 2,940 | Accepted | Accepted | 10.53 | a,b,c,d = list(map(int,input().split()))
if abs(a-c) <= d or (abs(a-b) <= d and abs(c-b) <= d):
print("Yes")
else:
print("No") | A,B,C,D = list(map(int,input().split()))
print(("Yes" if abs(A-C)<=D or abs(A-B)<=D and abs(B-C)<=D else "No")) | 5 | 2 | 132 | 104 | a, b, c, d = list(map(int, input().split()))
if abs(a - c) <= d or (abs(a - b) <= d and abs(c - b) <= d):
print("Yes")
else:
print("No")
| A, B, C, D = list(map(int, input().split()))
print(("Yes" if abs(A - C) <= D or abs(A - B) <= D and abs(B - C) <= D else "No"))
| false | 60 | [
"-a, b, c, d = list(map(int, input().split()))",
"-if abs(a - c) <= d or (abs(a - b) <= d and abs(c - b) <= d):",
"- print(\"Yes\")",
"-else:",
"- print(\"No\")",
"+A, B, C, D = list(map(int, input().split()))",
"+print((\"Yes\" if abs(A - C) <= D or abs(A - B) <= D and abs(B - C) <= D else \"No\"... | false | 0.037036 | 0.10236 | 0.36182 | [
"s189643024",
"s027543344"
] |
u757117214 | p02641 | python | s168478061 | s414886972 | 60 | 23 | 61,928 | 9,184 | Accepted | Accepted | 61.67 | X,N,*p = list(map(int,open(0).read().split()))
dif = 100
ans = -1
for i in range(102):
a = abs(X-i)
if i in p:
continue
if a < dif:
dif = a
ans = i
print(ans) | X,N= list(map(int,input().split()))
p = list(map(int,input().split()))
for i in range(100):
if X-i not in p:
print((X-i))
exit()
if X+i not in p:
print((X+i))
exit() | 11 | 9 | 199 | 183 | X, N, *p = list(map(int, open(0).read().split()))
dif = 100
ans = -1
for i in range(102):
a = abs(X - i)
if i in p:
continue
if a < dif:
dif = a
ans = i
print(ans)
| X, N = list(map(int, input().split()))
p = list(map(int, input().split()))
for i in range(100):
if X - i not in p:
print((X - i))
exit()
if X + i not in p:
print((X + i))
exit()
| false | 18.181818 | [
"-X, N, *p = list(map(int, open(0).read().split()))",
"-dif = 100",
"-ans = -1",
"-for i in range(102):",
"- a = abs(X - i)",
"- if i in p:",
"- continue",
"- if a < dif:",
"- dif = a",
"- ans = i",
"-print(ans)",
"+X, N = list(map(int, input().split()))",
"+p =... | false | 0.036634 | 0.040259 | 0.909955 | [
"s168478061",
"s414886972"
] |
u055941944 | p03073 | python | s320833364 | s094257334 | 94 | 77 | 4,724 | 3,188 | Accepted | Accepted | 18.09 | s = eval(input())
l = [int(x) for x in list(str(s))]
ans_a = 0
for i in range(len(s)):
if i%2 ==0 and l[i] == 0:
pass
elif i%2==1 and l[i] ==1:
pass
else:
ans_a += 1
ans_b = 0
for i in range(len(s)):
if i%2 ==0 and l[i] == 1:
pass
elif i%2 ==1 and l[i] == 0:
pass
else:
ans_b += 1
... | s = eval(input())
ans_a = 0
ans_b = 0
for i in range(len(s)):
if i%2 == 0 and s[i] =="0":
pass
elif i%2 == 1 and s[i]=="1":
pass
else:
ans_a += 1
for i in range(len(s)):
if i%2 == 0 and s[i] =="1":
pass
elif i%2 == 1 and s[i]=="0":
pass
else:
ans_b += 1
print((min(ans_a, ans_b))) | 21 | 20 | 338 | 311 | s = eval(input())
l = [int(x) for x in list(str(s))]
ans_a = 0
for i in range(len(s)):
if i % 2 == 0 and l[i] == 0:
pass
elif i % 2 == 1 and l[i] == 1:
pass
else:
ans_a += 1
ans_b = 0
for i in range(len(s)):
if i % 2 == 0 and l[i] == 1:
pass
elif i % 2 == 1 and l[i] =... | s = eval(input())
ans_a = 0
ans_b = 0
for i in range(len(s)):
if i % 2 == 0 and s[i] == "0":
pass
elif i % 2 == 1 and s[i] == "1":
pass
else:
ans_a += 1
for i in range(len(s)):
if i % 2 == 0 and s[i] == "1":
pass
elif i % 2 == 1 and s[i] == "0":
pass
else:... | false | 4.761905 | [
"-l = [int(x) for x in list(str(s))]",
"+ans_b = 0",
"- if i % 2 == 0 and l[i] == 0:",
"+ if i % 2 == 0 and s[i] == \"0\":",
"- elif i % 2 == 1 and l[i] == 1:",
"+ elif i % 2 == 1 and s[i] == \"1\":",
"-ans_b = 0",
"- if i % 2 == 0 and l[i] == 1:",
"+ if i % 2 == 0 and s[i] == \"1\... | false | 0.107736 | 0.045361 | 2.375074 | [
"s320833364",
"s094257334"
] |
u225388820 | p02614 | python | s259468779 | s168341834 | 170 | 62 | 73,500 | 9,008 | Accepted | Accepted | 63.53 | from copy import deepcopy
h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for i in range(h)]
ans = 0
for i in range(1 << h):
for j in range(1 << w):
t = deepcopy(c)
for x in range(h):
for y in range(w):
if (i >> x & 1) or (j >> y & 1):
... | h, w, k = list(map(int, input().split()))
c = [eval(input()) for i in range(h)]
ans = 0
for i in range(1 << h):
for j in range(1 << w):
cnt = 0
for x in range(h):
for y in range(w):
if (i >> x & 1) or (j >> y & 1):
continue
if... | 19 | 15 | 528 | 410 | from copy import deepcopy
h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for i in range(h)]
ans = 0
for i in range(1 << h):
for j in range(1 << w):
t = deepcopy(c)
for x in range(h):
for y in range(w):
if (i >> x & 1) or (j >> y & 1):
... | h, w, k = list(map(int, input().split()))
c = [eval(input()) for i in range(h)]
ans = 0
for i in range(1 << h):
for j in range(1 << w):
cnt = 0
for x in range(h):
for y in range(w):
if (i >> x & 1) or (j >> y & 1):
continue
if c[x][y] =... | false | 21.052632 | [
"-from copy import deepcopy",
"-",
"-c = [list(eval(input())) for i in range(h)]",
"+c = [eval(input()) for i in range(h)]",
"- t = deepcopy(c)",
"+ cnt = 0",
"- t[x][y] = \".\"",
"- p = 0",
"- for x in range(h):",
"- for y in range(w):",
... | false | 0.040146 | 0.083648 | 0.479944 | [
"s259468779",
"s168341834"
] |
u075012704 | p03504 | python | s628468837 | s126888861 | 813 | 740 | 124,888 | 120,152 | Accepted | Accepted | 8.98 | from itertools import accumulate
N, C = list(map(int, input().split()))
V = [[0] * (10 ** 5 + 1) for i in range(C)]
for i in range(N):
s, t, c = list(map(int, input().split()))
s, t, c = s - 1, t - 1, c - 1
V[c][s] += 1
V[c][t + 1] -= 1
for c in range(C):
V[c] = list(accumulate(V[c]))
... | from itertools import accumulate
N, C = list(map(int, input().split()))
TimeTable = [[0] * (10 ** 5 + 2) for i in range(C + 1)]
for i in range(N):
s, t, c = list(map(int, input().split()))
TimeTable[c][s] += 1
TimeTable[c][t + 1] -= 1
for c in range(C + 1):
TimeTable[c] = list(accumulate(TimeT... | 21 | 20 | 456 | 481 | from itertools import accumulate
N, C = list(map(int, input().split()))
V = [[0] * (10**5 + 1) for i in range(C)]
for i in range(N):
s, t, c = list(map(int, input().split()))
s, t, c = s - 1, t - 1, c - 1
V[c][s] += 1
V[c][t + 1] -= 1
for c in range(C):
V[c] = list(accumulate(V[c]))
ans = 0
for i i... | from itertools import accumulate
N, C = list(map(int, input().split()))
TimeTable = [[0] * (10**5 + 2) for i in range(C + 1)]
for i in range(N):
s, t, c = list(map(int, input().split()))
TimeTable[c][s] += 1
TimeTable[c][t + 1] -= 1
for c in range(C + 1):
TimeTable[c] = list(accumulate(TimeTable[c]))
a... | false | 4.761905 | [
"-V = [[0] * (10**5 + 1) for i in range(C)]",
"+TimeTable = [[0] * (10**5 + 2) for i in range(C + 1)]",
"- s, t, c = s - 1, t - 1, c - 1",
"- V[c][s] += 1",
"- V[c][t + 1] -= 1",
"-for c in range(C):",
"- V[c] = list(accumulate(V[c]))",
"+ TimeTable[c][s] += 1",
"+ TimeTable[c][t +... | false | 0.243309 | 0.280753 | 0.866631 | [
"s628468837",
"s126888861"
] |
u941407962 | p02728 | python | s588210050 | s819859968 | 1,701 | 1,175 | 124,036 | 131,076 | Accepted | Accepted | 30.92 | import sys;input=sys.stdin.readline
mod = pow(10, 9) + 7
sys.setrecursionlimit(pow(10, 8))
def mul(a, b):
return ((a % mod) * (b % mod)) % mod
def div(a, b):
return mul(a, modinv(b))
def modinv(a):
b, u, v = mod, 1, 0
while b:
t = a//b
a, u = a-t*b, u-t*v
a, b, u, v =... | import sys;input=sys.stdin.readline
mod = pow(10, 9) + 7
sys.setrecursionlimit(pow(10, 8))
def mul(a, b):
return ((a % mod) * (b % mod)) % mod
def div(a, b):
return mul(a, modinv(b))
def modinv(a):
b, u, v = mod, 1, 0
while b:
t = a//b
a, u = a-t*b, u-t*v
a, b, u, v =... | 78 | 78 | 1,749 | 1,718 | import sys
input = sys.stdin.readline
mod = pow(10, 9) + 7
sys.setrecursionlimit(pow(10, 8))
def mul(a, b):
return ((a % mod) * (b % mod)) % mod
def div(a, b):
return mul(a, modinv(b))
def modinv(a):
b, u, v = mod, 1, 0
while b:
t = a // b
a, u = a - t * b, u - t * v
a, b,... | import sys
input = sys.stdin.readline
mod = pow(10, 9) + 7
sys.setrecursionlimit(pow(10, 8))
def mul(a, b):
return ((a % mod) * (b % mod)) % mod
def div(a, b):
return mul(a, modinv(b))
def modinv(a):
b, u, v = mod, 1, 0
while b:
t = a // b
a, u = a - t * b, u - t * v
a, b,... | false | 0 | [
"-def cmb(n, r, mod):",
"+def cmb(n, r):",
"- t = mul(cmb(st, tt, mod), t)",
"+ t = mul(cmb(st, tt), t)",
"- dp1[v] = mul(div(dp1[p], cmb(N - 1, sss[v], mod)), cmb(N - 1, N - sss[v], mod))",
"+ dp1[v] = mul(mul(dp1[p], sss[v]), inverse[N - sss[v]])"
] | false | 2.004717 | 1.052611 | 1.904518 | [
"s588210050",
"s819859968"
] |
u867848444 | p03013 | python | s677973380 | s764982506 | 491 | 194 | 50,520 | 11,884 | Accepted | Accepted | 60.49 | n,m=list(map(int,input().split()))
a=[int(eval(input())) for i in range(m)]
dp=[1]*(n+1)
for i in a:
dp[i]=0
k=10**9+7
for i in range(2,n+1):
if dp[i]!=0:
dp[i]=(dp[i-1]+dp[i-2])%k
print((dp[-1]))
| n,m=list(map(int,input().split()))
a={int(eval(input())) for i in range(m)}
dp=[0]*(n+2)
num=10**9+7
dp[0]=1
for i in range(n):
if i in a:
dp[i]=0
else:
dp[i]=dp[i]%num
if i<n:
dp[i+1]+=dp[i]
dp[i+2]+=dp[i]
print((dp[-2]%num)) | 12 | 14 | 224 | 281 | n, m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
dp = [1] * (n + 1)
for i in a:
dp[i] = 0
k = 10**9 + 7
for i in range(2, n + 1):
if dp[i] != 0:
dp[i] = (dp[i - 1] + dp[i - 2]) % k
print((dp[-1]))
| n, m = list(map(int, input().split()))
a = {int(eval(input())) for i in range(m)}
dp = [0] * (n + 2)
num = 10**9 + 7
dp[0] = 1
for i in range(n):
if i in a:
dp[i] = 0
else:
dp[i] = dp[i] % num
if i < n:
dp[i + 1] += dp[i]
dp[i + 2] += dp[i]
print((dp[-2] % num))
| false | 14.285714 | [
"-a = [int(eval(input())) for i in range(m)]",
"-dp = [1] * (n + 1)",
"-for i in a:",
"- dp[i] = 0",
"-k = 10**9 + 7",
"-for i in range(2, n + 1):",
"- if dp[i] != 0:",
"- dp[i] = (dp[i - 1] + dp[i - 2]) % k",
"-print((dp[-1]))",
"+a = {int(eval(input())) for i in range(m)}",
"+dp =... | false | 0.007337 | 0.040574 | 0.180841 | [
"s677973380",
"s764982506"
] |
u848535504 | p02748 | python | s061956789 | s623014871 | 321 | 285 | 30,688 | 24,716 | Accepted | Accepted | 11.21 | A,B,M = list(map(int,input().split()))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
x = []
y = []
c = []
for _ in range(M):
X,Y,Z = list(map(int,input().split()))
x.append(X)
y.append(Y)
c.append(Z)
mini = min(a) + min(b)
for i in range(M):
rei = a[x[i]-1]
... | A,B,M = list(map(int,input().split()))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
mini = min(a) + min(b)
for i in range(M):
x,y,c = list(map(int,input().split()))
rei = a[x-1]
den = b[y-1]
coop = c
if rei + den - coop < mini:
mini = rei + den - coop... | 23 | 16 | 428 | 323 | A, B, M = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = []
y = []
c = []
for _ in range(M):
X, Y, Z = list(map(int, input().split()))
x.append(X)
y.append(Y)
c.append(Z)
mini = min(a) + min(b)
for i in range(M):
rei = a[x[i] - 1]
den ... | A, B, M = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
mini = min(a) + min(b)
for i in range(M):
x, y, c = list(map(int, input().split()))
rei = a[x - 1]
den = b[y - 1]
coop = c
if rei + den - coop < mini:
mini = rei + den - coop
pri... | false | 30.434783 | [
"-x = []",
"-y = []",
"-c = []",
"-for _ in range(M):",
"- X, Y, Z = list(map(int, input().split()))",
"- x.append(X)",
"- y.append(Y)",
"- c.append(Z)",
"- rei = a[x[i] - 1]",
"- den = b[y[i] - 1]",
"- coop = c[i]",
"+ x, y, c = list(map(int, input().split()))",
"+ ... | false | 0.042176 | 0.041544 | 1.015197 | [
"s061956789",
"s623014871"
] |
u320098990 | p02725 | python | s651015945 | s412230756 | 142 | 131 | 32,256 | 32,308 | Accepted | Accepted | 7.75 | k, n = list(map(int, input().split()))
a_list = list(map(int, input().split()))
longest = 0
for i in range(n):
if i==n-1:
longest = max(longest, k-a_list[i]+a_list[0])
else:
distance = a_list[i+1] - a_list[i]
longest = max(longest, distance)
print((k-longest)) | k, n = list(map(int, input().split()))
a_list = list(map(int, input().split()))
longest = 0
for i in range(n-1):
distance = a_list[i+1] - a_list[i]
longest = max(longest, distance)
print((k-max(longest, k-a_list[n-1]+a_list[0]))) | 10 | 9 | 293 | 247 | k, n = list(map(int, input().split()))
a_list = list(map(int, input().split()))
longest = 0
for i in range(n):
if i == n - 1:
longest = max(longest, k - a_list[i] + a_list[0])
else:
distance = a_list[i + 1] - a_list[i]
longest = max(longest, distance)
print((k - longest))
| k, n = list(map(int, input().split()))
a_list = list(map(int, input().split()))
longest = 0
for i in range(n - 1):
distance = a_list[i + 1] - a_list[i]
longest = max(longest, distance)
print((k - max(longest, k - a_list[n - 1] + a_list[0])))
| false | 10 | [
"-for i in range(n):",
"- if i == n - 1:",
"- longest = max(longest, k - a_list[i] + a_list[0])",
"- else:",
"- distance = a_list[i + 1] - a_list[i]",
"- longest = max(longest, distance)",
"-print((k - longest))",
"+for i in range(n - 1):",
"+ distance = a_list[i + 1] -... | false | 0.039821 | 0.040623 | 0.980242 | [
"s651015945",
"s412230756"
] |
u512212329 | p02727 | python | s133154470 | s658081993 | 287 | 244 | 22,548 | 22,592 | Accepted | Accepted | 14.98 | x, y, a, b, c = list(map(int, input().split()))
red = sorted(int(x) for x in input().split())[-x:]
green = sorted(int(x) for x in input().split())[-y:]
print((sum(sorted([int(x) for x in input().split()] + red + green)[-(x+y):])))
| x, y, a, b, c = list(map(int, input().split()))
red = [int(x) for x in input().split()]
green = [int(x) for x in input().split()]
red.sort(reverse=True)
green.sort(reverse=True)
candidates = [int(x) for x in input().split()] + red[:x] + green[:y]
candidates.sort(reverse=True)
print((sum(candidates[:x+y]))) | 4 | 8 | 226 | 306 | x, y, a, b, c = list(map(int, input().split()))
red = sorted(int(x) for x in input().split())[-x:]
green = sorted(int(x) for x in input().split())[-y:]
print((sum(sorted([int(x) for x in input().split()] + red + green)[-(x + y) :])))
| x, y, a, b, c = list(map(int, input().split()))
red = [int(x) for x in input().split()]
green = [int(x) for x in input().split()]
red.sort(reverse=True)
green.sort(reverse=True)
candidates = [int(x) for x in input().split()] + red[:x] + green[:y]
candidates.sort(reverse=True)
print((sum(candidates[: x + y])))
| false | 50 | [
"-red = sorted(int(x) for x in input().split())[-x:]",
"-green = sorted(int(x) for x in input().split())[-y:]",
"-print((sum(sorted([int(x) for x in input().split()] + red + green)[-(x + y) :])))",
"+red = [int(x) for x in input().split()]",
"+green = [int(x) for x in input().split()]",
"+red.sort(reverse... | false | 0.075582 | 0.072949 | 1.036082 | [
"s133154470",
"s658081993"
] |
u573754721 | p02970 | python | s728734177 | s690827224 | 173 | 18 | 38,384 | 3,188 | Accepted | Accepted | 89.6 | n,d = list(map(int, input().split()))
if n%(2*d + 1) == 0:
print((n//(2*d + 1)))
else:
print((n//(2*d + 1) + 1)) | import math
n,d=list(map(int,input().split()))
print((math.ceil(n/(d*2+1)))) | 6 | 3 | 116 | 70 | n, d = list(map(int, input().split()))
if n % (2 * d + 1) == 0:
print((n // (2 * d + 1)))
else:
print((n // (2 * d + 1) + 1))
| import math
n, d = list(map(int, input().split()))
print((math.ceil(n / (d * 2 + 1))))
| false | 50 | [
"+import math",
"+",
"-if n % (2 * d + 1) == 0:",
"- print((n // (2 * d + 1)))",
"-else:",
"- print((n // (2 * d + 1) + 1))",
"+print((math.ceil(n / (d * 2 + 1))))"
] | false | 0.088466 | 0.032533 | 2.719249 | [
"s728734177",
"s690827224"
] |
u009348313 | p02695 | python | s197484967 | s333267076 | 244 | 139 | 73,144 | 67,952 | Accepted | Accepted | 43.03 | import sys
sys.setrecursionlimit(10 ** 9)
n,m,q = list(map(int,input().split()))
abcd = []
for i in range(q):
abcd.append(tuple(map(int,input().split())))
ans = 0
def dfs(l):
global ans
if len(l) == n:
ans = max(check(l),ans)
else:
if len(l) == 0:
mx = 1
else:
mx = l[-... | import itertools
n,m,q = list(map(int,input().split()))
abcd = []
for i in range(q):
abcd.append(tuple(map(int,input().split())))
def check(l):
res = 0
for a,b,c,d in abcd:
a -= 1
b -= 1
if l[b]-l[a] == c:
res += d
return res
l = itertools.combinations_with_replacement(list(... | 33 | 21 | 538 | 388 | import sys
sys.setrecursionlimit(10**9)
n, m, q = list(map(int, input().split()))
abcd = []
for i in range(q):
abcd.append(tuple(map(int, input().split())))
ans = 0
def dfs(l):
global ans
if len(l) == n:
ans = max(check(l), ans)
else:
if len(l) == 0:
mx = 1
else:
... | import itertools
n, m, q = list(map(int, input().split()))
abcd = []
for i in range(q):
abcd.append(tuple(map(int, input().split())))
def check(l):
res = 0
for a, b, c, d in abcd:
a -= 1
b -= 1
if l[b] - l[a] == c:
res += d
return res
l = itertools.combinations_w... | false | 36.363636 | [
"-import sys",
"+import itertools",
"-sys.setrecursionlimit(10**9)",
"-ans = 0",
"-",
"-",
"-def dfs(l):",
"- global ans",
"- if len(l) == n:",
"- ans = max(check(l), ans)",
"- else:",
"- if len(l) == 0:",
"- mx = 1",
"- else:",
"- mx =... | false | 0.06637 | 0.070949 | 0.93546 | [
"s197484967",
"s333267076"
] |
u537782349 | p03424 | python | s313060721 | s654143371 | 21 | 17 | 3,316 | 2,940 | Accepted | Accepted | 19.05 | a = int(eval(input()))
b = {}
c = list(input().split())
for i in range(a):
b[c[i]] = 1
print(("Three" if len(b) == 3 else "Four"))
| a = int(eval(input()))
b = list(map(str, input().split()))
c = {}
for i in b:
c[i] = 1
print(("Three" if len(c) == 3 else "Four"))
| 6 | 6 | 132 | 132 | a = int(eval(input()))
b = {}
c = list(input().split())
for i in range(a):
b[c[i]] = 1
print(("Three" if len(b) == 3 else "Four"))
| a = int(eval(input()))
b = list(map(str, input().split()))
c = {}
for i in b:
c[i] = 1
print(("Three" if len(c) == 3 else "Four"))
| false | 0 | [
"-b = {}",
"-c = list(input().split())",
"-for i in range(a):",
"- b[c[i]] = 1",
"-print((\"Three\" if len(b) == 3 else \"Four\"))",
"+b = list(map(str, input().split()))",
"+c = {}",
"+for i in b:",
"+ c[i] = 1",
"+print((\"Three\" if len(c) == 3 else \"Four\"))"
] | false | 0.041094 | 0.04074 | 1.008683 | [
"s313060721",
"s654143371"
] |
u316603606 | p03210 | python | s907194312 | s854689273 | 31 | 26 | 9,124 | 9,096 | Accepted | Accepted | 16.13 | x = int (eval(input ()))
if x==3 or x==5 or x==7:
print ('YES')
else:
print ('NO') | X = int (eval(input ()))
if X==7 or X==5 or X==3:
print ('YES')
else:
print ('NO') | 5 | 5 | 84 | 84 | x = int(eval(input()))
if x == 3 or x == 5 or x == 7:
print("YES")
else:
print("NO")
| X = int(eval(input()))
if X == 7 or X == 5 or X == 3:
print("YES")
else:
print("NO")
| false | 0 | [
"-x = int(eval(input()))",
"-if x == 3 or x == 5 or x == 7:",
"+X = int(eval(input()))",
"+if X == 7 or X == 5 or X == 3:"
] | false | 0.037219 | 0.039115 | 0.951539 | [
"s907194312",
"s854689273"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.