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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u268793453 | p03142 | python | s975177464 | s925490143 | 1,808 | 1,067 | 316,036 | 146,652 | Accepted | Accepted | 40.98 | from sys import setrecursionlimit
setrecursionlimit(10 ** 9)
n, m = [int(i) for i in input().split()]
A = [[int(i) for i in input().split()] for j in range(n + m - 1)]
T = [[] for i in range(n+1)]
RT = [set() for i in range(n+1)]
for a, b in A:
T[a].append(b)
RT[b].add(a)
D = [0] * (n+1)
P = [... | from sys import setrecursionlimit
setrecursionlimit(10 ** 9)
n, m = [int(i) for i in input().split()]
A = [[int(i) for i in input().split()] for j in range(n + m - 1)]
T = [[] for i in range(n+1)]
RT = [[] for i in range(n+1)]
IN = [0] * (n+1)
for a, b in A:
T[a].append(b)
RT[b].append(a)
IN... | 37 | 39 | 739 | 762 | from sys import setrecursionlimit
setrecursionlimit(10**9)
n, m = [int(i) for i in input().split()]
A = [[int(i) for i in input().split()] for j in range(n + m - 1)]
T = [[] for i in range(n + 1)]
RT = [set() for i in range(n + 1)]
for a, b in A:
T[a].append(b)
RT[b].add(a)
D = [0] * (n + 1)
P = [0] * (n + 1)
... | from sys import setrecursionlimit
setrecursionlimit(10**9)
n, m = [int(i) for i in input().split()]
A = [[int(i) for i in input().split()] for j in range(n + m - 1)]
T = [[] for i in range(n + 1)]
RT = [[] for i in range(n + 1)]
IN = [0] * (n + 1)
for a, b in A:
T[a].append(b)
RT[b].append(a)
IN[b] += 1
D ... | false | 5.128205 | [
"-RT = [set() for i in range(n + 1)]",
"+RT = [[] for i in range(n + 1)]",
"+IN = [0] * (n + 1)",
"- RT[b].add(a)",
"+ RT[b].append(a)",
"+ IN[b] += 1",
"- RT[t].remove(i)",
"+ IN[t] -= 1",
"- if not RT[t]:",
"+ if IN[t] == 0:",
"- return root(tuple(RT[i])... | false | 0.043466 | 0.037146 | 1.170138 | [
"s975177464",
"s925490143"
] |
u133936772 | p02707 | python | s730236824 | s550574952 | 194 | 169 | 33,628 | 46,944 | Accepted | Accepted | 12.89 | n=int(eval(input()))
l=list(map(int,input().split()))
from collections import *
c=Counter(l)
for i in range(n): print((c[i+1])) | n=int(eval(input()))
from collections import *
c=Counter(list(map(int,input().split())))
for i in range(n): print((c[i+1])) | 5 | 4 | 123 | 112 | n = int(eval(input()))
l = list(map(int, input().split()))
from collections import *
c = Counter(l)
for i in range(n):
print((c[i + 1]))
| n = int(eval(input()))
from collections import *
c = Counter(list(map(int, input().split())))
for i in range(n):
print((c[i + 1]))
| false | 20 | [
"-l = list(map(int, input().split()))",
"-c = Counter(l)",
"+c = Counter(list(map(int, input().split())))"
] | false | 0.046738 | 0.045569 | 1.025661 | [
"s730236824",
"s550574952"
] |
u492910842 | p03486 | python | s281719258 | s724724064 | 128 | 68 | 61,276 | 61,680 | Accepted | Accepted | 46.88 | s=sorted(eval(input()))
t=sorted(eval(input()),reverse=True)
print(("Yes" if s<t else "No")) | print(("Yes" if sorted(eval(input()))<sorted(eval(input()))[::-1] else "No")) | 4 | 1 | 82 | 63 | s = sorted(eval(input()))
t = sorted(eval(input()), reverse=True)
print(("Yes" if s < t else "No"))
| print(("Yes" if sorted(eval(input())) < sorted(eval(input()))[::-1] else "No"))
| false | 75 | [
"-s = sorted(eval(input()))",
"-t = sorted(eval(input()), reverse=True)",
"-print((\"Yes\" if s < t else \"No\"))",
"+print((\"Yes\" if sorted(eval(input())) < sorted(eval(input()))[::-1] else \"No\"))"
] | false | 0.059888 | 0.059976 | 0.998527 | [
"s281719258",
"s724724064"
] |
u533039576 | p02603 | python | s823831206 | s689235520 | 31 | 28 | 9,212 | 9,168 | Accepted | Accepted | 9.68 | n = int(eval(input()))
a = [-1] + list(map(int, input().split()))
# dp[i] = (i+1)日目終了時点での金額の最大値
# dp[i] = max(dp[i-1], {dp[j-1] % a[j] + (dp[j-1] // a[j]) * a[i] | j<i})
dp = [0] * (n + 1)
dp[0] = dp[1] = 1000
dp[2] = max(dp[0] % a[1] + (dp[0] // a[1]) * a[2], dp[1])
for i in range(1, n + 1):
cand = dp[... | n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1000
for i in range(n - 1):
if a[i] < a[i + 1]:
ans = ans % a[i] + (ans // a[i]) * a[i + 1]
print(ans)
| 16 | 9 | 455 | 184 | n = int(eval(input()))
a = [-1] + list(map(int, input().split()))
# dp[i] = (i+1)日目終了時点での金額の最大値
# dp[i] = max(dp[i-1], {dp[j-1] % a[j] + (dp[j-1] // a[j]) * a[i] | j<i})
dp = [0] * (n + 1)
dp[0] = dp[1] = 1000
dp[2] = max(dp[0] % a[1] + (dp[0] // a[1]) * a[2], dp[1])
for i in range(1, n + 1):
cand = dp[i - 1]
f... | n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1000
for i in range(n - 1):
if a[i] < a[i + 1]:
ans = ans % a[i] + (ans // a[i]) * a[i + 1]
print(ans)
| false | 43.75 | [
"-a = [-1] + list(map(int, input().split()))",
"-# dp[i] = (i+1)日目終了時点での金額の最大値",
"-# dp[i] = max(dp[i-1], {dp[j-1] % a[j] + (dp[j-1] // a[j]) * a[i] | j<i})",
"-dp = [0] * (n + 1)",
"-dp[0] = dp[1] = 1000",
"-dp[2] = max(dp[0] % a[1] + (dp[0] // a[1]) * a[2], dp[1])",
"-for i in range(1, n + 1):",
"- ... | false | 0.077326 | 0.109131 | 0.708559 | [
"s823831206",
"s689235520"
] |
u474561976 | p02598 | python | s082135178 | s421987428 | 1,077 | 615 | 30,740 | 30,732 | Accepted | Accepted | 42.9 | def main():
n,k = list(map(int,input().split()))
A = list(map(int,input().split()))
left = 0
right = max(A)
while abs(right-left)>1:
cent = (right+left)//2
ct = 0
for a in A:
ct+=(a-0.1)//cent
if ct <= k:
righ... | def main():
n,k = list(map(int,input().split()))
A = list(map(int,input().split()))
left = 0
right = max(A)
while abs(right-left)>1:
cent = (right+left)//2
ct = 0
for a in A:
ct+=a//cent
if a%cent==0:
ct-=1
... | 21 | 23 | 390 | 434 | def main():
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
left = 0
right = max(A)
while abs(right - left) > 1:
cent = (right + left) // 2
ct = 0
for a in A:
ct += (a - 0.1) // cent
if ct <= k:
right = cent
e... | def main():
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
left = 0
right = max(A)
while abs(right - left) > 1:
cent = (right + left) // 2
ct = 0
for a in A:
ct += a // cent
if a % cent == 0:
ct -= 1
... | false | 8.695652 | [
"- ct += (a - 0.1) // cent",
"+ ct += a // cent",
"+ if a % cent == 0:",
"+ ct -= 1"
] | false | 0.078144 | 0.03645 | 2.143836 | [
"s082135178",
"s421987428"
] |
u130900604 | p02861 | python | s640363599 | s157928945 | 166 | 17 | 38,512 | 3,064 | Accepted | Accepted | 89.76 | n=int(eval(input()))
x=[0]*n
y=[0]*n
for i in range(n):
x[i],y[i]=list(map(int,input().split()))
dist=0
for i in range(n):
for j in range(n):
dist+=((x[i]-x[j])**2+(y[i]-y[j])**2)**0.5
print((dist/n))
| n=int(eval(input()))
x=[]
y=[]
for i in range(n):
a,b=list(map(int,input().split()))
x.append(a)
y.append(b)
def fac(n):
if n==0:
return 1
if n==1:
return 1
return n*fac(n-1)
ans=0
for i in range(n):
for j in range(n):
tmp=(((x[i]-x[j])**2+(y[i]-y[j])**2)**.5)
ans+=tmp... | 14 | 23 | 228 | 329 | n = int(eval(input()))
x = [0] * n
y = [0] * n
for i in range(n):
x[i], y[i] = list(map(int, input().split()))
dist = 0
for i in range(n):
for j in range(n):
dist += ((x[i] - x[j]) ** 2 + (y[i] - y[j]) ** 2) ** 0.5
print((dist / n))
| n = int(eval(input()))
x = []
y = []
for i in range(n):
a, b = list(map(int, input().split()))
x.append(a)
y.append(b)
def fac(n):
if n == 0:
return 1
if n == 1:
return 1
return n * fac(n - 1)
ans = 0
for i in range(n):
for j in range(n):
tmp = ((x[i] - x[j]) ** 2... | false | 39.130435 | [
"-x = [0] * n",
"-y = [0] * n",
"+x = []",
"+y = []",
"- x[i], y[i] = list(map(int, input().split()))",
"-dist = 0",
"+ a, b = list(map(int, input().split()))",
"+ x.append(a)",
"+ y.append(b)",
"+",
"+",
"+def fac(n):",
"+ if n == 0:",
"+ return 1",
"+ if n == 1... | false | 0.048468 | 0.047473 | 1.020946 | [
"s640363599",
"s157928945"
] |
u413165887 | p03611 | python | s467695610 | s376753509 | 144 | 115 | 14,564 | 14,944 | Accepted | Accepted | 20.14 | from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
count_a = Counter(a)
result = []
for i in range(min(a),max(a)+1):
result.append(count_a[i]+count_a[i-1]+count_a[i+1])
print((max(result))) | from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
set_a = list(set(a))
#set_a = sorted(set_a)
count_a = Counter(a)
result = []
for i in set_a:
result.append(count_a[i]+count_a[i-1]+count_a[i+1])
print((max(result))) | 9 | 11 | 234 | 263 | from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
count_a = Counter(a)
result = []
for i in range(min(a), max(a) + 1):
result.append(count_a[i] + count_a[i - 1] + count_a[i + 1])
print((max(result)))
| from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
set_a = list(set(a))
# set_a = sorted(set_a)
count_a = Counter(a)
result = []
for i in set_a:
result.append(count_a[i] + count_a[i - 1] + count_a[i + 1])
print((max(result)))
| false | 18.181818 | [
"+set_a = list(set(a))",
"+# set_a = sorted(set_a)",
"-for i in range(min(a), max(a) + 1):",
"+for i in set_a:"
] | false | 0.04671 | 0.044689 | 1.045224 | [
"s467695610",
"s376753509"
] |
u102461423 | p02733 | python | s299453854 | s740671572 | 652 | 579 | 56,668 | 107,340 | Accepted | Accepted | 11.2 | #!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import itertools
H, W, K = list(map(int, readline().split()))
S = [list(map(int, line.rstrip().decode())) for line in readlines()]
# transpose
S = tuple(itertools.chain(*lis... | import sys
import numpy as np
import numba
from numba import njit
from numba.types import Omitted
i4 = numba.int32
i8 = numba.int64
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
@njit((i8[:, :], i8), cache=True)
def main(S, K):
H, W = S.shap... | 36 | 41 | 978 | 1,027 | #!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import itertools
H, W, K = list(map(int, readline().split()))
S = [list(map(int, line.rstrip().decode())) for line in readlines()]
# transpose
S = tuple(itertools.chain(*list(zip(*... | import sys
import numpy as np
import numba
from numba import njit
from numba.types import Omitted
i4 = numba.int32
i8 = numba.int64
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
@njit((i8[:, :], i8), cache=True)
def main(S, K):
H, W = S.shape
ans = H... | false | 12.195122 | [
"-#!/usr/bin/ python3.8",
"+import numpy as np",
"+import numba",
"+from numba import njit",
"+from numba.types import Omitted",
"+i4 = numba.int32",
"+i8 = numba.int64",
"-import itertools",
"+",
"+",
"+@njit((i8[:, :], i8), cache=True)",
"+def main(S, K):",
"+ H, W = S.shape",
"+ a... | false | 0.104185 | 0.205549 | 0.506863 | [
"s299453854",
"s740671572"
] |
u588341295 | p02918 | python | s199881942 | s478158527 | 150 | 134 | 17,352 | 16,472 | Accepted | Accepted | 10.67 | # -*- coding: utf-8 -*-
import sys
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in ... | # -*- coding: utf-8 -*-
import sys
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in ... | 65 | 59 | 1,530 | 1,516 | # -*- coding: utf-8 -*-
import sys
def input():
return sys.stdin.readline().strip()
def list2d(a, b, c):
return [[c] * b for i in range(a)]
def list3d(a, b, c, d):
return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e):
return [[[[e] * d for j in range(c)] for j in rang... | # -*- coding: utf-8 -*-
import sys
def input():
return sys.stdin.readline().strip()
def list2d(a, b, c):
return [[c] * b for i in range(a)]
def list3d(a, b, c, d):
return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e):
return [[[[e] * d for j in range(c)] for j in rang... | false | 9.230769 | [
"+# 初期状態でOKなものを数えておく",
"-cur = S[0]",
"+# LかRが連続する区間毎にまとめる",
"-tmp = is_ok[0]",
"- if S[i] == cur:",
"- tmp += is_ok[i]",
"- else:",
"- A.append((tmp, st, i, cur))",
"+ if S[i] != S[i - 1]:",
"+ A.append((st, i, S[i - 1]))",
"- tmp = is_ok[i]",
"- cu... | false | 0.008546 | 0.042304 | 0.202006 | [
"s199881942",
"s478158527"
] |
u788068140 | p03160 | python | s902694395 | s847492474 | 154 | 110 | 13,908 | 13,928 | Accepted | Accepted | 28.57 | # N = 4
# HRR = [10, 30, 40, 20]
# N = 2
# HRR = [10, 10]
N = int(eval(input()))
HRR = list(map(int,input().split()))
result = []
for i in range(N):
if i == 0:
result.append(0)
elif i == 1:
s1 = result[i - 1] + abs(HRR[i] - HRR[i - 1])
result.append(s1)
else:
... | N = int(eval(input()))
HRR = list(map(int,input().split()))
def calculate(n, hrr):
result = []
for index,value in enumerate(hrr):
if index == 0:
result.append(0)
elif index == 1:
result.append(abs(hrr[index]-hrr[index-1]) + result[index-1])
else... | 20 | 22 | 472 | 538 | # N = 4
# HRR = [10, 30, 40, 20]
# N = 2
# HRR = [10, 10]
N = int(eval(input()))
HRR = list(map(int, input().split()))
result = []
for i in range(N):
if i == 0:
result.append(0)
elif i == 1:
s1 = result[i - 1] + abs(HRR[i] - HRR[i - 1])
result.append(s1)
else:
s1 = result[i -... | N = int(eval(input()))
HRR = list(map(int, input().split()))
def calculate(n, hrr):
result = []
for index, value in enumerate(hrr):
if index == 0:
result.append(0)
elif index == 1:
result.append(abs(hrr[index] - hrr[index - 1]) + result[index - 1])
else:
... | false | 9.090909 | [
"-# N = 4",
"-# HRR = [10, 30, 40, 20]",
"-# N = 2",
"-# HRR = [10, 10]",
"-result = []",
"-for i in range(N):",
"- if i == 0:",
"- result.append(0)",
"- elif i == 1:",
"- s1 = result[i - 1] + abs(HRR[i] - HRR[i - 1])",
"- result.append(s1)",
"- else:",
"- ... | false | 0.079249 | 0.037844 | 2.094094 | [
"s902694395",
"s847492474"
] |
u077291787 | p02983 | python | s312255006 | s095217935 | 44 | 32 | 3,064 | 3,064 | Accepted | Accepted | 27.27 | # ABC133C - Remainder Minimization 2019
def main():
L, R = list(map(int, input().rstrip().split()))
MOD = 2019
if R - L + 1 >= MOD: # L <= 2019n <= R
print((0))
else: # max: 2018 * 2017 patterns
L, R = L % MOD, R % MOD
if L <= 3 and R >= 673:
print((0))
... | # ABC133C - Remainder Minimization 2019
def main():
L, R = list(map(int, input().rstrip().split()))
MOD = 2019
if R - L + 1 >= MOD: # L <= 2019n <= R
print((0))
else: # max: 2018 * 2017 patterns
L, R = L % MOD, R % MOD
if L <= 3 and R >= 673: # 2019 = 3 * 673
... | 20 | 22 | 545 | 615 | # ABC133C - Remainder Minimization 2019
def main():
L, R = list(map(int, input().rstrip().split()))
MOD = 2019
if R - L + 1 >= MOD: # L <= 2019n <= R
print((0))
else: # max: 2018 * 2017 patterns
L, R = L % MOD, R % MOD
if L <= 3 and R >= 673:
print((0))
... | # ABC133C - Remainder Minimization 2019
def main():
L, R = list(map(int, input().rstrip().split()))
MOD = 2019
if R - L + 1 >= MOD: # L <= 2019n <= R
print((0))
else: # max: 2018 * 2017 patterns
L, R = L % MOD, R % MOD
if L <= 3 and R >= 673: # 2019 = 3 * 673
print... | false | 9.090909 | [
"- if L <= 3 and R >= 673:",
"+ if L <= 3 and R >= 673: # 2019 = 3 * 673",
"- ans = min(ans, (i * j) % MOD)",
"+ tmp = (i * j) % MOD",
"+ if tmp < ans:",
"+ ans = tmp"
] | false | 0.042269 | 0.060816 | 0.695026 | [
"s312255006",
"s095217935"
] |
u285891772 | p02659 | python | s246106735 | s890762256 | 32 | 29 | 10,544 | 10,712 | Accepted | Accepted | 9.38 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd, floor
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd, floor
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import... | 30 | 24 | 983 | 973 | import sys, re
from collections import deque, defaultdict, Counter
from math import (
ceil,
sqrt,
hypot,
factorial,
pi,
sin,
cos,
tan,
asin,
acos,
atan,
radians,
degrees,
log2,
gcd,
floor,
)
from itertools import (
accumulate,
permutations,
com... | import sys, re
from collections import deque, defaultdict, Counter
from math import (
ceil,
sqrt,
hypot,
factorial,
pi,
sin,
cos,
tan,
asin,
acos,
atan,
radians,
degrees,
log2,
gcd,
floor,
)
from itertools import (
accumulate,
permutations,
com... | false | 20 | [
"-A, B = MAP()",
"-A = int(A)",
"-b = \"\"",
"-for x in B:",
"- if x != \".\":",
"- b += x",
"-b = int(b)",
"-print((A * b // 100))",
"+",
"+def MAP():",
"+ return list(map(str, input().split()))",
"+",
"+",
"+a, b = MAP()",
"+print((int(Decimal(a) * Decimal(b))))"
] | false | 0.037921 | 0.100596 | 0.376961 | [
"s246106735",
"s890762256"
] |
u600402037 | p02690 | python | s683912721 | s806775076 | 300 | 60 | 80,020 | 68,140 | Accepted | Accepted | 80 | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# (X - Y) (X^4 + X^3 Y + X^2 Y^2 + X Y^3 + Y^4)
X = ir()
def make_divisors(n): # nの約数を列挙
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
... | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# (X - Y) (X^4 + X^3 Y + X^2 Y^2 + X Y^3 + Y^4)
X = ir()
def make_divisors(n): # nの約数を列挙
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
... | 32 | 28 | 748 | 645 | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# (X - Y) (X^4 + X^3 Y + X^2 Y^2 + X Y^3 + Y^4)
X = ir()
def make_divisors(n): # nの約数を列挙
divisors = []
for i in range(1, int(n**0.5) + 1):
if n % i == 0:
... | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# (X - Y) (X^4 + X^3 Y + X^2 Y^2 + X Y^3 + Y^4)
X = ir()
def make_divisors(n): # nの約数を列挙
divisors = []
for i in range(1, int(n**0.5) + 1):
if n % i == 0:
... | false | 12.5 | [
"-U = 5 * 10**6",
"+U = 10**4",
"-for b in range(U):",
"+for a in range(U):",
"- a = b + d",
"+ b = a - d",
"- a = b - d",
"- if b**5 - a**5 == X:",
"- print((b, a))",
"- exit()"
] | false | 0.039612 | 0.073552 | 0.538558 | [
"s683912721",
"s806775076"
] |
u133936772 | p02725 | python | s011219558 | s135213146 | 109 | 99 | 25,124 | 31,832 | Accepted | Accepted | 9.17 | k,n,*l=list(map(int,open(0).read().split()));print((min((l[i-1]-l[i])%k for i in range(n)))) | k,n,*l=list(map(int,open(0).read().split()))
print((k-max((l[i]-l[i-1])%k for i in range(n)))) | 1 | 2 | 84 | 87 | k, n, *l = list(map(int, open(0).read().split()))
print((min((l[i - 1] - l[i]) % k for i in range(n))))
| k, n, *l = list(map(int, open(0).read().split()))
print((k - max((l[i] - l[i - 1]) % k for i in range(n))))
| false | 50 | [
"-print((min((l[i - 1] - l[i]) % k for i in range(n))))",
"+print((k - max((l[i] - l[i - 1]) % k for i in range(n))))"
] | false | 0.037236 | 0.036434 | 1.022016 | [
"s011219558",
"s135213146"
] |
u423665486 | p03945 | python | s736550971 | s893201060 | 180 | 33 | 39,280 | 3,188 | Accepted | Accepted | 81.67 | def resolve():
s = eval(input())
c = 0
for i in range(len(s) - 1):
if s[i] != s[i+1]:
c += 1
print(c)
resolve() | def resolve():
s = eval(input())
c = 0
for i in range(len(s) - 1):
if s[i] != s[i+1]:
c += 1
if not c:
print((0))
return
print(c)
resolve() | 8 | 11 | 121 | 155 | def resolve():
s = eval(input())
c = 0
for i in range(len(s) - 1):
if s[i] != s[i + 1]:
c += 1
print(c)
resolve()
| def resolve():
s = eval(input())
c = 0
for i in range(len(s) - 1):
if s[i] != s[i + 1]:
c += 1
if not c:
print((0))
return
print(c)
resolve()
| false | 27.272727 | [
"+ if not c:",
"+ print((0))",
"+ return"
] | false | 0.036426 | 0.034921 | 1.043088 | [
"s736550971",
"s893201060"
] |
u860002137 | p02819 | python | s910217471 | s838953928 | 529 | 51 | 92,964 | 14,884 | Accepted | Accepted | 90.36 | import numpy as np
n = 1000003
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
primes.difference_update(list(range(i*2, n+1, i)))
primes = np.array(list(primes))
x = int(eval(input()))
print((primes[np.where(primes>=x)][0])) | n = 10**5 + 3
primes = set(range(3, n+1, 2))
for i in range(3, int(n**0.5+1)):
primes.difference_update(list(range(i*2, n+1, i)))
primes.add(2)
primes = list(primes)
primes.sort()
x = int(eval(input()))
primes = [y for y in primes if y >= x]
print((primes[0])) | 13 | 14 | 245 | 267 | import numpy as np
n = 1000003
primes = set(range(2, n + 1))
for i in range(2, int(n**0.5 + 1)):
primes.difference_update(list(range(i * 2, n + 1, i)))
primes = np.array(list(primes))
x = int(eval(input()))
print((primes[np.where(primes >= x)][0]))
| n = 10**5 + 3
primes = set(range(3, n + 1, 2))
for i in range(3, int(n**0.5 + 1)):
primes.difference_update(list(range(i * 2, n + 1, i)))
primes.add(2)
primes = list(primes)
primes.sort()
x = int(eval(input()))
primes = [y for y in primes if y >= x]
print((primes[0]))
| false | 7.142857 | [
"-import numpy as np",
"-",
"-n = 1000003",
"-primes = set(range(2, n + 1))",
"-for i in range(2, int(n**0.5 + 1)):",
"+n = 10**5 + 3",
"+primes = set(range(3, n + 1, 2))",
"+for i in range(3, int(n**0.5 + 1)):",
"-primes = np.array(list(primes))",
"+primes.add(2)",
"+primes = list(primes)",
"... | false | 1.5578 | 0.12451 | 12.511435 | [
"s910217471",
"s838953928"
] |
u510829608 | p02316 | python | s410206116 | s436958672 | 1,890 | 1,180 | 18,288 | 18,304 | Accepted | Accepted | 37.57 | INF = 10 ** 12
N, W = list(map(int, input().split()))
items =[] * N
for i in range(N):
v, w = list(map(int, input().split()))
items.append([v,w])
dp = [[INF for i in range(W+1)] for j in range(N+1)]
for i in range(W+1):
dp[0][i] = 0
for i in range(N+1):
dp[i][0] = 0
for i in ran... | def solve():
INF = 10 ** 12
N, W = list(map(int, input().split()))
items =[] * N
for i in range(N):
v, w = list(map(int, input().split()))
items.append([v,w])
dp = [[INF for i in range(W+1)] for j in range(N+1)]
for i in range(W+1):
... | 26 | 31 | 604 | 771 | INF = 10**12
N, W = list(map(int, input().split()))
items = [] * N
for i in range(N):
v, w = list(map(int, input().split()))
items.append([v, w])
dp = [[INF for i in range(W + 1)] for j in range(N + 1)]
for i in range(W + 1):
dp[0][i] = 0
for i in range(N + 1):
dp[i][0] = 0
for i in range(1, N + 1): # ... | def solve():
INF = 10**12
N, W = list(map(int, input().split()))
items = [] * N
for i in range(N):
v, w = list(map(int, input().split()))
items.append([v, w])
dp = [[INF for i in range(W + 1)] for j in range(N + 1)]
for i in range(W + 1):
dp[0][i] = 0
for i in range(N... | false | 16.129032 | [
"-INF = 10**12",
"-N, W = list(map(int, input().split()))",
"-items = [] * N",
"-for i in range(N):",
"- v, w = list(map(int, input().split()))",
"- items.append([v, w])",
"-dp = [[INF for i in range(W + 1)] for j in range(N + 1)]",
"-for i in range(W + 1):",
"- dp[0][i] = 0",
"-for i in ... | false | 0.077276 | 0.077922 | 0.991709 | [
"s410206116",
"s436958672"
] |
u002459665 | p02614 | python | s954524888 | s075781481 | 74 | 62 | 9,108 | 9,184 | Accepted | Accepted | 16.22 | H, W, K = list(map(int, input().split()))
c = []
for i in range(H):
row = eval(input())
c.append(row)
a1 = []
a2 = []
def f():
pass
at1 = [None] * H
def dfs1(pos: int):
if pos == H:
# print(a)
a1.append(at1.copy())
return
at1[pos] = 0
dfs1(... | H, W, K = list(map(int, input().split()))
s = []
for i in range(H):
row = eval(input())
s.append(row)
ans = 0
for i in range(1 << H):
for j in range(1 << W):
cnt = 0
for hi in range(H):
for wi in range(W):
if i >> hi & 1:
continue... | 84 | 22 | 1,319 | 504 | H, W, K = list(map(int, input().split()))
c = []
for i in range(H):
row = eval(input())
c.append(row)
a1 = []
a2 = []
def f():
pass
at1 = [None] * H
def dfs1(pos: int):
if pos == H:
# print(a)
a1.append(at1.copy())
return
at1[pos] = 0
dfs1(pos + 1)
at1[pos] = 1
... | H, W, K = list(map(int, input().split()))
s = []
for i in range(H):
row = eval(input())
s.append(row)
ans = 0
for i in range(1 << H):
for j in range(1 << W):
cnt = 0
for hi in range(H):
for wi in range(W):
if i >> hi & 1:
continue
... | false | 73.809524 | [
"-c = []",
"+s = []",
"- c.append(row)",
"-a1 = []",
"-a2 = []",
"-",
"-",
"-def f():",
"- pass",
"-",
"-",
"-at1 = [None] * H",
"-",
"-",
"-def dfs1(pos: int):",
"- if pos == H:",
"- # print(a)",
"- a1.append(at1.copy())",
"- return",
"- at1[po... | false | 0.048614 | 0.162367 | 0.299411 | [
"s954524888",
"s075781481"
] |
u690536347 | p03032 | python | s372097665 | s726705364 | 218 | 48 | 3,064 | 3,064 | Accepted | Accepted | 77.98 | from itertools import accumulate
N, K = list(map(int, input().split()))
*V, = list(map(int, input().split()))
ans = 0
for a in range(N+1):
for b in range(N+1):
if a+b>N:continue
if a and b:
qa, qb = list(accumulate([0]+sorted(V[:a]))), list(accumulate([0]+sorted(V[-b:... | from itertools import accumulate
N, K = list(map(int, input().split()))
*V, = list(map(int, input().split()))
ans = 0
for a in range(N+1):
for b in range(N+1):
if a+b>N:continue
t = []
if a:
t += V[:a]
if b:
t += V[-b:]
t.sort()
... | 30 | 23 | 957 | 477 | from itertools import accumulate
N, K = list(map(int, input().split()))
(*V,) = list(map(int, input().split()))
ans = 0
for a in range(N + 1):
for b in range(N + 1):
if a + b > N:
continue
if a and b:
qa, qb = list(accumulate([0] + sorted(V[:a]))), list(
accu... | from itertools import accumulate
N, K = list(map(int, input().split()))
(*V,) = list(map(int, input().split()))
ans = 0
for a in range(N + 1):
for b in range(N + 1):
if a + b > N:
continue
t = []
if a:
t += V[:a]
if b:
t += V[-b:]
t.sort()... | false | 23.333333 | [
"- if a and b:",
"- qa, qb = list(accumulate([0] + sorted(V[:a]))), list(",
"- accumulate([0] + sorted(V[-b:]))",
"- )",
"- sa, sb = sum(V[:a]), sum(V[-b:])",
"- for c in range(a + 1):",
"- for d in range(b + 1):",
"- ... | false | 0.086336 | 0.084096 | 1.026634 | [
"s372097665",
"s726705364"
] |
u620868411 | p03081 | python | s033293822 | s748732075 | 1,898 | 533 | 41,396 | 39,348 | Accepted | Accepted | 71.92 | # -*- coding: utf-8 -*-
n,q = list(map(int, input().split()))
s = eval(input())
td = [input().split() for _ in range(q)]
def check(idx, x):
for t,d in td:
if idx==x:
return True
elif idx==n or idx==-1:
return False
if s[idx]==t:
if d=="L":
... | # -*- coding: utf-8 -*-
n,q = list(map(int, input().split()))
s = eval(input())
td = [input().split() for _ in range(q)]
l = 0
r = n - 1
for i in range(q-1,-1,-1):
t,d = td[i]
if n>l>=0:
if s[l]==t and d=="L":
l += 1
elif l>0 and s[l-1]==t and d=="R":
l -=... | 40 | 23 | 703 | 473 | # -*- coding: utf-8 -*-
n, q = list(map(int, input().split()))
s = eval(input())
td = [input().split() for _ in range(q)]
def check(idx, x):
for t, d in td:
if idx == x:
return True
elif idx == n or idx == -1:
return False
if s[idx] == t:
if d == "L":
... | # -*- coding: utf-8 -*-
n, q = list(map(int, input().split()))
s = eval(input())
td = [input().split() for _ in range(q)]
l = 0
r = n - 1
for i in range(q - 1, -1, -1):
t, d = td[i]
if n > l >= 0:
if s[l] == t and d == "L":
l += 1
elif l > 0 and s[l - 1] == t and d == "R":
... | false | 42.5 | [
"-",
"-",
"-def check(idx, x):",
"- for t, d in td:",
"- if idx == x:",
"- return True",
"- elif idx == n or idx == -1:",
"- return False",
"- if s[idx] == t:",
"- if d == \"L\":",
"- idx -= 1",
"- else:",
"- ... | false | 0.041516 | 0.036851 | 1.1266 | [
"s033293822",
"s748732075"
] |
u057109575 | p02623 | python | s860625229 | s141453538 | 183 | 145 | 111,000 | 118,212 | Accepted | Accepted | 20.77 | from bisect import bisect_right
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
x = [0] * (N + 1)
for i in range(N):
x[i + 1] = x[i] + A[i]
y = [0] * (M + 1)
for i in range(M):
y[i + 1] = y[i] + B[i]
ans = 0
for i in range(... |
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
x = [0] * (N + 1)
y = [0] * (M + 1)
for i in range(N):
x[i + 1] = x[i] + A[i]
for i in range(M):
y[i + 1] = y[i] + B[i]
j = M
ans = 0
for i in range(N + 1):
if x[i] > K:
... | 27 | 22 | 514 | 422 | from bisect import bisect_right
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
x = [0] * (N + 1)
for i in range(N):
x[i + 1] = x[i] + A[i]
y = [0] * (M + 1)
for i in range(M):
y[i + 1] = y[i] + B[i]
ans = 0
for i in range(N + 1):
res = K - ... | N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
x = [0] * (N + 1)
y = [0] * (M + 1)
for i in range(N):
x[i + 1] = x[i] + A[i]
for i in range(M):
y[i + 1] = y[i] + B[i]
j = M
ans = 0
for i in range(N + 1):
if x[i] > K:
continue
whi... | false | 18.518519 | [
"-from bisect import bisect_right",
"-",
"+y = [0] * (M + 1)",
"-y = [0] * (M + 1)",
"+j = M",
"- res = K - x[i]",
"- if res > 0:",
"- j = bisect_right(y, res)",
"+ if x[i] > K:",
"+ continue",
"+ while j >= 0 and x[i] + y[j] > K:",
"- elif res == 0:",
"- ... | false | 0.083972 | 0.065797 | 1.276232 | [
"s860625229",
"s141453538"
] |
u508732591 | p02258 | python | s505155993 | s391364011 | 520 | 450 | 7,672 | 7,692 | Accepted | Accepted | 13.46 | n = int(eval(input()))
minv = int(eval(input()))
maxv = -1000000000
for i in range(1,n):
r = int(eval(input()))
maxv = max(maxv,r-minv)
minv = min(r,minv)
print(maxv) | n = int(eval(input()))
minv = int(eval(input()))
maxv = -1000000000
for i in range(1,n):
r = int(eval(input()))
m = r-minv
if maxv < m < 0:
maxv = m
minv = r
elif maxv < m:
maxv = m
elif m < 0:
minv = r
print(maxv) | 10 | 16 | 165 | 239 | n = int(eval(input()))
minv = int(eval(input()))
maxv = -1000000000
for i in range(1, n):
r = int(eval(input()))
maxv = max(maxv, r - minv)
minv = min(r, minv)
print(maxv)
| n = int(eval(input()))
minv = int(eval(input()))
maxv = -1000000000
for i in range(1, n):
r = int(eval(input()))
m = r - minv
if maxv < m < 0:
maxv = m
minv = r
elif maxv < m:
maxv = m
elif m < 0:
minv = r
print(maxv)
| false | 37.5 | [
"- maxv = max(maxv, r - minv)",
"- minv = min(r, minv)",
"+ m = r - minv",
"+ if maxv < m < 0:",
"+ maxv = m",
"+ minv = r",
"+ elif maxv < m:",
"+ maxv = m",
"+ elif m < 0:",
"+ minv = r"
] | false | 0.037264 | 0.04411 | 0.844809 | [
"s505155993",
"s391364011"
] |
u685263709 | p03457 | python | s566759422 | s566989020 | 463 | 415 | 18,180 | 18,092 | Accepted | Accepted | 10.37 | n = int(eval(input()))
travel_plan = []
for i in range(n):
travel_plan.append(tuple(map(int, input().split())))
travel_plan = [(0, 0, 0)] + travel_plan
for i in range(n):
t1 = travel_plan[i][0]
x1 = travel_plan[i][1]
y1 = travel_plan[i][2]
t2 = travel_plan[i+1][0]
x2 = travel_plan[i+... | n = int(eval(input()))
travel_plan = [tuple(map(int, input().split())) for i in range(n)]
travel_plan = [(0, 0, 0)] + travel_plan
for i in range(n):
t1 = travel_plan[i][0]
x1 = travel_plan[i][1]
y1 = travel_plan[i][2]
t2 = travel_plan[i+1][0]
x2 = travel_plan[i+1][1]
y2 = travel_plan[... | 20 | 18 | 504 | 476 | n = int(eval(input()))
travel_plan = []
for i in range(n):
travel_plan.append(tuple(map(int, input().split())))
travel_plan = [(0, 0, 0)] + travel_plan
for i in range(n):
t1 = travel_plan[i][0]
x1 = travel_plan[i][1]
y1 = travel_plan[i][2]
t2 = travel_plan[i + 1][0]
x2 = travel_plan[i + 1][1]
... | n = int(eval(input()))
travel_plan = [tuple(map(int, input().split())) for i in range(n)]
travel_plan = [(0, 0, 0)] + travel_plan
for i in range(n):
t1 = travel_plan[i][0]
x1 = travel_plan[i][1]
y1 = travel_plan[i][2]
t2 = travel_plan[i + 1][0]
x2 = travel_plan[i + 1][1]
y2 = travel_plan[i + 1][... | false | 10 | [
"-travel_plan = []",
"-for i in range(n):",
"- travel_plan.append(tuple(map(int, input().split())))",
"+travel_plan = [tuple(map(int, input().split())) for i in range(n)]"
] | false | 0.044217 | 0.043115 | 1.025569 | [
"s566759422",
"s566989020"
] |
u074220993 | p03699 | python | s715872165 | s714393998 | 239 | 127 | 9,200 | 9,204 | Accepted | Accepted | 46.86 | N = int(eval(input()))
maxs = 0
s = []
for i in range(N):
cin = int(eval(input()))
s.append(cin)
maxs = max(maxs, cin)
M = maxs * N
dp = [False] * (M+1)
dp[0] = True
for x in s:
for i in range(M+1):
if M-i < x: continue
if dp[M-i-x]: dp[M-i] = True
for i in range(... | with open(0) as f:
N, *S = list(map(int, f.read().split()))
Score = [True if i == 0 else False for i in range(10000)]
for s in S:
for i in reversed(list(range(s, 10000))):
if Score[i-s]:
Score[i] = True
for i in reversed(list(range(10000))):
if Score[i] and i % 10 != 0:
... | 23 | 14 | 405 | 349 | N = int(eval(input()))
maxs = 0
s = []
for i in range(N):
cin = int(eval(input()))
s.append(cin)
maxs = max(maxs, cin)
M = maxs * N
dp = [False] * (M + 1)
dp[0] = True
for x in s:
for i in range(M + 1):
if M - i < x:
continue
if dp[M - i - x]:
dp[M - i] = True
for... | with open(0) as f:
N, *S = list(map(int, f.read().split()))
Score = [True if i == 0 else False for i in range(10000)]
for s in S:
for i in reversed(list(range(s, 10000))):
if Score[i - s]:
Score[i] = True
for i in reversed(list(range(10000))):
if Score[i] and i % 10 != 0:
print(i... | false | 39.130435 | [
"-N = int(eval(input()))",
"-maxs = 0",
"-s = []",
"-for i in range(N):",
"- cin = int(eval(input()))",
"- s.append(cin)",
"- maxs = max(maxs, cin)",
"-M = maxs * N",
"-dp = [False] * (M + 1)",
"-dp[0] = True",
"-for x in s:",
"- for i in range(M + 1):",
"- if M - i < x:",... | false | 0.038701 | 0.102145 | 0.378884 | [
"s715872165",
"s714393998"
] |
u811436126 | p03805 | python | s289547555 | s562390606 | 30 | 27 | 3,064 | 3,064 | Accepted | Accepted | 10 | n, m = list(map(int, input().split()))
graph = [[] for _ in range(n + 1)]
for _ in range(m):
a, b = list(map(int, input().split()))
graph[a].append(b)
graph[b].append(a)
visit = [0] * (n + 1)
def dfs(now, depth):
if visit[now]:
return 0
if depth == n:
return 1
... | n, m = list(map(int, input().split()))
graph = [[] for _ in range(n + 1)]
for _ in range(m):
a, b = list(map(int, input().split()))
graph[a].append(b)
graph[b].append(a)
visit = [0] * (n + 1)
ans = 0
def dfs(now, depth):
global ans
if visit[now]:
pass
if depth == n:
... | 28 | 28 | 502 | 508 | n, m = list(map(int, input().split()))
graph = [[] for _ in range(n + 1)]
for _ in range(m):
a, b = list(map(int, input().split()))
graph[a].append(b)
graph[b].append(a)
visit = [0] * (n + 1)
def dfs(now, depth):
if visit[now]:
return 0
if depth == n:
return 1
count = 0
vis... | n, m = list(map(int, input().split()))
graph = [[] for _ in range(n + 1)]
for _ in range(m):
a, b = list(map(int, input().split()))
graph[a].append(b)
graph[b].append(a)
visit = [0] * (n + 1)
ans = 0
def dfs(now, depth):
global ans
if visit[now]:
pass
if depth == n:
ans += 1
... | false | 0 | [
"+ans = 0",
"+ global ans",
"- return 0",
"+ pass",
"- return 1",
"- count = 0",
"+ ans += 1",
"- count += dfs(i, depth + 1)",
"+ if visit[i] == 0:",
"+ dfs(i, depth + 1)",
"- return count",
"-ans = dfs(1, 1)",
"+dfs(1... | false | 0.041201 | 0.04077 | 1.01059 | [
"s289547555",
"s562390606"
] |
u681323954 | p02554 | python | s416476317 | s418456794 | 483 | 391 | 9,188 | 10,660 | Accepted | Accepted | 19.05 | """
int(input())
map(int, input().split())
list(map(int, input().split()))
input()
input().split()
"""
n = int(eval(input()))
mod = 1000000007
tmp = 1
diff = 1
eight = 1
for i in range(n):
tmp *= 10
tmp %= mod
diff *= 9
diff %= mod
eight *= 8
eight %= mod
ans = tmp -... | """
int(input())
map(int, input().split())
list(map(int, input().split()))
input()
input().split()
"""
n = int(eval(input()))
mod = 1000000007
tmp = (10**n)%mod
diff = 2*(9**n)%mod
eight = (8**n)%mod
ans = tmp - diff + eight
ans%=mod
print(ans)
| 34 | 18 | 465 | 259 | """
int(input())
map(int, input().split())
list(map(int, input().split()))
input()
input().split()
"""
n = int(eval(input()))
mod = 1000000007
tmp = 1
diff = 1
eight = 1
for i in range(n):
tmp *= 10
tmp %= mod
diff *= 9
diff %= mod
eight *= 8
eight %= mod
ans = tmp - 2 * diff + eight
ans %= mod
... | """
int(input())
map(int, input().split())
list(map(int, input().split()))
input()
input().split()
"""
n = int(eval(input()))
mod = 1000000007
tmp = (10**n) % mod
diff = 2 * (9**n) % mod
eight = (8**n) % mod
ans = tmp - diff + eight
ans %= mod
print(ans)
| false | 47.058824 | [
"-tmp = 1",
"-diff = 1",
"-eight = 1",
"-for i in range(n):",
"- tmp *= 10",
"- tmp %= mod",
"- diff *= 9",
"- diff %= mod",
"- eight *= 8",
"- eight %= mod",
"-ans = tmp - 2 * diff + eight",
"+tmp = (10**n) % mod",
"+diff = 2 * (9**n) % mod",
"+eight = (8**n) % mod",
"... | false | 0.354592 | 0.353431 | 1.003286 | [
"s416476317",
"s418456794"
] |
u223646582 | p03062 | python | s852626855 | s904969405 | 226 | 94 | 64,880 | 14,412 | Accepted | Accepted | 58.41 | N = int(eval(input()))
A = [int(i) for i in input().split()]
cnt = 0
s = 0
minabs = 10**11
for a in A:
if a <= -1:
cnt += 1
s += abs(a)
minabs = min(minabs, abs(a))
if cnt % 2 == 0:
print(s)
else:
print((s-minabs*2))
| N = int(eval(input()))
A = [int(i) for i in input().split()]
m = 10**20
c = 0
for a in A:
if a < 0:
c += 1
m = min(m, abs(a))
if c % 2 == 0:
ans = sum([abs(a) for a in A])
else:
ans = sum([abs(a) for a in A]) - m*2
print(ans)
| 16 | 16 | 254 | 262 | N = int(eval(input()))
A = [int(i) for i in input().split()]
cnt = 0
s = 0
minabs = 10**11
for a in A:
if a <= -1:
cnt += 1
s += abs(a)
minabs = min(minabs, abs(a))
if cnt % 2 == 0:
print(s)
else:
print((s - minabs * 2))
| N = int(eval(input()))
A = [int(i) for i in input().split()]
m = 10**20
c = 0
for a in A:
if a < 0:
c += 1
m = min(m, abs(a))
if c % 2 == 0:
ans = sum([abs(a) for a in A])
else:
ans = sum([abs(a) for a in A]) - m * 2
print(ans)
| false | 0 | [
"-cnt = 0",
"-s = 0",
"-minabs = 10**11",
"+m = 10**20",
"+c = 0",
"- if a <= -1:",
"- cnt += 1",
"- s += abs(a)",
"- minabs = min(minabs, abs(a))",
"-if cnt % 2 == 0:",
"- print(s)",
"+ if a < 0:",
"+ c += 1",
"+ m = min(m, abs(a))",
"+if c % 2 == 0:",
... | false | 0.034849 | 0.033465 | 1.041367 | [
"s852626855",
"s904969405"
] |
u940102677 | p03127 | python | s550103821 | s953856488 | 114 | 90 | 16,240 | 16,240 | Accepted | Accepted | 21.05 | import fractions
n = int(eval(input()))
a = list(map(int,input().split()))
d = a[0]
for t in a:
d = fractions.gcd(d, t)
print(d) | import fractions
n = int(eval(input()))
a = list(map(int,input().split()))
d = min(a)
for t in a:
d = fractions.gcd(d, t)
print(d) | 7 | 7 | 130 | 132 | import fractions
n = int(eval(input()))
a = list(map(int, input().split()))
d = a[0]
for t in a:
d = fractions.gcd(d, t)
print(d)
| import fractions
n = int(eval(input()))
a = list(map(int, input().split()))
d = min(a)
for t in a:
d = fractions.gcd(d, t)
print(d)
| false | 0 | [
"-d = a[0]",
"+d = min(a)"
] | false | 0.049524 | 0.04856 | 1.019857 | [
"s550103821",
"s953856488"
] |
u250944591 | p03737 | python | s674005340 | s117745989 | 27 | 24 | 9,020 | 9,092 | Accepted | Accepted | 11.11 | a,b,c=input().split()
print((a[0].upper()+b[0].upper()+c[0].upper())) | a,b,c=input().split()
print(((a[0]+b[0]+c[0]).upper())) | 2 | 2 | 68 | 54 | a, b, c = input().split()
print((a[0].upper() + b[0].upper() + c[0].upper()))
| a, b, c = input().split()
print(((a[0] + b[0] + c[0]).upper()))
| false | 0 | [
"-print((a[0].upper() + b[0].upper() + c[0].upper()))",
"+print(((a[0] + b[0] + c[0]).upper()))"
] | false | 0.044409 | 0.047271 | 0.939458 | [
"s674005340",
"s117745989"
] |
u226108478 | p03326 | python | s450409642 | s296186814 | 30 | 27 | 3,444 | 3,316 | Accepted | Accepted | 10 | # -*- coding: utf-8 -*-
# AtCoder Beginner Contest
if __name__ == '__main__':
from itertools import product
from heapq import nlargest
n, m = list(map(int, input().split()))
xyz = [list(map(int, input().split())) for i in range(n)]
ans = 0
# See:
# https://beta.atcoder.jp/co... | # -*- coding: utf-8 -*-
def main():
from itertools import product
n, m = list(map(int, input().split()))
xyz = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for op1, op2, op3 in list(product([1, -1], repeat=3)):
tmp = [[0, 0, 0]] * n
for index, value i... | 25 | 24 | 643 | 569 | # -*- coding: utf-8 -*-
# AtCoder Beginner Contest
if __name__ == "__main__":
from itertools import product
from heapq import nlargest
n, m = list(map(int, input().split()))
xyz = [list(map(int, input().split())) for i in range(n)]
ans = 0
# See:
# https://beta.atcoder.jp/contests/abc100/su... | # -*- coding: utf-8 -*-
def main():
from itertools import product
n, m = list(map(int, input().split()))
xyz = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for op1, op2, op3 in list(product([1, -1], repeat=3)):
tmp = [[0, 0, 0]] * n
for index, value in enumerate(xyz):... | false | 4 | [
"-# AtCoder Beginner Contest",
"-if __name__ == \"__main__\":",
"+def main():",
"- from heapq import nlargest",
"- xyz = [list(map(int, input().split())) for i in range(n)]",
"+ xyz = [list(map(int, input().split())) for _ in range(n)]",
"- # See:",
"- # https://beta.atcoder.jp/contests... | false | 0.050967 | 0.050381 | 1.011632 | [
"s450409642",
"s296186814"
] |
u275392848 | p02756 | python | s703335909 | s392500755 | 1,862 | 1,426 | 4,412 | 4,400 | Accepted | Accepted | 23.42 | s=eval(input())
count=0
s1=str()
s2=str()
for _ in range(int(eval(input()))):
l=list(map(str,input().split()))
if l[0]=='1':
count+=1
elif count%2==0:
if l[1]=='1':
s1=l[2]+s1
else:
s2=s2+l[2]
else:
if l[1]=='2':
s1=l[2]+s1
else:
s2=s2+l[2]
s=s1+... | import sys
input = lambda: sys.stdin.readline().rstrip()
s=eval(input())
count=0
s1=str()
s2=str()
for _ in range(int(eval(input()))):
l=list(map(str,input().split()))
if l[0]=='1':
count+=1
elif count%2==0:
if l[1]=='1':
s1=l[2]+s1
else:
s2=s2+l[2]
else:
if l[1]... | 23 | 25 | 351 | 411 | s = eval(input())
count = 0
s1 = str()
s2 = str()
for _ in range(int(eval(input()))):
l = list(map(str, input().split()))
if l[0] == "1":
count += 1
elif count % 2 == 0:
if l[1] == "1":
s1 = l[2] + s1
else:
s2 = s2 + l[2]
else:
if l[1] == "2":
... | import sys
input = lambda: sys.stdin.readline().rstrip()
s = eval(input())
count = 0
s1 = str()
s2 = str()
for _ in range(int(eval(input()))):
l = list(map(str, input().split()))
if l[0] == "1":
count += 1
elif count % 2 == 0:
if l[1] == "1":
s1 = l[2] + s1
else:
... | false | 8 | [
"+import sys",
"+",
"+input = lambda: sys.stdin.readline().rstrip()"
] | false | 0.102509 | 0.070396 | 1.456176 | [
"s703335909",
"s392500755"
] |
u622570247 | p02727 | python | s193342863 | s373314390 | 674 | 244 | 43,296 | 22,508 | Accepted | Accepted | 63.8 | import heapq
x, y, a, b, c = list(map(int, input().split()))
pp = list([(-int(x), 1) for x in input().split()])
qq = list([(-int(x), 2) for x in input().split()])
rr = list([(-int(x), 3) for x in input().split()])
xx = pp + qq + rr
heapq.heapify(xx)
t = x + y
ans = 0
for _ in range(t):
while len(xx) >... | x, y, a, b, c = list(map(int, input().split()))
pp = list(sorted(map(int, input().split()), reverse=True))[:x]
qq = list(sorted(map(int, input().split()), reverse=True))[:y]
rr = list(map(int, input().split()))
xx = list(sorted(pp + qq + rr, reverse=True))[:x+y]
print((sum(xx)))
| 27 | 7 | 595 | 279 | import heapq
x, y, a, b, c = list(map(int, input().split()))
pp = list([(-int(x), 1) for x in input().split()])
qq = list([(-int(x), 2) for x in input().split()])
rr = list([(-int(x), 3) for x in input().split()])
xx = pp + qq + rr
heapq.heapify(xx)
t = x + y
ans = 0
for _ in range(t):
while len(xx) > 0:
v... | x, y, a, b, c = list(map(int, input().split()))
pp = list(sorted(map(int, input().split()), reverse=True))[:x]
qq = list(sorted(map(int, input().split()), reverse=True))[:y]
rr = list(map(int, input().split()))
xx = list(sorted(pp + qq + rr, reverse=True))[: x + y]
print((sum(xx)))
| false | 74.074074 | [
"-import heapq",
"-",
"-pp = list([(-int(x), 1) for x in input().split()])",
"-qq = list([(-int(x), 2) for x in input().split()])",
"-rr = list([(-int(x), 3) for x in input().split()])",
"-xx = pp + qq + rr",
"-heapq.heapify(xx)",
"-t = x + y",
"-ans = 0",
"-for _ in range(t):",
"- while len(... | false | 0.071067 | 0.044427 | 1.599632 | [
"s193342863",
"s373314390"
] |
u620084012 | p03860 | python | s136974041 | s421167861 | 193 | 175 | 38,256 | 38,256 | Accepted | Accepted | 9.33 | S = input().split()
print(("A"+S[1][0]+"C"))
| a, b, c = input().split()
print((a[0]+b[0]+c[0]))
| 2 | 2 | 44 | 49 | S = input().split()
print(("A" + S[1][0] + "C"))
| a, b, c = input().split()
print((a[0] + b[0] + c[0]))
| false | 0 | [
"-S = input().split()",
"-print((\"A\" + S[1][0] + \"C\"))",
"+a, b, c = input().split()",
"+print((a[0] + b[0] + c[0]))"
] | false | 0.048733 | 0.047836 | 1.018757 | [
"s136974041",
"s421167861"
] |
u860002137 | p03774 | python | s049425673 | s604763264 | 173 | 117 | 12,868 | 27,168 | Accepted | Accepted | 32.37 | import numpy as np
N, M = list(map(int, input().split()))
ab = []
for i in range(N):
tmp = list(map(int, input().split()))
ab.append(tmp)
ab = np.array(ab)
dist = np.full([N, M], np.inf)
for m in range(M):
tmp = np.array(list(map(int, input().split())))
for n in range(N):
dist... | import numpy as np
n, m = map(int, input().split())
ab = []
for _ in range(n):
a, b = map(int, input().split())
ab.append((a, b))
result = np.zeros([m, n], dtype=np.int64)
cd = []
for i in range(m):
c, d = map(int, input().split())
for j, (a, b) in enumerate(ab):
result[i, j] ... | 21 | 18 | 420 | 392 | import numpy as np
N, M = list(map(int, input().split()))
ab = []
for i in range(N):
tmp = list(map(int, input().split()))
ab.append(tmp)
ab = np.array(ab)
dist = np.full([N, M], np.inf)
for m in range(M):
tmp = np.array(list(map(int, input().split())))
for n in range(N):
dist[n, m] = np.abs(ab... | import numpy as np
n, m = map(int, input().split())
ab = []
for _ in range(n):
a, b = map(int, input().split())
ab.append((a, b))
result = np.zeros([m, n], dtype=np.int64)
cd = []
for i in range(m):
c, d = map(int, input().split())
for j, (a, b) in enumerate(ab):
result[i, j] = abs(a - c) + abs... | false | 14.285714 | [
"-N, M = list(map(int, input().split()))",
"+n, m = map(int, input().split())",
"-for i in range(N):",
"- tmp = list(map(int, input().split()))",
"- ab.append(tmp)",
"-ab = np.array(ab)",
"-dist = np.full([N, M], np.inf)",
"-for m in range(M):",
"- tmp = np.array(list(map(int, input().split... | false | 0.473463 | 0.31322 | 1.511596 | [
"s049425673",
"s604763264"
] |
u627691992 | p04044 | python | s457733511 | s293233663 | 27 | 24 | 9,160 | 9,096 | Accepted | Accepted | 11.11 | N, L = map(int, input().split())
s = [input() for i in range(N)]
s.sort()
print(*s, sep="")
| N, L = map(int, input().split())
s = sorted([input() for i in range(N)])
print(*s, sep="")
| 4 | 3 | 95 | 93 | N, L = map(int, input().split())
s = [input() for i in range(N)]
s.sort()
print(*s, sep="")
| N, L = map(int, input().split())
s = sorted([input() for i in range(N)])
print(*s, sep="")
| false | 25 | [
"-s = [input() for i in range(N)]",
"-s.sort()",
"+s = sorted([input() for i in range(N)])"
] | false | 0.079189 | 0.130561 | 0.606532 | [
"s457733511",
"s293233663"
] |
u314050667 | p03095 | python | s791395795 | s942004478 | 59 | 39 | 3,956 | 3,188 | Accepted | Accepted | 33.9 | mod = 10**9 + 7
N = int(eval(input()))
S = list(eval(input()))
al = [chr(ord("a") + i ) for i in range(26)]
cntAl = [ S.count(chr(ord("a") + i )) for i in range(26)]
ans = 1
for a in cntAl:
if a != 0:ans *= (a+1)%mod
print(((ans-1)%mod)) | n = int(eval(input()))
s = eval(input())
mod = 10**9 + 7
car = [0] * 26
for i in range(n):
car[ord(s[i])-97] += 1
ans = 1
for i in range(26):
if car[i] == 0:
continue
else:
ans *= (car[i]+1)
ans %= mod
print((ans - 1)) | 9 | 17 | 235 | 232 | mod = 10**9 + 7
N = int(eval(input()))
S = list(eval(input()))
al = [chr(ord("a") + i) for i in range(26)]
cntAl = [S.count(chr(ord("a") + i)) for i in range(26)]
ans = 1
for a in cntAl:
if a != 0:
ans *= (a + 1) % mod
print(((ans - 1) % mod))
| n = int(eval(input()))
s = eval(input())
mod = 10**9 + 7
car = [0] * 26
for i in range(n):
car[ord(s[i]) - 97] += 1
ans = 1
for i in range(26):
if car[i] == 0:
continue
else:
ans *= car[i] + 1
ans %= mod
print((ans - 1))
| false | 47.058824 | [
"+n = int(eval(input()))",
"+s = eval(input())",
"-N = int(eval(input()))",
"-S = list(eval(input()))",
"-al = [chr(ord(\"a\") + i) for i in range(26)]",
"-cntAl = [S.count(chr(ord(\"a\") + i)) for i in range(26)]",
"+car = [0] * 26",
"+for i in range(n):",
"+ car[ord(s[i]) - 97] += 1",
"-for a... | false | 0.047262 | 0.048141 | 0.98175 | [
"s791395795",
"s942004478"
] |
u050708958 | p02934 | python | s251359147 | s325024254 | 22 | 17 | 3,572 | 2,940 | Accepted | Accepted | 22.73 | from functools import reduce
eval(input())
a = [int(i) for i in input().split()]
print((1 / reduce(lambda x, y: x + 1/y, [0] + a)))
| eval(input())
print((1 / sum(1/int(x) for x in input().split())))
| 4 | 2 | 127 | 59 | from functools import reduce
eval(input())
a = [int(i) for i in input().split()]
print((1 / reduce(lambda x, y: x + 1 / y, [0] + a)))
| eval(input())
print((1 / sum(1 / int(x) for x in input().split())))
| false | 50 | [
"-from functools import reduce",
"-",
"-a = [int(i) for i in input().split()]",
"-print((1 / reduce(lambda x, y: x + 1 / y, [0] + a)))",
"+print((1 / sum(1 / int(x) for x in input().split())))"
] | false | 0.039906 | 0.037258 | 1.071053 | [
"s251359147",
"s325024254"
] |
u909716307 | p03137 | python | s234345096 | s985991256 | 123 | 96 | 13,960 | 13,960 | Accepted | Accepted | 21.95 | N,M=list(map(int,input().split()))
X=list(map(int,input().split()))
if(N>=M):
print((0))
else:
X.sort()
b=[]
for i in range(M-1):
b.append(X[i+1]-X[i])
b.sort()
for _ in range(N-1):
b.pop()
print((sum(b)))
| n,m=list(map(int,input().split()))
l=sorted(list(map(int,input().split())))
if n>=m:
print((0))
exit()
s=l[-1]-l[0]
l=sorted([a-b for a,b in zip(l[1:],l)], reverse=True)
print((s-sum(l[:n-1])))
| 13 | 8 | 252 | 199 | N, M = list(map(int, input().split()))
X = list(map(int, input().split()))
if N >= M:
print((0))
else:
X.sort()
b = []
for i in range(M - 1):
b.append(X[i + 1] - X[i])
b.sort()
for _ in range(N - 1):
b.pop()
print((sum(b)))
| n, m = list(map(int, input().split()))
l = sorted(list(map(int, input().split())))
if n >= m:
print((0))
exit()
s = l[-1] - l[0]
l = sorted([a - b for a, b in zip(l[1:], l)], reverse=True)
print((s - sum(l[: n - 1])))
| false | 38.461538 | [
"-N, M = list(map(int, input().split()))",
"-X = list(map(int, input().split()))",
"-if N >= M:",
"+n, m = list(map(int, input().split()))",
"+l = sorted(list(map(int, input().split())))",
"+if n >= m:",
"-else:",
"- X.sort()",
"- b = []",
"- for i in range(M - 1):",
"- b.append(... | false | 0.054948 | 0.036531 | 1.504143 | [
"s234345096",
"s985991256"
] |
u261103969 | p02553 | python | s281281756 | s705072928 | 95 | 29 | 61,708 | 9,108 | Accepted | Accepted | 69.47 | import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)
def main():
a, b, c, d = list(map(int, readline().split()))
ans = -INF
for x in (a, b):
for y in (c, d):
ans = max(ans, x * y)
print(ans)
if __name... | a, b, c, d = list(map(int, input().split()))
ans = -float("INF") # 答えがマイナスになることがあるので、負の無限大を初期値にしておきます
for x in (a, b):
for y in (c, d):
ans = max(ans, x * y)
print(ans) | 22 | 9 | 344 | 186 | import sys
readline = sys.stdin.readline
MOD = 10**9 + 7
INF = float("INF")
sys.setrecursionlimit(10**5)
def main():
a, b, c, d = list(map(int, readline().split()))
ans = -INF
for x in (a, b):
for y in (c, d):
ans = max(ans, x * y)
print(ans)
if __name__ == "__main__":
main(... | a, b, c, d = list(map(int, input().split()))
ans = -float("INF") # 答えがマイナスになることがあるので、負の無限大を初期値にしておきます
for x in (a, b):
for y in (c, d):
ans = max(ans, x * y)
print(ans)
| false | 59.090909 | [
"-import sys",
"-",
"-readline = sys.stdin.readline",
"-MOD = 10**9 + 7",
"-INF = float(\"INF\")",
"-sys.setrecursionlimit(10**5)",
"-",
"-",
"-def main():",
"- a, b, c, d = list(map(int, readline().split()))",
"- ans = -INF",
"- for x in (a, b):",
"- for y in (c, d):",
"- ... | false | 0.056069 | 0.053942 | 1.039434 | [
"s281281756",
"s705072928"
] |
u867826040 | p02935 | python | s620924412 | s007254932 | 31 | 25 | 9,396 | 9,092 | Accepted | Accepted | 19.35 | from collections import deque
n = int(eval(input()))
v = sorted(map(float, input().split()))
ans = 0
v = deque(v)
while(len(v) > 1):
v.appendleft(((v.popleft() + v.popleft()) / 2))
print((v[0])) | n = int(eval(input()))
v = sorted(map(float, input().split()))
ans = v[0]
for i in range(n - 1):
ans = (ans + v[i + 1]) / 2
print(ans)
| 8 | 6 | 197 | 138 | from collections import deque
n = int(eval(input()))
v = sorted(map(float, input().split()))
ans = 0
v = deque(v)
while len(v) > 1:
v.appendleft(((v.popleft() + v.popleft()) / 2))
print((v[0]))
| n = int(eval(input()))
v = sorted(map(float, input().split()))
ans = v[0]
for i in range(n - 1):
ans = (ans + v[i + 1]) / 2
print(ans)
| false | 25 | [
"-from collections import deque",
"-",
"-ans = 0",
"-v = deque(v)",
"-while len(v) > 1:",
"- v.appendleft(((v.popleft() + v.popleft()) / 2))",
"-print((v[0]))",
"+ans = v[0]",
"+for i in range(n - 1):",
"+ ans = (ans + v[i + 1]) / 2",
"+print(ans)"
] | false | 0.039491 | 0.039967 | 0.98809 | [
"s620924412",
"s007254932"
] |
u499381410 | p03372 | python | s047873555 | s537817399 | 385 | 209 | 89,948 | 109,056 | Accepted | Accepted | 45.71 | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_... | 63 | 55 | 1,952 | 1,572 | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bise... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bise... | false | 12.698413 | [
"- return list(map(int, sys.stdin.buffer.readline().split()))",
"+ return list(map(int, sys.stdin.readline().split()))",
"- return int(sys.stdin.buffer.readline())",
"+ return int(sys.stdin.readline())",
"-rounding_max = [0]",
"-counter_rounding_max = [0]",
"-return_max = [0]",
"-counter_r... | false | 0.058845 | 0.038063 | 1.545991 | [
"s047873555",
"s537817399"
] |
u241159583 | p03730 | python | s724184122 | s587826110 | 32 | 29 | 9,088 | 9,036 | Accepted | Accepted | 9.38 | a,b,c = list(map(int, input().split()))
ans = "NO"
for x in range(b+1):
if (a*x) % b == c:
ans = "YES"
break
print(ans) | a,b,c = list(map(int, input().split()))
ans = "NO"
for i in range(1, b+1):
if (a*i) % b == c:
ans = "YES"
break
print(ans) | 7 | 7 | 139 | 142 | a, b, c = list(map(int, input().split()))
ans = "NO"
for x in range(b + 1):
if (a * x) % b == c:
ans = "YES"
break
print(ans)
| a, b, c = list(map(int, input().split()))
ans = "NO"
for i in range(1, b + 1):
if (a * i) % b == c:
ans = "YES"
break
print(ans)
| false | 0 | [
"-for x in range(b + 1):",
"- if (a * x) % b == c:",
"+for i in range(1, b + 1):",
"+ if (a * i) % b == c:"
] | false | 0.045711 | 0.036013 | 1.269297 | [
"s724184122",
"s587826110"
] |
u525065967 | p03574 | python | s601042534 | s615827835 | 38 | 31 | 9,264 | 9,252 | Accepted | Accepted | 18.42 | h, w = map(int, input().split())
S = [input() for _ in range(h)]
ans = [[-1]*w for _ in range(h)]
dy = [-1, 1, 0, 0, -1, 1, -1, 1]
dx = [ 0, 0,-1, 1, -1, 1, 1,-1]
for i in range(h):
for j in range(w):
if S[i][j] == '#': continue
ans[i][j] = 0
for k in range(8):
y... | dy = [-1, 1, 0, 0, -1, 1, -1, 1]
dx = [ 0, 0,-1, 1, -1, 1, 1,-1]
h, w = map(int, input().split())
S = [input() for _ in range(h)]
ans = [[-1]*w for _ in range(h)]
for i in range(h):
for j in range(w):
if S[i][j] == '#': continue
ans[i][j] = 0
for k in range(8):
y = i +... | 31 | 16 | 735 | 552 | h, w = map(int, input().split())
S = [input() for _ in range(h)]
ans = [[-1] * w for _ in range(h)]
dy = [-1, 1, 0, 0, -1, 1, -1, 1]
dx = [0, 0, -1, 1, -1, 1, 1, -1]
for i in range(h):
for j in range(w):
if S[i][j] == "#":
continue
ans[i][j] = 0
for k in range(8):
y =... | dy = [-1, 1, 0, 0, -1, 1, -1, 1]
dx = [0, 0, -1, 1, -1, 1, 1, -1]
h, w = map(int, input().split())
S = [input() for _ in range(h)]
ans = [[-1] * w for _ in range(h)]
for i in range(h):
for j in range(w):
if S[i][j] == "#":
continue
ans[i][j] = 0
for k in range(8):
y =... | false | 48.387097 | [
"+dy = [-1, 1, 0, 0, -1, 1, -1, 1]",
"+dx = [0, 0, -1, 1, -1, 1, 1, -1]",
"-dy = [-1, 1, 0, 0, -1, 1, -1, 1]",
"-dx = [0, 0, -1, 1, -1, 1, 1, -1]",
"- if y < 0 or h <= y:",
"- continue",
"- if x < 0 or w <= x:",
"+ if y < 0 or h <= y or x < 0 or w <= x:"... | false | 0.042556 | 0.043342 | 0.98188 | [
"s601042534",
"s615827835"
] |
u261103969 | p02584 | python | s699373336 | s744713449 | 32 | 28 | 9,140 | 9,044 | Accepted | Accepted | 12.5 | x, k, d = list(map(int, input().split()))
cur = abs(x) # 座標を正にしてしまいます
rem = k # 残りの移動回数です
cnt = min(cur // d, k) # 0に向かって移動する回数です
cur -= d * cnt
rem -= cnt
# 残り回数が0回の場合分けをする必要はないのですが、一応
if rem > 0:
if rem % 2 == 1:
cur = abs(cur - d)
print(cur) | x, k, d = list(map(int, input().split()))
cur = abs(x) # 座標を正にしてしまいます
rem = k # 残りの移動回数です
cnt = min(cur // d, k) # 0に向かって移動する回数です
cur -= d * cnt
rem -= cnt
# 0 % 2 = 0なので、残り回数の場合分けをする必要はないのですが、一応
if rem > 0:
if rem % 2 == 1:
cur = cur - d
ans = abs(cur)
print(ans) | 15 | 16 | 271 | 292 | x, k, d = list(map(int, input().split()))
cur = abs(x) # 座標を正にしてしまいます
rem = k # 残りの移動回数です
cnt = min(cur // d, k) # 0に向かって移動する回数です
cur -= d * cnt
rem -= cnt
# 残り回数が0回の場合分けをする必要はないのですが、一応
if rem > 0:
if rem % 2 == 1:
cur = abs(cur - d)
print(cur)
| x, k, d = list(map(int, input().split()))
cur = abs(x) # 座標を正にしてしまいます
rem = k # 残りの移動回数です
cnt = min(cur // d, k) # 0に向かって移動する回数です
cur -= d * cnt
rem -= cnt
# 0 % 2 = 0なので、残り回数の場合分けをする必要はないのですが、一応
if rem > 0:
if rem % 2 == 1:
cur = cur - d
ans = abs(cur)
print(ans)
| false | 6.25 | [
"-# 残り回数が0回の場合分けをする必要はないのですが、一応",
"+# 0 % 2 = 0なので、残り回数の場合分けをする必要はないのですが、一応",
"- cur = abs(cur - d)",
"-print(cur)",
"+ cur = cur - d",
"+ans = abs(cur)",
"+print(ans)"
] | false | 0.031252 | 0.084243 | 0.370971 | [
"s699373336",
"s744713449"
] |
u363610900 | p03544 | python | s622324017 | s840983120 | 20 | 17 | 2,940 | 2,940 | Accepted | Accepted | 15 | N = int(eval(input()))
L = [2, 1]
for i in range(2, N+2):
Li = L[i-1] + L[i-2]
L.append(Li)
print((L[N])) | N = int(eval(input()))
L = [2, 1]
for i in range(2, N+2):
L.append(L[i-1]+L[i-2])
print((L[N])) | 6 | 6 | 110 | 97 | N = int(eval(input()))
L = [2, 1]
for i in range(2, N + 2):
Li = L[i - 1] + L[i - 2]
L.append(Li)
print((L[N]))
| N = int(eval(input()))
L = [2, 1]
for i in range(2, N + 2):
L.append(L[i - 1] + L[i - 2])
print((L[N]))
| false | 0 | [
"- Li = L[i - 1] + L[i - 2]",
"- L.append(Li)",
"+ L.append(L[i - 1] + L[i - 2])"
] | false | 0.049399 | 0.048828 | 1.011695 | [
"s622324017",
"s840983120"
] |
u540761833 | p03611 | python | s202927399 | s648240005 | 266 | 205 | 14,004 | 14,092 | Accepted | Accepted | 22.93 | import bisect
N = int(eval(input()))
A = sorted(list(map(int,input().split())))
ans = 1
def search(A,a,b):
import bisect
ans = bisect.bisect_right(A,b) - bisect.bisect_left(A,a)
return ans
for i in range(A[-1]+1):
ans = max(ans,search(A,i-1,i+1))
print(ans) | import bisect
N = int(eval(input()))
A = sorted(list(map(int,input().split())))
ans = 1
for i in range(A[-1]+1):
ans = max(ans,bisect.bisect_right(A,i+1) - bisect.bisect_left(A,i-1))
print(ans) | 13 | 8 | 281 | 199 | import bisect
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
ans = 1
def search(A, a, b):
import bisect
ans = bisect.bisect_right(A, b) - bisect.bisect_left(A, a)
return ans
for i in range(A[-1] + 1):
ans = max(ans, search(A, i - 1, i + 1))
print(ans)
| import bisect
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
ans = 1
for i in range(A[-1] + 1):
ans = max(ans, bisect.bisect_right(A, i + 1) - bisect.bisect_left(A, i - 1))
print(ans)
| false | 38.461538 | [
"-",
"-",
"-def search(A, a, b):",
"- import bisect",
"-",
"- ans = bisect.bisect_right(A, b) - bisect.bisect_left(A, a)",
"- return ans",
"-",
"-",
"- ans = max(ans, search(A, i - 1, i + 1))",
"+ ans = max(ans, bisect.bisect_right(A, i + 1) - bisect.bisect_left(A, i - 1))"
] | false | 0.046347 | 0.044521 | 1.041025 | [
"s202927399",
"s648240005"
] |
u060938295 | p03167 | python | s426891053 | s158662041 | 1,431 | 1,308 | 25,172 | 25,188 | Accepted | Accepted | 8.6 | import sys
import numpy as np
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
H, W = list(map(int,input().split()))
#A = [list(map(int,input().split())) for _ in range(H)]
A = np.array([list(eval(input())) for _ in range(H)], 'U1')
eq = A == '.'
dp = np.zeros(W+1, dtype=int)
dp[1] = 1
for i in range(1,H+... | import sys
import numpy as np
def input():
return sys.stdin.readline()[:-1]
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
H, W = list(map(int,input().split()))
#A = [list(map(int,input().split())) for _ in range(H)]
A = np.array([list(eval(input())) for _ in range(H)], 'U1')
eq = A == '.'
dp = np... | 24 | 27 | 496 | 552 | import sys
import numpy as np
sys.setrecursionlimit(10**9)
mod = 10**9 + 7
H, W = list(map(int, input().split()))
# A = [list(map(int,input().split())) for _ in range(H)]
A = np.array([list(eval(input())) for _ in range(H)], "U1")
eq = A == "."
dp = np.zeros(W + 1, dtype=int)
dp[1] = 1
for i in range(1, H + 1):
pr... | import sys
import numpy as np
def input():
return sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**9)
mod = 10**9 + 7
H, W = list(map(int, input().split()))
# A = [list(map(int,input().split())) for _ in range(H)]
A = np.array([list(eval(input())) for _ in range(H)], "U1")
eq = A == "."
dp = np.zeros(W + 1, ... | false | 11.111111 | [
"+",
"+",
"+def input():",
"+ return sys.stdin.readline()[:-1]",
"+"
] | false | 0.315421 | 0.320257 | 0.984899 | [
"s426891053",
"s158662041"
] |
u078276601 | p02582 | python | s153655918 | s957274220 | 36 | 27 | 9,096 | 9,096 | Accepted | Accepted | 25 | S = eval(input())
if S.count("RRR") == 1:
print((3))
elif S.count("RRS") == 1 or S.count("SRR") == 1:
print((2))
elif S.count("SSS") == 1:
print((0))
else:
print((1)) | S=eval(input())
if "RRR" in S:
print((3))
elif "RR" in S:
print((2))
elif "R" in S:
print((1))
else:
print((0)) | 10 | 10 | 178 | 123 | S = eval(input())
if S.count("RRR") == 1:
print((3))
elif S.count("RRS") == 1 or S.count("SRR") == 1:
print((2))
elif S.count("SSS") == 1:
print((0))
else:
print((1))
| S = eval(input())
if "RRR" in S:
print((3))
elif "RR" in S:
print((2))
elif "R" in S:
print((1))
else:
print((0))
| false | 0 | [
"-if S.count(\"RRR\") == 1:",
"+if \"RRR\" in S:",
"-elif S.count(\"RRS\") == 1 or S.count(\"SRR\") == 1:",
"+elif \"RR\" in S:",
"-elif S.count(\"SSS\") == 1:",
"+elif \"R\" in S:",
"+ print((1))",
"+else:",
"-else:",
"- print((1))"
] | false | 0.047641 | 0.04713 | 1.010841 | [
"s153655918",
"s957274220"
] |
u219086885 | p03220 | python | s047372410 | s040424789 | 20 | 18 | 3,188 | 3,060 | Accepted | Accepted | 10 |
n = int(eval(input()))
t, a = [int(x) for x in input().split()]
locations =[int(x) for x in input().split()]
print((min([(i+1,abs(a - (t - x * 6e-3))) for i, x in enumerate(locations)],key=(lambda j:j[1]))[0]))
|
n = int(eval(input()))
t, a = [int(x) for x in input().split()]
locations =[int(x) for x in input().split()]
# print(min([(i+1,abs(a - (t - x * 6e-3))) for i, x in enumerate(locations)],key=(lambda j:j[1]))[0])
diff = [abs(a - (t - x * 6e-3)) for x in locations]
print((diff.index(min(diff))+1))
| 5 | 7 | 208 | 295 | n = int(eval(input()))
t, a = [int(x) for x in input().split()]
locations = [int(x) for x in input().split()]
print(
(
min(
[(i + 1, abs(a - (t - x * 6e-3))) for i, x in enumerate(locations)],
key=(lambda j: j[1]),
)[0]
)
)
| n = int(eval(input()))
t, a = [int(x) for x in input().split()]
locations = [int(x) for x in input().split()]
# print(min([(i+1,abs(a - (t - x * 6e-3))) for i, x in enumerate(locations)],key=(lambda j:j[1]))[0])
diff = [abs(a - (t - x * 6e-3)) for x in locations]
print((diff.index(min(diff)) + 1))
| false | 28.571429 | [
"-print(",
"- (",
"- min(",
"- [(i + 1, abs(a - (t - x * 6e-3))) for i, x in enumerate(locations)],",
"- key=(lambda j: j[1]),",
"- )[0]",
"- )",
"-)",
"+# print(min([(i+1,abs(a - (t - x * 6e-3))) for i, x in enumerate(locations)],key=(lambda j:j[1]))[0])",
... | false | 0.040145 | 0.039229 | 1.023343 | [
"s047372410",
"s040424789"
] |
u737311644 | p02388 | python | s476219242 | s021104534 | 30 | 20 | 7,624 | 5,572 | Accepted | Accepted | 33.33 | x=int(eval(input()))
a= x*x*x
print (a) | a=int(eval(input()))
print((a*a*a))
| 3 | 2 | 35 | 29 | x = int(eval(input()))
a = x * x * x
print(a)
| a = int(eval(input()))
print((a * a * a))
| false | 33.333333 | [
"-x = int(eval(input()))",
"-a = x * x * x",
"-print(a)",
"+a = int(eval(input()))",
"+print((a * a * a))"
] | false | 0.036487 | 0.051574 | 0.707474 | [
"s476219242",
"s021104534"
] |
u863309603 | p02683 | python | s362504778 | s696936461 | 87 | 79 | 9,212 | 9,228 | Accepted | Accepted | 9.2 | N, M, X = list(map(int, input().split()))
books = [list(map(int, input().split())) for _ in range(N)]
ans = -1
for bits in range(1 << N):
cost = 0
a = [0] * M
for i in range(N):
if (bits >> i) & 1 == 1:
cost += books[i][0]
for j in range(M):
a[j]... | import itertools
N, M, X = list(map(int, input().split()))
books = [list(map(int, input().split())) for _ in range(N)]
ans = -1
for i in range(N):
for choices in itertools.combinations(list(range(N)), i + 1):
cost = 0
a = [0] * M
for choice in choices:
cost += book... | 18 | 20 | 423 | 496 | N, M, X = list(map(int, input().split()))
books = [list(map(int, input().split())) for _ in range(N)]
ans = -1
for bits in range(1 << N):
cost = 0
a = [0] * M
for i in range(N):
if (bits >> i) & 1 == 1:
cost += books[i][0]
for j in range(M):
a[j] += books[i][j... | import itertools
N, M, X = list(map(int, input().split()))
books = [list(map(int, input().split())) for _ in range(N)]
ans = -1
for i in range(N):
for choices in itertools.combinations(list(range(N)), i + 1):
cost = 0
a = [0] * M
for choice in choices:
cost += books[choice][0]
... | false | 10 | [
"+import itertools",
"+",
"-for bits in range(1 << N):",
"- cost = 0",
"- a = [0] * M",
"- for i in range(N):",
"- if (bits >> i) & 1 == 1:",
"- cost += books[i][0]",
"+for i in range(N):",
"+ for choices in itertools.combinations(list(range(N)), i + 1):",
"+ ... | false | 0.047095 | 0.115424 | 0.408017 | [
"s362504778",
"s696936461"
] |
u357751375 | p03910 | python | s649792443 | s035479523 | 35 | 29 | 9,328 | 9,276 | Accepted | Accepted | 17.14 | n = int(eval(input()))
a = []
b = 0
i = 1
while b < n:
a.append(i)
b += i
i += 1
b -= n
for i in a:
if i != b:
print(i) | n = int(eval(input()))
ans = []
a = 0
for i in range(1,n+1):
a += i
ans.append(i)
if a >= n:
break
a -= n
for x in ans:
if x != a:
print(x) | 12 | 12 | 148 | 176 | n = int(eval(input()))
a = []
b = 0
i = 1
while b < n:
a.append(i)
b += i
i += 1
b -= n
for i in a:
if i != b:
print(i)
| n = int(eval(input()))
ans = []
a = 0
for i in range(1, n + 1):
a += i
ans.append(i)
if a >= n:
break
a -= n
for x in ans:
if x != a:
print(x)
| false | 0 | [
"-a = []",
"-b = 0",
"-i = 1",
"-while b < n:",
"- a.append(i)",
"- b += i",
"- i += 1",
"-b -= n",
"-for i in a:",
"- if i != b:",
"- print(i)",
"+ans = []",
"+a = 0",
"+for i in range(1, n + 1):",
"+ a += i",
"+ ans.append(i)",
"+ if a >= n:",
"+ ... | false | 0.042651 | 0.097214 | 0.438734 | [
"s649792443",
"s035479523"
] |
u881590806 | p02238 | python | s157349383 | s511282156 | 30 | 10 | 6,408 | 6,504 | Accepted | Accepted | 66.67 | n = int(input())
def dfs(u,t):
global graph
global found
global timestamp
if u in found: return t
found.add(u)
timestamp[u] = [-1,-1]
timestamp[u][0] = t
t += 1
for v in graph[u]:
t = dfs(v,t)
timestamp[u][1] = t
t += 1
return t
graph = [[] fo... | class Node:
def __init__(self,v):
self.v = v
self.c = []
def dfs(n,f,d,t,visited):
visited.add(n.v)
f[n.v] = t
t2 = t
for c in sorted(n.c,key=lambda x:x.v):
if not c.v in visited:
t2 = dfs(c,f,d,t2+1,visited)
d[n.v] = t2+1
return t2+1
n = ... | 37 | 39 | 664 | 911 | n = int(input())
def dfs(u, t):
global graph
global found
global timestamp
if u in found:
return t
found.add(u)
timestamp[u] = [-1, -1]
timestamp[u][0] = t
t += 1
for v in graph[u]:
t = dfs(v, t)
timestamp[u][1] = t
t += 1
return t
graph = [[] for i in... | class Node:
def __init__(self, v):
self.v = v
self.c = []
def dfs(n, f, d, t, visited):
visited.add(n.v)
f[n.v] = t
t2 = t
for c in sorted(n.c, key=lambda x: x.v):
if not c.v in visited:
t2 = dfs(c, f, d, t2 + 1, visited)
d[n.v] = t2 + 1
return t2 + 1
... | false | 5.128205 | [
"-n = int(input())",
"+class Node:",
"+ def __init__(self, v):",
"+ self.v = v",
"+ self.c = []",
"-def dfs(u, t):",
"- global graph",
"- global found",
"- global timestamp",
"- if u in found:",
"- return t",
"- found.add(u)",
"- timestamp[u] = [-1, ... | false | 0.038729 | 0.037156 | 1.04233 | [
"s157349383",
"s511282156"
] |
u320567105 | p03458 | python | s134705429 | s164673112 | 1,037 | 783 | 91,868 | 63,836 | Accepted | Accepted | 24.49 | ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
INF = 10**18
N,K=rl()
W = [[0 for _ in range(2*K+3)] for _ in range(2*K+3)]
for i in range(N):
x,y,c=input().split()
x = int(x)%(2*K)
... | ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
INF = 10**18
N,K=rl()
W = [[0 for _ in range(K+3)] for _ in range(K+3)]
for i in range(N):
x,y,c=input().split()
x = int(x)%(2*K)
y ... | 55 | 48 | 1,341 | 1,103 | ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print("YES") if b else print("NO")
INF = 10**18
N, K = rl()
W = [[0 for _ in range(2 * K + 3)] for _ in range(2 * K + 3)]
for i in range(N):
x, y, c = input().split()
x = int(x) % (2 * K... | ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print("YES") if b else print("NO")
INF = 10**18
N, K = rl()
W = [[0 for _ in range(K + 3)] for _ in range(K + 3)]
for i in range(N):
x, y, c = input().split()
x = int(x) % (2 * K)
y ... | false | 12.727273 | [
"-W = [[0 for _ in range(2 * K + 3)] for _ in range(2 * K + 3)]",
"+W = [[0 for _ in range(K + 3)] for _ in range(K + 3)]",
"- W[0][y + K + 1] -= 1",
"+ W[x + 1][y + 1] -= 2",
"+ W[0][K + 1] -= 1",
"+ W[x + 1][K + 1] += 1",
"- W[x + 1][y + 1] -= 2",
"- W[x + 1... | false | 1.013227 | 0.516437 | 1.961957 | [
"s134705429",
"s164673112"
] |
u947883560 | p03282 | python | s330762252 | s190458735 | 29 | 17 | 4,184 | 3,060 | Accepted | Accepted | 41.38 | #!/usr/bin/env python3
import sys
import itertools
import collections
import functools
import math
from queue import Queue
# import numpy as np
INF = float("inf")
def solve(S: int, K: int):
n = -1
nc = 1
for i, c in enumerate(str(S)):
if c != "1":
n = i+1
n... | #!/usr/bin/env python3
import sys
INF = float("inf")
def solve(S: str, K: int):
for i in range(K):
if S[i] != "1":
c = S[i]
break
else:
print((1))
return
print(c)
return
def main():
def iterate_tokens():
for line in... | 46 | 33 | 815 | 569 | #!/usr/bin/env python3
import sys
import itertools
import collections
import functools
import math
from queue import Queue
# import numpy as np
INF = float("inf")
def solve(S: int, K: int):
n = -1
nc = 1
for i, c in enumerate(str(S)):
if c != "1":
n = i + 1
nc = c
... | #!/usr/bin/env python3
import sys
INF = float("inf")
def solve(S: str, K: int):
for i in range(K):
if S[i] != "1":
c = S[i]
break
else:
print((1))
return
print(c)
return
def main():
def iterate_tokens():
for line in sys.stdin:
... | false | 28.26087 | [
"-import itertools",
"-import collections",
"-import functools",
"-import math",
"-from queue import Queue",
"-# import numpy as np",
"-def solve(S: int, K: int):",
"- n = -1",
"- nc = 1",
"- for i, c in enumerate(str(S)):",
"- if c != \"1\":",
"- n = i + 1",
"- ... | false | 0.087545 | 0.065116 | 1.344457 | [
"s330762252",
"s190458735"
] |
u454557108 | p03053 | python | s880582074 | s719695093 | 929 | 846 | 158,064 | 167,676 | Accepted | Accepted | 8.93 | from collections import deque
def bfs(maze, visited, s, h, w):
queue = deque(s)
# 返り値
va = 0
while queue:
y,x = queue.popleft()
for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
new_y, new_x = y+j, x+k
if new_x < 0 or new_x >= w or new_y < 0 or new_y >=h :
continue
i... | from collections import deque
def bfs(maze, visited, s, h, w):
queue = deque(s)
# 返り値
va = 0
while queue:
y,x = queue.popleft()
for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
new_y, new_x = y+j, x+k
if new_x < 0 or new_x >= w or new_y < 0 or new_y >=h :
continue
i... | 40 | 34 | 1,002 | 885 | from collections import deque
def bfs(maze, visited, s, h, w):
queue = deque(s)
# 返り値
va = 0
while queue:
y, x = queue.popleft()
for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
new_y, new_x = y + j, x + k
if new_x < 0 or new_x >= w or new_y < 0 or new_y >= h:
... | from collections import deque
def bfs(maze, visited, s, h, w):
queue = deque(s)
# 返り値
va = 0
while queue:
y, x = queue.popleft()
for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
new_y, new_x = y + j, x + k
if new_x < 0 or new_x >= w or new_y < 0 or new_y >= h:
... | false | 15 | [
"-maze = [[\"\" for j in range(w)] for i in range(h)]",
"+maze = [[\".\" for j in range(w)] for i in range(h)]",
"+visited = [[-1] * (w) for _ in range(h)]",
"+s = []",
"+s_append = s.append",
"- maze[i][j] = m1[j]",
"-visited = [[-1] * (w) for _ in range(h)]",
"-ans = []",
"-s = []",
"-s_a... | false | 0.044887 | 0.047076 | 0.953509 | [
"s880582074",
"s719695093"
] |
u554133763 | p02718 | python | s122087295 | s165377592 | 186 | 89 | 77,144 | 61,628 | Accepted | Accepted | 52.15 | from decimal import Decimal
n,m = list(map(int, input().split()))
A = list(map(int, input().split()))
line = Decimal(sum(A) / (4 * m))
cnt = 0
for a in A:
if a >= line:
cnt += 1
if cnt >= m:
print('Yes')
break
else:
print('No') | n,m = list(map(int, input().split()))
A = sorted(list(map(int, input().split())), reverse = True)
s = sum(A)
cnt = 0
for a in A:
if a*4*m >= s:
cnt += 1
if cnt >= m:
print('Yes')
break
else:
print('No') | 14 | 12 | 271 | 243 | from decimal import Decimal
n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
line = Decimal(sum(A) / (4 * m))
cnt = 0
for a in A:
if a >= line:
cnt += 1
if cnt >= m:
print("Yes")
break
else:
print("No")
| n, m = list(map(int, input().split()))
A = sorted(list(map(int, input().split())), reverse=True)
s = sum(A)
cnt = 0
for a in A:
if a * 4 * m >= s:
cnt += 1
if cnt >= m:
print("Yes")
break
else:
print("No")
| false | 14.285714 | [
"-from decimal import Decimal",
"-",
"-A = list(map(int, input().split()))",
"-line = Decimal(sum(A) / (4 * m))",
"+A = sorted(list(map(int, input().split())), reverse=True)",
"+s = sum(A)",
"- if a >= line:",
"+ if a * 4 * m >= s:"
] | false | 0.054255 | 0.037656 | 1.440802 | [
"s122087295",
"s165377592"
] |
u052499405 | p02913 | python | s158247330 | s522438508 | 239 | 221 | 46,428 | 44,016 | Accepted | Accepted | 7.53 | class RollingHash():
def __init__(self, s):
self.length = len(s)
self.base1 = 1009
self.base2 = 1007
self.mod1 = 10**9 + 7
self.mod2 = 10**9 + 9
self.hash1 = [0] * (self.length + 1)
self.hash2 = [0] * (self.length + 1)
self.pow1 = [1] * (self.... | class RollingHash():
def __init__(self, s):
self.length = len(s)
self.base1 = 1009
self.base2 = 1007
self.mod1 = 10**9 + 7
self.mod2 = 10**9 + 9
self.hash1 = [0] * (self.length + 1)
self.hash2 = [0] * (self.length + 1)
self.pow1 = [1] * (self.... | 66 | 66 | 2,025 | 2,021 | class RollingHash:
def __init__(self, s):
self.length = len(s)
self.base1 = 1009
self.base2 = 1007
self.mod1 = 10**9 + 7
self.mod2 = 10**9 + 9
self.hash1 = [0] * (self.length + 1)
self.hash2 = [0] * (self.length + 1)
self.pow1 = [1] * (self.length + 1)... | class RollingHash:
def __init__(self, s):
self.length = len(s)
self.base1 = 1009
self.base2 = 1007
self.mod1 = 10**9 + 7
self.mod2 = 10**9 + 9
self.hash1 = [0] * (self.length + 1)
self.hash2 = [0] * (self.length + 1)
self.pow1 = [1] * (self.length + 1)... | false | 0 | [
"-RH = FastRollingHash(s)",
"+RH = RollingHash(s)"
] | false | 0.071224 | 0.071569 | 0.995174 | [
"s158247330",
"s522438508"
] |
u037221289 | p03037 | python | s053642723 | s348183294 | 365 | 318 | 11,440 | 3,060 | Accepted | Accepted | 12.88 | N,M = list(map(int,input().split(' ')))
L = []
R = []
for i in range(M):
l,r = list(map(int,input().split(' ')))
L.append(l)
R.append(r)
L.sort()
R.sort()
A = R[0] - L[-1] +1
print((max(A,0))) | N,M = list(map(int,input().split(' ')))
left,right = list(map(int,input().split(' ')))
for i in range(M-1):
L,R = list(map(int,input().split(' ')))
left = max(L,left)
right = min(R,right)
print((max(right-left+1,0)))
| 12 | 8 | 196 | 211 | N, M = list(map(int, input().split(" ")))
L = []
R = []
for i in range(M):
l, r = list(map(int, input().split(" ")))
L.append(l)
R.append(r)
L.sort()
R.sort()
A = R[0] - L[-1] + 1
print((max(A, 0)))
| N, M = list(map(int, input().split(" ")))
left, right = list(map(int, input().split(" ")))
for i in range(M - 1):
L, R = list(map(int, input().split(" ")))
left = max(L, left)
right = min(R, right)
print((max(right - left + 1, 0)))
| false | 33.333333 | [
"-L = []",
"-R = []",
"-for i in range(M):",
"- l, r = list(map(int, input().split(\" \")))",
"- L.append(l)",
"- R.append(r)",
"-L.sort()",
"-R.sort()",
"-A = R[0] - L[-1] + 1",
"-print((max(A, 0)))",
"+left, right = list(map(int, input().split(\" \")))",
"+for i in range(M - 1):",
... | false | 0.008221 | 0.03803 | 0.21617 | [
"s053642723",
"s348183294"
] |
u312025627 | p03167 | python | s130636275 | s454085386 | 174 | 119 | 92,152 | 82,960 | Accepted | Accepted | 31.61 | MOD = 10**9 + 7
def main():
from collections import deque
H, W = (int(i) for i in input().split())
c = [eval(input()) for i in range(H)]
dist = [[-1]*W for i in range(H)]
def bfs_2d(sy=0, sx=0):
que = deque()
dist[sy][sx] = 1
que.append((sy, sx))
d =... | MOD = 10**9 + 7
def main():
# もらうDP
H, W = (int(i) for i in input().split())
c = [eval(input()) for i in range(H)]
dp = [[0]*W for i in range(H)]
dp[0][0] = 1
for h in range(H):
for w in range(W):
le = 0
up = 0
if 0 <= w - 1 and c[h][w... | 38 | 25 | 1,101 | 570 | MOD = 10**9 + 7
def main():
from collections import deque
H, W = (int(i) for i in input().split())
c = [eval(input()) for i in range(H)]
dist = [[-1] * W for i in range(H)]
def bfs_2d(sy=0, sx=0):
que = deque()
dist[sy][sx] = 1
que.append((sy, sx))
d = ((0, 1), (1... | MOD = 10**9 + 7
def main():
# もらうDP
H, W = (int(i) for i in input().split())
c = [eval(input()) for i in range(H)]
dp = [[0] * W for i in range(H)]
dp[0][0] = 1
for h in range(H):
for w in range(W):
le = 0
up = 0
if 0 <= w - 1 and c[h][w - 1] != "#":... | false | 34.210526 | [
"- from collections import deque",
"-",
"+ # もらうDP",
"- dist = [[-1] * W for i in range(H)]",
"-",
"- def bfs_2d(sy=0, sx=0):",
"- que = deque()",
"- dist[sy][sx] = 1",
"- que.append((sy, sx))",
"- d = ((0, 1), (1, 0))",
"- while que:",
"- ... | false | 0.035076 | 0.035622 | 0.984685 | [
"s130636275",
"s454085386"
] |
u585819925 | p02912 | python | s346979951 | s500952127 | 162 | 146 | 14,180 | 14,180 | Accepted | Accepted | 9.88 | import heapq
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [-i for i in A]
heapq.heapify(A)
for _ in range(M):
#Hは全部マイナスをつけたからaは最大値的なのはいる
a = heapq.heappop(A)
heapq.heappush(A, int(a/2))
print((-sum(A))) | import heapq
N, M = list(map(int, input().split()))
A = [-int(i) for i in input().split()]
heapq.heapify(A)
for _ in range(M):
heapq.heapreplace(A, int(A[0]/2))
print((-sum(A)))
| 11 | 10 | 247 | 186 | import heapq
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [-i for i in A]
heapq.heapify(A)
for _ in range(M):
# Hは全部マイナスをつけたからaは最大値的なのはいる
a = heapq.heappop(A)
heapq.heappush(A, int(a / 2))
print((-sum(A)))
| import heapq
N, M = list(map(int, input().split()))
A = [-int(i) for i in input().split()]
heapq.heapify(A)
for _ in range(M):
heapq.heapreplace(A, int(A[0] / 2))
print((-sum(A)))
| false | 9.090909 | [
"-A = list(map(int, input().split()))",
"-A = [-i for i in A]",
"+A = [-int(i) for i in input().split()]",
"- # Hは全部マイナスをつけたからaは最大値的なのはいる",
"- a = heapq.heappop(A)",
"- heapq.heappush(A, int(a / 2))",
"+ heapq.heapreplace(A, int(A[0] / 2))"
] | false | 0.008544 | 0.03549 | 0.24074 | [
"s346979951",
"s500952127"
] |
u585482323 | p03033 | python | s870044795 | s818159744 | 1,698 | 1,315 | 124,740 | 96,460 | Accepted | Accepted | 22.56 | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, ... | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, ... | 142 | 130 | 3,074 | 2,775 | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI():
return list(map(int, sys.stdin.readline().split()))
def I():
return int(sys.stdin.readline())
def LS():
return list(m... | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI():
return list(map(int, sys.stdin.readline().split()))
def I():
return int(sys.stdin.readline())
def LS():
return list(m... | false | 8.450704 | [
"- print(((a * 3 + p) // 2))",
"+ print((a * 3 + p) // 2)",
"- print((b + 1))",
"+ print(b + 1)",
"- lis = list([x - 1 for x in qu[q][1:]])",
"+ lis = list(map(lambda x: x - 1, qu[q][1:]))",
"- n, Q = LI()",
"- e = []",
"- for i in range(n):",
"- ... | false | 0.094125 | 0.088007 | 1.069514 | [
"s870044795",
"s818159744"
] |
u663710122 | p03951 | python | s484891855 | s036564355 | 21 | 18 | 2,940 | 2,940 | Accepted | Accepted | 14.29 | N = int(eval(input()))
S = eval(input())
T = eval(input())
k = 0
for i in range(N):
for j in range(N):
s = S[i:]
t = T[:j + 1]
if s == t:
k = max(k, len(s))
print((2 * N - k))
| N = int(eval(input()))
S = eval(input())
T = eval(input())
for l in range(N, 2 * N + 1):
if S[N - 2 * N + l:] == T[:2 * N - l]:
print(l)
exit()
| 14 | 8 | 212 | 154 | N = int(eval(input()))
S = eval(input())
T = eval(input())
k = 0
for i in range(N):
for j in range(N):
s = S[i:]
t = T[: j + 1]
if s == t:
k = max(k, len(s))
print((2 * N - k))
| N = int(eval(input()))
S = eval(input())
T = eval(input())
for l in range(N, 2 * N + 1):
if S[N - 2 * N + l :] == T[: 2 * N - l]:
print(l)
exit()
| false | 42.857143 | [
"-k = 0",
"-for i in range(N):",
"- for j in range(N):",
"- s = S[i:]",
"- t = T[: j + 1]",
"- if s == t:",
"- k = max(k, len(s))",
"-print((2 * N - k))",
"+for l in range(N, 2 * N + 1):",
"+ if S[N - 2 * N + l :] == T[: 2 * N - l]:",
"+ print(l)",
... | false | 0.045473 | 0.045285 | 1.00415 | [
"s484891855",
"s036564355"
] |
u633068244 | p00740 | python | s582334071 | s712749980 | 3,810 | 3,390 | 4,208 | 4,204 | Accepted | Accepted | 11.02 | while 1:
n,p = list(map(int,input().split()))
if n == 0: break
have = [0]*n
stone = p
i = count = 0
while 1:
count += 1
if stone > 0:
have[i] += 1
stone -= 1
else:
stone += have[i]
have[i] = 0
if have[i] == p:
break
i = (i+1)%n
print(i) | while 1:
n,p = list(map(int,input().split()))
if n == 0: break
have = [0]*n
stone = p
i = 0
while 1:
if stone > 0:
have[i] += 1
stone -= 1
else:
stone += have[i]
have[i] = 0
if have[i] == p:
break
i = (i+1)%n
print(i) | 18 | 17 | 282 | 260 | while 1:
n, p = list(map(int, input().split()))
if n == 0:
break
have = [0] * n
stone = p
i = count = 0
while 1:
count += 1
if stone > 0:
have[i] += 1
stone -= 1
else:
stone += have[i]
have[i] = 0
if have[i] ... | while 1:
n, p = list(map(int, input().split()))
if n == 0:
break
have = [0] * n
stone = p
i = 0
while 1:
if stone > 0:
have[i] += 1
stone -= 1
else:
stone += have[i]
have[i] = 0
if have[i] == p:
break
... | false | 5.555556 | [
"- i = count = 0",
"+ i = 0",
"- count += 1"
] | false | 0.537945 | 0.618253 | 0.870105 | [
"s582334071",
"s712749980"
] |
u391731808 | p03576 | python | s132779045 | s115405979 | 1,366 | 778 | 3,064 | 3,064 | Accepted | Accepted | 43.05 | N,K = list(map(int,input().split()))
XY = [list(map(int,input().split())) for _ in [0]*N]
iX = sorted(x for x,y in XY)
iY = sorted(y for x,y in XY)
X = {x:i for i,x in enumerate(iX)}
Y = {y:i for i,y in enumerate(iY)}
c = [[0]*(N+1) for i in [0]*(N+1)]
for x,y in XY:
c[Y[y]+1][X[x]+1] = 1
for i in ra... | N,K = list(map(int,input().split()))
XY = [list(map(int,input().split())) for _ in [0]*N]
iX = sorted(x for x,y in XY)
iY = sorted(y for x,y in XY)
X = {x:i for i,x in enumerate(iX)}
Y = {y:i for i,y in enumerate(iY)}
c = [[0]*(N+1) for i in [0]*(N+1)]
for x,y in XY:
c[Y[y]+1][X[x]+1] = 1
for i in ra... | 29 | 30 | 759 | 786 | N, K = list(map(int, input().split()))
XY = [list(map(int, input().split())) for _ in [0] * N]
iX = sorted(x for x, y in XY)
iY = sorted(y for x, y in XY)
X = {x: i for i, x in enumerate(iX)}
Y = {y: i for i, y in enumerate(iY)}
c = [[0] * (N + 1) for i in [0] * (N + 1)]
for x, y in XY:
c[Y[y] + 1][X[x] + 1] = 1
fo... | N, K = list(map(int, input().split()))
XY = [list(map(int, input().split())) for _ in [0] * N]
iX = sorted(x for x, y in XY)
iY = sorted(y for x, y in XY)
X = {x: i for i, x in enumerate(iX)}
Y = {y: i for i, y in enumerate(iY)}
c = [[0] * (N + 1) for i in [0] * (N + 1)]
for x, y in XY:
c[Y[y] + 1][X[x] + 1] = 1
fo... | false | 3.333333 | [
"- for r in range(l + 1, N):",
"- for u in range(N):",
"+ for u in range(N):",
"+ for r in range(l + 1, N):",
"+ break"
] | false | 0.007427 | 0.157983 | 0.047014 | [
"s132779045",
"s115405979"
] |
u766477342 | p00004 | python | s412618871 | s173094197 | 50 | 20 | 7,532 | 7,588 | Accepted | Accepted | 60 | try:
while 1:
a,b,c,d,e,f = list(map(int,input().split()))
y = (c * d - f * a) / (d * b - a * e)
x = (c - b * y) / a
print(("{:.3f} {:.3f}".format(x, y)))
except Exception:
pass | def _round(x, d=0):
p = 10 ** d
return (x * p * 2 + 1) // 2 / p
try:
while 1:
a, b, c, d, e, f = list(map(int, input().split()))
s = (a * e - b * d)
x = e * c - b * f
y = -c * d + a * f
print(("{:0.3f}".format(_round(x / s, 4)), "{:0.3f}".format(_round(... | 10 | 15 | 227 | 349 | try:
while 1:
a, b, c, d, e, f = list(map(int, input().split()))
y = (c * d - f * a) / (d * b - a * e)
x = (c - b * y) / a
print(("{:.3f} {:.3f}".format(x, y)))
except Exception:
pass
| def _round(x, d=0):
p = 10**d
return (x * p * 2 + 1) // 2 / p
try:
while 1:
a, b, c, d, e, f = list(map(int, input().split()))
s = a * e - b * d
x = e * c - b * f
y = -c * d + a * f
print(("{:0.3f}".format(_round(x / s, 4)), "{:0.3f}".format(_round(y / s, 4))))
exce... | false | 33.333333 | [
"+def _round(x, d=0):",
"+ p = 10**d",
"+ return (x * p * 2 + 1) // 2 / p",
"+",
"+",
"- y = (c * d - f * a) / (d * b - a * e)",
"- x = (c - b * y) / a",
"- print((\"{:.3f} {:.3f}\".format(x, y)))",
"-except Exception:",
"+ s = a * e - b * d",
"+ x = e * ... | false | 0.035724 | 0.041226 | 0.86654 | [
"s412618871",
"s173094197"
] |
u418149936 | p02641 | python | s867577312 | s256075298 | 31 | 26 | 9,208 | 9,128 | Accepted | Accepted | 16.13 | X, N = list(map(int, input().split(' ')))
diff, rst = -1, 0
if N == 0:
print(X)
else:
P_ls = list(map(int, input().split(' ')))
for i in range(101, -1, -1):
if i not in P_ls:
if diff == -1:
diff = abs(X - i)
rst = i
else:
... | X, N = list(map(int, input().split(' ')))
if N == 0:
print(X)
else:
P_ls = list(map(int, input().split(' ')))
diff, rst = -1, 0
for i in range(101, -1, -1):
if i not in P_ls:
if diff == -1:
diff = abs(X - i)
rst = i
else:
... | 16 | 16 | 433 | 437 | X, N = list(map(int, input().split(" ")))
diff, rst = -1, 0
if N == 0:
print(X)
else:
P_ls = list(map(int, input().split(" ")))
for i in range(101, -1, -1):
if i not in P_ls:
if diff == -1:
diff = abs(X - i)
rst = i
else:
diff =... | X, N = list(map(int, input().split(" ")))
if N == 0:
print(X)
else:
P_ls = list(map(int, input().split(" ")))
diff, rst = -1, 0
for i in range(101, -1, -1):
if i not in P_ls:
if diff == -1:
diff = abs(X - i)
rst = i
else:
di... | false | 0 | [
"-diff, rst = -1, 0",
"+ diff, rst = -1, 0"
] | false | 0.056937 | 0.035704 | 1.594709 | [
"s867577312",
"s256075298"
] |
u094155508 | p03140 | python | s135441196 | s364439570 | 19 | 17 | 3,064 | 3,060 | Accepted | Accepted | 10.53 | n=int(eval(input()))
a= list(eval(input()))
b= list(eval(input()))
c= list(eval(input()))
alphabet = [chr(i) for i in range(97, 97+26)]
ans = 0
for i in range(n):
cnt = 200
for j in range(26):
cnt_tmp = 0
if (a[i] != alphabet[j]):
cnt_tmp += 1
if (b[i] != alph... | n=int(eval(input()))
a= list(eval(input()))
b= list(eval(input()))
c= list(eval(input()))
ans = 0
for i in range(n):
ans += len({a[i], b[i], c[i]}) - 1
print(ans)
'''
west
east
wait
{'w', 'e', 'w'}
{'w', 'e'}
len → 2
1文字は使って良い -1
''' | 34 | 26 | 518 | 268 | n = int(eval(input()))
a = list(eval(input()))
b = list(eval(input()))
c = list(eval(input()))
alphabet = [chr(i) for i in range(97, 97 + 26)]
ans = 0
for i in range(n):
cnt = 200
for j in range(26):
cnt_tmp = 0
if a[i] != alphabet[j]:
cnt_tmp += 1
if b[i] != alphabet[j]:
... | n = int(eval(input()))
a = list(eval(input()))
b = list(eval(input()))
c = list(eval(input()))
ans = 0
for i in range(n):
ans += len({a[i], b[i], c[i]}) - 1
print(ans)
"""
west
east
wait
{'w', 'e', 'w'}
{'w', 'e'}
len → 2
1文字は使って良い -1
"""
| false | 23.529412 | [
"-alphabet = [chr(i) for i in range(97, 97 + 26)]",
"- cnt = 200",
"- for j in range(26):",
"- cnt_tmp = 0",
"- if a[i] != alphabet[j]:",
"- cnt_tmp += 1",
"- if b[i] != alphabet[j]:",
"- cnt_tmp += 1",
"- if c[i] != alphabet[j]:",
"- ... | false | 0.051432 | 0.059086 | 0.870471 | [
"s135441196",
"s364439570"
] |
u118642796 | p03163 | python | s044686511 | s708872935 | 466 | 291 | 120,172 | 41,708 | Accepted | Accepted | 37.55 | N,W = list(map(int,input().split()))
dp = [[0]*(W+1) for _ in range(N+1)]
for i in range(N):
w,v = list(map(int,input().split()))
for j in range(W+1):
dp[i+1][j] = max(dp[i+1][j],dp[i][j])
if j+w<=W:
dp[i+1][j+w] = max(dp[i][j]+v,dp[i+1][j+w])
print((max(dp[N]))) | N,W = list(map(int,input().split()))
dp = [0]*(W+1)
for i in range(N):
w,v = list(map(int,input().split()))
for j in range(W-w,-1,-1):
dp[j+w] = max(dp[j]+v,dp[j+w])
print((max(dp))) | 9 | 7 | 275 | 182 | N, W = list(map(int, input().split()))
dp = [[0] * (W + 1) for _ in range(N + 1)]
for i in range(N):
w, v = list(map(int, input().split()))
for j in range(W + 1):
dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
if j + w <= W:
dp[i + 1][j + w] = max(dp[i][j] + v, dp[i + 1][j + w])
print((m... | N, W = list(map(int, input().split()))
dp = [0] * (W + 1)
for i in range(N):
w, v = list(map(int, input().split()))
for j in range(W - w, -1, -1):
dp[j + w] = max(dp[j] + v, dp[j + w])
print((max(dp)))
| false | 22.222222 | [
"-dp = [[0] * (W + 1) for _ in range(N + 1)]",
"+dp = [0] * (W + 1)",
"- for j in range(W + 1):",
"- dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])",
"- if j + w <= W:",
"- dp[i + 1][j + w] = max(dp[i][j] + v, dp[i + 1][j + w])",
"-print((max(dp[N])))",
"+ for j in range(W -... | false | 0.041715 | 0.040574 | 1.028116 | [
"s044686511",
"s708872935"
] |
u260216890 | p02647 | python | s789894601 | s185547307 | 581 | 415 | 183,528 | 184,076 | Accepted | Accepted | 28.57 | n,k=list(map(int, input().split()))
a=list(map(int, input().split()))
from itertools import accumulate
for _ in range(k):
new=[0]*n
for i in range(n):
j=a[i]
l=max(0,i-j)
r=min(n-1,i+j)
new[l]+=1
if r+1<n:
new[r+1]-=1
new=list(accumulate(new))
... | n,k=list(map(int, input().split()))
a=list(map(int, input().split()))
from itertools import accumulate
for _ in range(min(50,k)):
new=[0]*n
for i in range(n):
j=a[i]
l=max(0,i-j)
r=min(n-1,i+j)
new[l]+=1
if r+1<n:
new[r+1]-=1
new=list(accumulat... | 17 | 15 | 383 | 343 | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
from itertools import accumulate
for _ in range(k):
new = [0] * n
for i in range(n):
j = a[i]
l = max(0, i - j)
r = min(n - 1, i + j)
new[l] += 1
if r + 1 < n:
new[r + 1] -= 1
new ... | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
from itertools import accumulate
for _ in range(min(50, k)):
new = [0] * n
for i in range(n):
j = a[i]
l = max(0, i - j)
r = min(n - 1, i + j)
new[l] += 1
if r + 1 < n:
new[r + 1] -= 1... | false | 11.764706 | [
"-for _ in range(k):",
"+for _ in range(min(50, k)):",
"- if all([i == n for i in a]):",
"- break"
] | false | 0.036249 | 0.042189 | 0.859224 | [
"s789894601",
"s185547307"
] |
u123310422 | p03645 | python | s154465010 | s349125060 | 396 | 366 | 37,424 | 37,440 | Accepted | Accepted | 7.58 | import sys
input = sys.stdin.readline
N, M = list(map(int, input().split(" ")))
m = set()
for _ in range(M):
a, b = list(map(int, input().split(" ")))
if a < b:
m.add((a,b))
else:
m.add((b,a))
for i in range(2, N):
if (1, i) in m and (i, N) in m:
print("POSS... | import sys
input = sys.stdin.readline
def main():
N, M = list(map(int, input().split(" ")))
m = set()
for _ in range(M):
a, b = list(map(int, input().split(" ")))
if a < b:
m.add((a,b))
else:
m.add((b,a))
for i in range(2, N):
if (1... | 22 | 20 | 364 | 432 | import sys
input = sys.stdin.readline
N, M = list(map(int, input().split(" ")))
m = set()
for _ in range(M):
a, b = list(map(int, input().split(" ")))
if a < b:
m.add((a, b))
else:
m.add((b, a))
for i in range(2, N):
if (1, i) in m and (i, N) in m:
print("POSSIBLE")
brea... | import sys
input = sys.stdin.readline
def main():
N, M = list(map(int, input().split(" ")))
m = set()
for _ in range(M):
a, b = list(map(int, input().split(" ")))
if a < b:
m.add((a, b))
else:
m.add((b, a))
for i in range(2, N):
if (1, i) in m a... | false | 9.090909 | [
"-N, M = list(map(int, input().split(\" \")))",
"-m = set()",
"-for _ in range(M):",
"- a, b = list(map(int, input().split(\" \")))",
"- if a < b:",
"- m.add((a, b))",
"+",
"+",
"+def main():",
"+ N, M = list(map(int, input().split(\" \")))",
"+ m = set()",
"+ for _ in ra... | false | 0.114437 | 0.040937 | 2.795446 | [
"s154465010",
"s349125060"
] |
u118019047 | p03399 | python | s776541441 | s222506356 | 20 | 17 | 3,316 | 2,940 | Accepted | Accepted | 15 | a=int(eval(input()))
b=int(eval(input()))
c=int(eval(input()))
d=int(eval(input()))
e = min(a,b)
f = min(c,d)
print((e + f)) | a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
d = int(eval(input()))
print((min(a,b)+min(c,d))) | 7 | 6 | 104 | 98 | a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
d = int(eval(input()))
e = min(a, b)
f = min(c, d)
print((e + f))
| a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
d = int(eval(input()))
print((min(a, b) + min(c, d)))
| false | 14.285714 | [
"-e = min(a, b)",
"-f = min(c, d)",
"-print((e + f))",
"+print((min(a, b) + min(c, d)))"
] | false | 0.040874 | 0.039777 | 1.027568 | [
"s776541441",
"s222506356"
] |
u070201429 | p02558 | python | s385519185 | s166657046 | 383 | 282 | 12,496 | 78,076 | Accepted | Accepted | 26.37 | # 参考URL https://note.nkmk.me/python-union-find/
class UnionFind():
# 各要素の親要素の番号を格納するリスト
# 要素が根(ルート)の場合は-(そのグループの要素数)を格納する
def __init__(self, n):
self.n = n
self.parents = [-1] * n
# 要素xが属するグループの根を返す
def find(self, x):
if self.parents[x] < 0:
return x
... | # Reference: https://note.nkmk.me/python-union-find/
class UnionFind:
# 各要素の親要素の番号を格納するリスト
# 要素が根(ルート)の場合は-(そのグループの要素数)を格納する
def __init__(self, n):
self.n = n
self.parents = [-1] * n
# 要素xが属するグループの根を返す
def find(self, x):
history = []
while self.parents[x] ... | 58 | 56 | 1,322 | 1,342 | # 参考URL https://note.nkmk.me/python-union-find/
class UnionFind:
# 各要素の親要素の番号を格納するリスト
# 要素が根(ルート)の場合は-(そのグループの要素数)を格納する
def __init__(self, n):
self.n = n
self.parents = [-1] * n
# 要素xが属するグループの根を返す
def find(self, x):
if self.parents[x] < 0:
return x
else:
... | # Reference: https://note.nkmk.me/python-union-find/
class UnionFind:
# 各要素の親要素の番号を格納するリスト
# 要素が根(ルート)の場合は-(そのグループの要素数)を格納する
def __init__(self, n):
self.n = n
self.parents = [-1] * n
# 要素xが属するグループの根を返す
def find(self, x):
history = []
while self.parents[x] >= 0:
... | false | 3.448276 | [
"-# 参考URL https://note.nkmk.me/python-union-find/",
"+# Reference: https://note.nkmk.me/python-union-find/",
"- if self.parents[x] < 0:",
"- return x",
"- else:",
"- self.parents[x] = self.find(self.parents[x])",
"- return self.parents[x]",
"+ hist... | false | 0.036416 | 0.03761 | 0.968253 | [
"s385519185",
"s166657046"
] |
u131984977 | p02412 | python | s044370265 | s518724893 | 330 | 220 | 6,724 | 6,724 | Accepted | Accepted | 33.33 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
start = n if n < x else x
for a in range(start, 0, -1):
if a >= x:
continue
for b in range(a - 1, 0, -1):
if a + b >= x:
continue
... | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
start = n if n < x else x
for a in range(start, 0, -1):
if a >= x:
continue
for b in range(a - 1, 0, -1):
if a + b >= x:
continue
... | 17 | 20 | 442 | 533 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
start = n if n < x else x
for a in range(start, 0, -1):
if a >= x:
continue
for b in range(a - 1, 0, -1):
if a + b >= x:
continue
for c i... | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
start = n if n < x else x
for a in range(start, 0, -1):
if a >= x:
continue
for b in range(a - 1, 0, -1):
if a + b >= x:
continue
for c i... | false | 15 | [
"- if a + b + c == x:",
"+ total = a + b + c",
"+ if total == x:",
"+ elif total < x:",
"+ break"
] | false | 0.036786 | 0.05075 | 0.724841 | [
"s044370265",
"s518724893"
] |
u426764965 | p02936 | python | s969854704 | s736754447 | 1,041 | 726 | 98,780 | 78,192 | Accepted | Accepted | 30.26 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def abc138_d():
N, _ = map(int, readline().strip().split())
input_data = [tuple(map(int, ln.strip().split())) for ln in readlines()]
# 隣接リスト作成
graph = [[] for _ in range(N+1)]
... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def abc138_d():
N, _ = map(int, readline().strip().split())
input_data = list(map(int, read().split()))
AB = iter(input_data[:N+N-2])
PX = iter(input_data[N+N-2:])
# 隣接リスト... | 35 | 37 | 871 | 902 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def abc138_d():
N, _ = map(int, readline().strip().split())
input_data = [tuple(map(int, ln.strip().split())) for ln in readlines()]
# 隣接リスト作成
graph = [[] for _ in range(N + 1)]
for... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def abc138_d():
N, _ = map(int, readline().strip().split())
input_data = list(map(int, read().split()))
AB = iter(input_data[: N + N - 2])
PX = iter(input_data[N + N - 2 :])
# 隣接リスト... | false | 5.405405 | [
"- input_data = [tuple(map(int, ln.strip().split())) for ln in readlines()]",
"+ input_data = list(map(int, read().split()))",
"+ AB = iter(input_data[: N + N - 2])",
"+ PX = iter(input_data[N + N - 2 :])",
"- for a, b in input_data[: N - 1]:",
"+ for a, b in zip(AB, AB):",
"- for p... | false | 0.087927 | 0.035051 | 2.508513 | [
"s969854704",
"s736754447"
] |
u312025627 | p03408 | python | s311199219 | s179147773 | 169 | 22 | 38,384 | 3,316 | Accepted | Accepted | 86.98 | def main():
N = int(eval(input()))
A = [eval(input()) for i in range(N)]
M = int(eval(input()))
B = [eval(input()) for i in range(M)]
ans = 0
from collections import Counter
S = Counter(A)
T = Counter(B)
for k, v in list(S.items()):
ans = max(ans, v - T[k])
pri... | def main():
N = int(eval(input()))
S = [eval(input()) for i in range(N)]
M = int(eval(input()))
T = [eval(input()) for i in range(M)]
ans = 0
from collections import Counter
c = Counter(S)
cT = Counter(T)
for k, v in list(c.items()):
ans = max(ans, v - cT[k])
p... | 16 | 16 | 342 | 344 | def main():
N = int(eval(input()))
A = [eval(input()) for i in range(N)]
M = int(eval(input()))
B = [eval(input()) for i in range(M)]
ans = 0
from collections import Counter
S = Counter(A)
T = Counter(B)
for k, v in list(S.items()):
ans = max(ans, v - T[k])
print(ans)
... | def main():
N = int(eval(input()))
S = [eval(input()) for i in range(N)]
M = int(eval(input()))
T = [eval(input()) for i in range(M)]
ans = 0
from collections import Counter
c = Counter(S)
cT = Counter(T)
for k, v in list(c.items()):
ans = max(ans, v - cT[k])
print(ans)
... | false | 0 | [
"- A = [eval(input()) for i in range(N)]",
"+ S = [eval(input()) for i in range(N)]",
"- B = [eval(input()) for i in range(M)]",
"+ T = [eval(input()) for i in range(M)]",
"- S = Counter(A)",
"- T = Counter(B)",
"- for k, v in list(S.items()):",
"- ans = max(ans, v - T[k])"... | false | 0.036386 | 0.035628 | 1.021273 | [
"s311199219",
"s179147773"
] |
u645250356 | p03695 | python | s575614441 | s876226306 | 180 | 55 | 38,640 | 5,476 | Accepted | Accepted | 69.44 | from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
de... | from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(m... | 26 | 22 | 625 | 576 | from collections import Counter, defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map(int, sys.stdin.readline().split()))
def inpl_str():
return list(sys.stdin.... | from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")
def inp():
return int(sys.stdin.readline())
def inpl():
... | false | 15.384615 | [
"-import sys, heapq, bisect, math, itertools, string, queue",
"+from heapq import heappop, heappush, heapify",
"+from bisect import bisect_left, bisect_right",
"+import sys, math, itertools, fractions, pprint",
"+INF = float(\"inf\")",
"-def inpl_str():",
"- return list(sys.stdin.readline().split())"... | false | 0.065499 | 0.110198 | 0.594371 | [
"s575614441",
"s876226306"
] |
u197955752 | p02844 | python | s100192232 | s801728319 | 1,179 | 843 | 3,188 | 3,188 | Accepted | Accepted | 28.5 | N = int(eval(input()))
S = eval(input())
pin1 = {}
pin12 = {}
pin123 = {}
for i in range(N):
if S[i] not in pin1:
pin1[S[i]] = 1
for j in range(i + 1, N):
if S[i] + S[j] not in pin12:
pin12[S[i] + S[j]] = 1
for k in range(j + 1, N):
... | N = int(eval(input()))
S = eval(input())
pin = [[[False] * 11 for _ in range(11)] for _ in range(11)]
for i in range(0, N):
c = int(S[i])
for a in range(10):
for b in range(10):
if pin[a][b][-1]:
pin[a][b][c] = True
if pin[a][-1][-1]:
pin[a][... | 18 | 22 | 436 | 486 | N = int(eval(input()))
S = eval(input())
pin1 = {}
pin12 = {}
pin123 = {}
for i in range(N):
if S[i] not in pin1:
pin1[S[i]] = 1
for j in range(i + 1, N):
if S[i] + S[j] not in pin12:
pin12[S[i] + S[j]] = 1
for k in range(j + 1, N):
if ... | N = int(eval(input()))
S = eval(input())
pin = [[[False] * 11 for _ in range(11)] for _ in range(11)]
for i in range(0, N):
c = int(S[i])
for a in range(10):
for b in range(10):
if pin[a][b][-1]:
pin[a][b][c] = True
if pin[a][-1][-1]:
pin[a][c][-1] = True
... | false | 18.181818 | [
"-pin1 = {}",
"-pin12 = {}",
"-pin123 = {}",
"-for i in range(N):",
"- if S[i] not in pin1:",
"- pin1[S[i]] = 1",
"- for j in range(i + 1, N):",
"- if S[i] + S[j] not in pin12:",
"- pin12[S[i] + S[j]] = 1",
"- for k in range(j + 1, N):",
... | false | 0.042006 | 0.036321 | 1.156513 | [
"s100192232",
"s801728319"
] |
u238940874 | p02755 | python | s616061061 | s807266053 | 20 | 18 | 3,064 | 3,064 | Accepted | Accepted | 10 | a,b=list(map(int,input().split()))
for i in range(b*10,b*10+9):
if int(i*0.08)==a:
print(i)
break
else:
print((-1)) | a,b=list(map(int,input().split()))
for i in range(1,1001):
if int(i*0.08)==a and int(i*0.1)==b:
print(i)
break
else:
print((-1)) | 7 | 7 | 137 | 150 | a, b = list(map(int, input().split()))
for i in range(b * 10, b * 10 + 9):
if int(i * 0.08) == a:
print(i)
break
else:
print((-1))
| a, b = list(map(int, input().split()))
for i in range(1, 1001):
if int(i * 0.08) == a and int(i * 0.1) == b:
print(i)
break
else:
print((-1))
| false | 0 | [
"-for i in range(b * 10, b * 10 + 9):",
"- if int(i * 0.08) == a:",
"+for i in range(1, 1001):",
"+ if int(i * 0.08) == a and int(i * 0.1) == b:"
] | false | 0.044338 | 0.045777 | 0.968553 | [
"s616061061",
"s807266053"
] |
u533039576 | p02774 | python | s963546957 | s922819936 | 649 | 491 | 125,300 | 95,188 | Accepted | Accepted | 24.35 | from bisect import bisect_left, bisect_right
import sys
input = sys.stdin.readline
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
a_minus = a_zero = a_plus = 0
for i in range(n):
if a[i] > 0:
a_plus += 1
elif a[i] == 0:
a_zero += 1
else:
... | from bisect import bisect_left, bisect_right
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
n_m = bisect_left(a, 0) # a[i] < 0 の数
n_0 = bisect_right(a, 0) - n_m # a[i] = 0 の数
n_p = n - n_m - n_0 # a[i] > 0 の数
nn_m = n_m * n_p # 積が負になるペア数
nn_0 = n_0 * (n - n_0) + n_0 ... | 85 | 112 | 1,751 | 2,949 | from bisect import bisect_left, bisect_right
import sys
input = sys.stdin.readline
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
a_minus = a_zero = a_plus = 0
for i in range(n):
if a[i] > 0:
a_plus += 1
elif a[i] == 0:
a_zero += 1
else:
a_minus ... | from bisect import bisect_left, bisect_right
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
n_m = bisect_left(a, 0) # a[i] < 0 の数
n_0 = bisect_right(a, 0) - n_m # a[i] = 0 の数
n_p = n - n_m - n_0 # a[i] > 0 の数
nn_m = n_m * n_p # 積が負になるペア数
nn_0 = n_0 * (n - n_0) + n_0 * (n_0 - 1)... | false | 24.107143 | [
"-import sys",
"-input = sys.stdin.readline",
"-a_minus = a_zero = a_plus = 0",
"-for i in range(n):",
"- if a[i] > 0:",
"- a_plus += 1",
"- elif a[i] == 0:",
"- a_zero += 1",
"- else:",
"- a_minus += 1",
"-aa_minus = a_minus * a_plus",
"-aa_zero = a_zero * (n - a... | false | 0.049146 | 0.050958 | 0.964446 | [
"s963546957",
"s922819936"
] |
u678167152 | p03352 | python | s123671846 | s973050242 | 28 | 25 | 9,392 | 9,124 | Accepted | Accepted | 10.71 | #素因数分解して列挙する関数、約数列挙ではない!
from collections import Counter
def factorize(n):
b = 2
fct = []
while b * b <= n:
while n % b == 0:
n //= b
fct.append(b)
b = b + 1
if n > 1:
fct.append(n)
f = list(Counter(fct).values())
if 1 not in f and len(set(f))==1:
return True
ret... | def solve():
ans = 0
X = int(eval(input()))
lis = [False]*(X+1)
lis[1] = True
for b in range(2,X+1):
p = 2
while b**p<=X:
lis[b**p] = True
p += 1
for i in range(X,-1,-1):
if lis[i]==True:
return i
print((solve())) | 23 | 14 | 436 | 260 | # 素因数分解して列挙する関数、約数列挙ではない!
from collections import Counter
def factorize(n):
b = 2
fct = []
while b * b <= n:
while n % b == 0:
n //= b
fct.append(b)
b = b + 1
if n > 1:
fct.append(n)
f = list(Counter(fct).values())
if 1 not in f and len(set(f)) =... | def solve():
ans = 0
X = int(eval(input()))
lis = [False] * (X + 1)
lis[1] = True
for b in range(2, X + 1):
p = 2
while b**p <= X:
lis[b**p] = True
p += 1
for i in range(X, -1, -1):
if lis[i] == True:
return i
print((solve()))
| false | 39.130435 | [
"-# 素因数分解して列挙する関数、約数列挙ではない!",
"-from collections import Counter",
"+def solve():",
"+ ans = 0",
"+ X = int(eval(input()))",
"+ lis = [False] * (X + 1)",
"+ lis[1] = True",
"+ for b in range(2, X + 1):",
"+ p = 2",
"+ while b**p <= X:",
"+ lis[b**p] = True"... | false | 0.04065 | 0.037046 | 1.097283 | [
"s123671846",
"s973050242"
] |
u151625340 | p03380 | python | s925334179 | s569751496 | 101 | 80 | 14,428 | 14,424 | Accepted | Accepted | 20.79 | n = int(eval(input()))
a = list(map(int,input().split()))
a.sort()
m = a[-1]
def near_abs_id(l,n): # リストlの中で絶対値がもっともnに近い要素のindex
idx = 0
m = 10**12
for i in range(len(l)):
if abs(l[i]-n) < m:
m = abs(l[i]-n)
idx= i
return idx
j = near_abs_id(a,m/2)
if j==n-... |
import bisect
def near_abs_id(a,target,fast=True): # a:listの中で絶対値がもっともtargetに近い要素のindex
# 複数存在する場合は一番indexが小さいもの
if fast: # O(logn) ### 昇順にソート済みで,全て正の数であることが必要
idx = bisect.bisect_left(a,target)
if idx==0: return idx
elif idx==len(a): return len(a)-1
else:
i... | 17 | 40 | 341 | 1,131 | n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
m = a[-1]
def near_abs_id(l, n): # リストlの中で絶対値がもっともnに近い要素のindex
idx = 0
m = 10**12
for i in range(len(l)):
if abs(l[i] - n) < m:
m = abs(l[i] - n)
idx = i
return idx
j = near_abs_id(a, m / 2)
if j == ... | import bisect
def near_abs_id(a, target, fast=True): # a:listの中で絶対値がもっともtargetに近い要素のindex
# 複数存在する場合は一番indexが小さいもの
if fast: # O(logn) ### 昇順にソート済みで,全て正の数であることが必要
idx = bisect.bisect_left(a, target)
if idx == 0:
return idx
elif idx == len(a):
return len(a) - 1
... | false | 57.5 | [
"+import bisect",
"+",
"+",
"+def near_abs_id(a, target, fast=True): # a:listの中で絶対値がもっともtargetに近い要素のindex",
"+ # 複数存在する場合は一番indexが小さいもの",
"+ if fast: # O(logn) ### 昇順にソート済みで,全て正の数であることが必要",
"+ idx = bisect.bisect_left(a, target)",
"+ if idx == 0:",
"+ return idx",
... | false | 0.04094 | 0.038016 | 1.076923 | [
"s925334179",
"s569751496"
] |
u600402037 | p03332 | python | s556733635 | s609964425 | 1,977 | 778 | 24,212 | 26,592 | Accepted | Accepted | 60.65 | # coding: utf-8
import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
MOD = 998244353
N, A, B, K = lr()
answer = 0
# A * x + B * y = K
# nCx * nCy
def cmb(n, k):
if k < 0 or k > n: return 0
return fact_N * fa... | # coding: utf-8
import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
MOD = 998244353
N, A, B, K = lr()
answer = 0
# A * x + B * y = K
# nCx * nCy
def cmb(n, k):
if k < 0 or k > n: return 0
return fact_N * fa... | 51 | 52 | 1,233 | 1,282 | # coding: utf-8
import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
MOD = 998244353
N, A, B, K = lr()
answer = 0
# A * x + B * y = K
# nCx * nCy
def cmb(n, k):
if k < 0 or k > n:
return 0
return fact_N * fact_inv[k] %... | # coding: utf-8
import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
MOD = 998244353
N, A, B, K = lr()
answer = 0
# A * x + B * y = K
# nCx * nCy
def cmb(n, k):
if k < 0 or k > n:
return 0
return fact_N * fact_inv[k] %... | false | 1.923077 | [
"-U = N + 100 # 階乗テーブルの上限",
"+U = N + 1 # 階乗テーブルの上限",
"+comb = fact_N * fact_inv % MOD * fact_inv[::-1] % MOD",
"- answer += cmb(N, x) * cmb(N, y)",
"+ answer += comb[x] * comb[y]"
] | false | 0.199469 | 0.276008 | 0.722696 | [
"s556733635",
"s609964425"
] |
u633450100 | p03713 | python | s884848401 | s280117757 | 366 | 331 | 9,180 | 9,264 | Accepted | Accepted | 9.56 | H,W = [int(i) for i in input().split()]
ans = H * W
for x in range(1,W):
y1 = H // 2
Sa1 = H * x
Sb1 = (W - x) * y1
Sc1 = (W - x) * (H - y1)
M = max(Sa1,Sb1,Sc1)
m = min(Sa1,Sb1,Sc1)
y2 = (W - x) // 2
Sa2 = H * x
Sb2 = H * y2
Sc2 = H * (W - x - y2)
M2 = max(S... | def answer(H,W,ans_kari):
for x in range(1,W):
y1 = H // 2
Sa1 = H * x
Sb1 = (W - x) * y1
Sc1 = (W - x) * (H - y1)
M = max(Sa1,Sb1,Sc1)
m = min(Sa1,Sb1,Sc1)
y2 = (W - x) // 2
Sa2 = H * x
Sb2 = H * y2
Sc2 = H * (W - x - y2... | 41 | 33 | 811 | 709 | H, W = [int(i) for i in input().split()]
ans = H * W
for x in range(1, W):
y1 = H // 2
Sa1 = H * x
Sb1 = (W - x) * y1
Sc1 = (W - x) * (H - y1)
M = max(Sa1, Sb1, Sc1)
m = min(Sa1, Sb1, Sc1)
y2 = (W - x) // 2
Sa2 = H * x
Sb2 = H * y2
Sc2 = H * (W - x - y2)
M2 = max(Sa2, Sb2, Sc... | def answer(H, W, ans_kari):
for x in range(1, W):
y1 = H // 2
Sa1 = H * x
Sb1 = (W - x) * y1
Sc1 = (W - x) * (H - y1)
M = max(Sa1, Sb1, Sc1)
m = min(Sa1, Sb1, Sc1)
y2 = (W - x) // 2
Sa2 = H * x
Sb2 = H * y2
Sc2 = H * (W - x - y2)
... | false | 19.512195 | [
"-H, W = [int(i) for i in input().split()]",
"-ans = H * W",
"-for x in range(1, W):",
"- y1 = H // 2",
"- Sa1 = H * x",
"- Sb1 = (W - x) * y1",
"- Sc1 = (W - x) * (H - y1)",
"- M = max(Sa1, Sb1, Sc1)",
"- m = min(Sa1, Sb1, Sc1)",
"- y2 = (W - x) // 2",
"- Sa2 = H * x",
... | false | 0.596583 | 0.714771 | 0.834648 | [
"s884848401",
"s280117757"
] |
u186838327 | p02888 | python | s019073808 | s994857901 | 833 | 769 | 45,320 | 43,884 | Accepted | Accepted | 7.68 | n = int(eval(input()))
l = list(map(int, input().split()))
l.sort(reverse=True)
m = sorted(l)
#print(l)
# print(m)
import bisect
ans = 0
for i in range(n-2):
a = l[i]
for j in range(i+1,n-1):
b = l[j]
x = a-b
ind = bisect.bisect_right(m,x)
#print(a, b, j, ind)
if n-1-j-ind >... | n = int(eval(input()))
L = list(map(int, input().split()))
L.sort()
import bisect
ans = 0
for i in range(n-2):
b = L[i]
for j in range(i+1, n-1):
c = L[j]
p = bisect.bisect_left(L, b+c)
#print(b, c, j, p, p-j-1)
ans += max(p-j-1, 0)
print(ans) | 22 | 14 | 357 | 291 | n = int(eval(input()))
l = list(map(int, input().split()))
l.sort(reverse=True)
m = sorted(l)
# print(l)
# print(m)
import bisect
ans = 0
for i in range(n - 2):
a = l[i]
for j in range(i + 1, n - 1):
b = l[j]
x = a - b
ind = bisect.bisect_right(m, x)
# print(a, b, j, ind)
... | n = int(eval(input()))
L = list(map(int, input().split()))
L.sort()
import bisect
ans = 0
for i in range(n - 2):
b = L[i]
for j in range(i + 1, n - 1):
c = L[j]
p = bisect.bisect_left(L, b + c)
# print(b, c, j, p, p-j-1)
ans += max(p - j - 1, 0)
print(ans)
| false | 36.363636 | [
"-l = list(map(int, input().split()))",
"-l.sort(reverse=True)",
"-m = sorted(l)",
"-# print(l)",
"-# print(m)",
"+L = list(map(int, input().split()))",
"+L.sort()",
"- a = l[i]",
"+ b = L[i]",
"- b = l[j]",
"- x = a - b",
"- ind = bisect.bisect_right(m, x)",
"- ... | false | 0.048357 | 0.044551 | 1.085443 | [
"s019073808",
"s994857901"
] |
u814986259 | p02796 | python | s045058446 | s461820828 | 401 | 281 | 21,824 | 26,980 | Accepted | Accepted | 29.93 | N = int(eval(input()))
XL = [tuple(map(int, input().split())) for i in range(N)]
XL.sort(key=lambda x: x[0]+x[1])
right = -10**9
removed = 0
for x, l in XL:
if x-l < right:
removed += 1
else:
right = x+l
print((N-removed))
| N = int(eval(input()))
XL = [tuple(map(int, input().split())) for i in range(N)]
XL.sort(key=lambda x: x[0] + x[1])
ans = 0
prev = - 10**9
for x, l in XL:
if prev <= x - l:
ans += 1
prev = x + l
print(ans)
| 12 | 12 | 251 | 233 | N = int(eval(input()))
XL = [tuple(map(int, input().split())) for i in range(N)]
XL.sort(key=lambda x: x[0] + x[1])
right = -(10**9)
removed = 0
for x, l in XL:
if x - l < right:
removed += 1
else:
right = x + l
print((N - removed))
| N = int(eval(input()))
XL = [tuple(map(int, input().split())) for i in range(N)]
XL.sort(key=lambda x: x[0] + x[1])
ans = 0
prev = -(10**9)
for x, l in XL:
if prev <= x - l:
ans += 1
prev = x + l
print(ans)
| false | 0 | [
"-right = -(10**9)",
"-removed = 0",
"+ans = 0",
"+prev = -(10**9)",
"- if x - l < right:",
"- removed += 1",
"- else:",
"- right = x + l",
"-print((N - removed))",
"+ if prev <= x - l:",
"+ ans += 1",
"+ prev = x + l",
"+print(ans)"
] | false | 0.130826 | 0.059872 | 2.185098 | [
"s045058446",
"s461820828"
] |
u375172966 | p03409 | python | s948338506 | s292159892 | 20 | 18 | 3,064 | 3,064 | Accepted | Accepted | 10 | n = int(eval(input()))
ab = []
cd = []
for _ in range(n):
a, b = list(map(int, input().split()))
ab.append([a, b])
for _ in range(n):
c, d = list(map(int, input().split()))
cd.append([c, d])
cd.sort()
ab.sort(reverse=True, key=lambda x:x[1])
tableA = [False for _ in range(n)]
tableB = [False... | n = int(eval(input()))
R = [list(map(int, input().split())) for _ in range(n)]
B = [list(map(int, input().split())) for _ in range(n)]
R.sort()
B.sort()
pair = []
for bx, by in B:
tmp = [r for r in R if r[0] < bx]
tmp.sort(key=lambda x: x[1])
for rx, ry in tmp[::-1]:
if ry < by:
... | 23 | 17 | 595 | 429 | n = int(eval(input()))
ab = []
cd = []
for _ in range(n):
a, b = list(map(int, input().split()))
ab.append([a, b])
for _ in range(n):
c, d = list(map(int, input().split()))
cd.append([c, d])
cd.sort()
ab.sort(reverse=True, key=lambda x: x[1])
tableA = [False for _ in range(n)]
tableB = [False for _ in r... | n = int(eval(input()))
R = [list(map(int, input().split())) for _ in range(n)]
B = [list(map(int, input().split())) for _ in range(n)]
R.sort()
B.sort()
pair = []
for bx, by in B:
tmp = [r for r in R if r[0] < bx]
tmp.sort(key=lambda x: x[1])
for rx, ry in tmp[::-1]:
if ry < by:
pair.app... | false | 26.086957 | [
"-ab = []",
"-cd = []",
"-for _ in range(n):",
"- a, b = list(map(int, input().split()))",
"- ab.append([a, b])",
"-for _ in range(n):",
"- c, d = list(map(int, input().split()))",
"- cd.append([c, d])",
"-cd.sort()",
"-ab.sort(reverse=True, key=lambda x: x[1])",
"-tableA = [False fo... | false | 0.046105 | 0.047261 | 0.975543 | [
"s948338506",
"s292159892"
] |
u339199690 | p02996 | python | s220263260 | s639727239 | 1,271 | 851 | 91,352 | 33,968 | Accepted | Accepted | 33.04 | N = int(eval(input()))
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda ab: ab[1])
cnt = 0
for a, b in AB:
if cnt + a <= b:
cnt += a
else:
print("No")
exit()
print("Yes")
| import sys, heapq, bisect, math, fractions
from collections import deque
N = int(eval(input()))
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x: x[1])
time = 0
for i in range(N):
time += AB[i][0]
if time > AB[i][1]:
print("No")
exit()
print("Yes"... | 13 | 16 | 238 | 315 | N = int(eval(input()))
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda ab: ab[1])
cnt = 0
for a, b in AB:
if cnt + a <= b:
cnt += a
else:
print("No")
exit()
print("Yes")
| import sys, heapq, bisect, math, fractions
from collections import deque
N = int(eval(input()))
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x: x[1])
time = 0
for i in range(N):
time += AB[i][0]
if time > AB[i][1]:
print("No")
exit()
print("Yes")
| false | 18.75 | [
"+import sys, heapq, bisect, math, fractions",
"+from collections import deque",
"+",
"-AB = [list(map(int, input().split())) for _ in range(N)]",
"-AB.sort(key=lambda ab: ab[1])",
"-cnt = 0",
"-for a, b in AB:",
"- if cnt + a <= b:",
"- cnt += a",
"- else:",
"+AB = [tuple(map(int, ... | false | 0.044478 | 0.007741 | 5.745536 | [
"s220263260",
"s639727239"
] |
u444856278 | p03101 | python | s935509249 | s424408835 | 23 | 18 | 3,572 | 2,940 | Accepted | Accepted | 21.74 | [print(f.reduce(o.mul,f.reduce(lambda x,y:[x[0]-y[0],x[1]-y[1]],[[int(i)for i in input().split()],[int(i)for i in input().split()]])))for f,o in[[__import__('functools'),__import__('operator')]]]
| [print((H-h)*(W-w))for H,W,h,w in[map(int,open(0).read().split())]]
| 1 | 1 | 195 | 67 | [
print(
f.reduce(
o.mul,
f.reduce(
lambda x, y: [x[0] - y[0], x[1] - y[1]],
[[int(i) for i in input().split()], [int(i) for i in input().split()]],
),
)
)
for f, o in [[__import__("functools"), __import__("operator")]]
]
| [print((H - h) * (W - w)) for H, W, h, w in [map(int, open(0).read().split())]]
| false | 0 | [
"-[",
"- print(",
"- f.reduce(",
"- o.mul,",
"- f.reduce(",
"- lambda x, y: [x[0] - y[0], x[1] - y[1]],",
"- [[int(i) for i in input().split()], [int(i) for i in input().split()]],",
"- ),",
"- )",
"- )",
"- fo... | false | 0.047992 | 0.047046 | 1.020123 | [
"s935509249",
"s424408835"
] |
u588341295 | p03409 | python | s879213699 | s223304670 | 35 | 24 | 3,444 | 3,192 | Accepted | Accepted | 31.43 | # -*- coding: utf-8 -*-
"""
参考:https://www.hamayanhamayan.com/entry/2018/03/18/085108
http://vartkw.hatenablog.com/entry/2016/12/02/002703
https://ikatakos.com/pot/programming_algorithm/graph_theory/maximum_flow
・二部最大マッチング
・最大流アルゴリズム(Dinic法)
・まだ理解不十分な点はあると思うけど、初めて見た時よりは見慣れた。
"""
from collections impo... | # -*- coding: utf-8 -*-
"""
参考:https://ikatakos.com/pot/programming_algorithm/graph_theory/bipartite_matching
・二部最大マッチング
"""
class BipartiteMatching:
"""
XとYの二部グラフの最大マッチング X={0,1,2,...|X|-1} Y={0,1,2,...,|Y|-1}
edges[x]: xとつながるYの頂点のset
match1[x]: xとマッチングされたYの頂点
match2[y]: yとマッチングされたXの頂... | 97 | 71 | 2,343 | 1,851 | # -*- coding: utf-8 -*-
"""
参考:https://www.hamayanhamayan.com/entry/2018/03/18/085108
http://vartkw.hatenablog.com/entry/2016/12/02/002703
https://ikatakos.com/pot/programming_algorithm/graph_theory/maximum_flow
・二部最大マッチング
・最大流アルゴリズム(Dinic法)
・まだ理解不十分な点はあると思うけど、初めて見た時よりは見慣れた。
"""
from collections import deque
cl... | # -*- coding: utf-8 -*-
"""
参考:https://ikatakos.com/pot/programming_algorithm/graph_theory/bipartite_matching
・二部最大マッチング
"""
class BipartiteMatching:
"""
XとYの二部グラフの最大マッチング X={0,1,2,...|X|-1} Y={0,1,2,...,|Y|-1}
edges[x]: xとつながるYの頂点のset
match1[x]: xとマッチングされたYの頂点
match2[y]: yとマッチングされたXの頂点
"""
... | false | 26.804124 | [
"-参考:https://www.hamayanhamayan.com/entry/2018/03/18/085108",
"- http://vartkw.hatenablog.com/entry/2016/12/02/002703",
"- https://ikatakos.com/pot/programming_algorithm/graph_theory/maximum_flow",
"+参考:https://ikatakos.com/pot/programming_algorithm/graph_theory/bipartite_matching",
"-・最大流アルゴリズム(Dinic法)... | false | 0.075327 | 0.066095 | 1.139677 | [
"s879213699",
"s223304670"
] |
u035210736 | p03861 | python | s486311239 | s084458966 | 36 | 29 | 9,988 | 9,100 | Accepted | Accepted | 19.44 | from decimal import *
a, b, x = list(map(int, input().split()))
ax = int(Decimal(a) / Decimal(x))
bx = int(Decimal(b) / Decimal(x))
am = a % x
bm = b % x
if ax == bx and am != 0 and bm != 0:
print((0))
elif am == 0:
print((bx - ax + 1))
else:
print((bx - ax)) | a, b, x = list(map(int, input().split()))
ans = b // x - a // x
if a % x == 0:
ans += 1
print(ans) | 12 | 5 | 264 | 98 | from decimal import *
a, b, x = list(map(int, input().split()))
ax = int(Decimal(a) / Decimal(x))
bx = int(Decimal(b) / Decimal(x))
am = a % x
bm = b % x
if ax == bx and am != 0 and bm != 0:
print((0))
elif am == 0:
print((bx - ax + 1))
else:
print((bx - ax))
| a, b, x = list(map(int, input().split()))
ans = b // x - a // x
if a % x == 0:
ans += 1
print(ans)
| false | 58.333333 | [
"-from decimal import *",
"-",
"-ax = int(Decimal(a) / Decimal(x))",
"-bx = int(Decimal(b) / Decimal(x))",
"-am = a % x",
"-bm = b % x",
"-if ax == bx and am != 0 and bm != 0:",
"- print((0))",
"-elif am == 0:",
"- print((bx - ax + 1))",
"-else:",
"- print((bx - ax))",
"+ans = b // ... | false | 0.037106 | 0.068301 | 0.543277 | [
"s486311239",
"s084458966"
] |
u729679908 | p03455 | python | s658166943 | s109186312 | 31 | 24 | 9,168 | 9,092 | Accepted | Accepted | 22.58 | x = input().split()
a =int(x[0])
b =int(x[1])
if (a*b) % 2:
print("Odd")
else:
print("Even") | x = input().split()
y = int(x[0])*int(x[1])
if y % 2:
print("Odd")
else:
print("Even") | 7 | 6 | 102 | 95 | x = input().split()
a = int(x[0])
b = int(x[1])
if (a * b) % 2:
print("Odd")
else:
print("Even")
| x = input().split()
y = int(x[0]) * int(x[1])
if y % 2:
print("Odd")
else:
print("Even")
| false | 14.285714 | [
"-a = int(x[0])",
"-b = int(x[1])",
"-if (a * b) % 2:",
"+y = int(x[0]) * int(x[1])",
"+if y % 2:"
] | false | 0.04445 | 0.142165 | 0.312666 | [
"s658166943",
"s109186312"
] |
u864013199 | p03163 | python | s545463506 | s897498032 | 451 | 172 | 120,556 | 14,684 | Accepted | Accepted | 61.86 | import sys
input = sys.stdin.readline #文字列入力では注意!
N,W = list(map(int,input().split()))
dp = [[0]*(W+1) for _ in range(N+1)]
for i in range(N):
w,v = list(map(int,input().split()))
for j in range(W+1):
if j+w <= W:
dp[i+1][j+w] = dp[i][j]+v
dp[i+1][j] = max(dp[i+1][j],dp... | import numpy as np
import sys
input = sys.stdin.readline #文字列入力では注意!
N,W = list(map(int,input().split()))
dp = np.zeros(W+1, dtype=np.int64)
for i in range(N):
w,v = list(map(int,input().split()))
np.maximum(dp[:-w]+v, dp[w:], out = dp[w:])
print((dp[-1]))
| 14 | 12 | 335 | 266 | import sys
input = sys.stdin.readline # 文字列入力では注意!
N, W = list(map(int, input().split()))
dp = [[0] * (W + 1) for _ in range(N + 1)]
for i in range(N):
w, v = list(map(int, input().split()))
for j in range(W + 1):
if j + w <= W:
dp[i + 1][j + w] = dp[i][j] + v
dp[i + 1][j] = max(dp... | import numpy as np
import sys
input = sys.stdin.readline # 文字列入力では注意!
N, W = list(map(int, input().split()))
dp = np.zeros(W + 1, dtype=np.int64)
for i in range(N):
w, v = list(map(int, input().split()))
np.maximum(dp[:-w] + v, dp[w:], out=dp[w:])
print((dp[-1]))
| false | 14.285714 | [
"+import numpy as np",
"-dp = [[0] * (W + 1) for _ in range(N + 1)]",
"+dp = np.zeros(W + 1, dtype=np.int64)",
"- for j in range(W + 1):",
"- if j + w <= W:",
"- dp[i + 1][j + w] = dp[i][j] + v",
"- dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])",
"-print((dp[N][W]))",
"+ ... | false | 0.13794 | 0.424472 | 0.32497 | [
"s545463506",
"s897498032"
] |
u834832056 | p02712 | python | s399401390 | s440124577 | 157 | 117 | 9,116 | 29,728 | Accepted | Accepted | 25.48 | def solve(n):
ans = 0
for i in range(1, n+1):
if (i % 3 == 0 and i % 5 == 0) or (i % 3 == 0) or (i % 5 == 0):
continue
else:
ans += i
print(ans)
if __name__ == "__main__":
n = int(eval(input()))
solve(n) | def solve(n):
arr = [i for i in range(1, n+1) if i % 3 != 0 and i % 5 != 0]
print((sum(arr)))
if __name__ == "__main__":
n = int(eval(input()))
solve(n) | 12 | 7 | 269 | 167 | def solve(n):
ans = 0
for i in range(1, n + 1):
if (i % 3 == 0 and i % 5 == 0) or (i % 3 == 0) or (i % 5 == 0):
continue
else:
ans += i
print(ans)
if __name__ == "__main__":
n = int(eval(input()))
solve(n)
| def solve(n):
arr = [i for i in range(1, n + 1) if i % 3 != 0 and i % 5 != 0]
print((sum(arr)))
if __name__ == "__main__":
n = int(eval(input()))
solve(n)
| false | 41.666667 | [
"- ans = 0",
"- for i in range(1, n + 1):",
"- if (i % 3 == 0 and i % 5 == 0) or (i % 3 == 0) or (i % 5 == 0):",
"- continue",
"- else:",
"- ans += i",
"- print(ans)",
"+ arr = [i for i in range(1, n + 1) if i % 3 != 0 and i % 5 != 0]",
"+ print((su... | false | 0.231116 | 0.191453 | 1.207165 | [
"s399401390",
"s440124577"
] |
u305366205 | p03363 | python | s631763878 | s446207022 | 190 | 172 | 41,472 | 41,728 | Accepted | Accepted | 9.47 | from collections import Counter
N = int(eval(input()))
A = [int(i) for i in input().split()]
cum = [0]
for a in A:
cum.append(cum[-1] + a)
count = Counter(cum)
ans = 0
for v in list(count.values()):
ans += v * (v - 1) // 2
print(ans) | from collections import Counter
N = int(eval(input()))
A = list(map(int, input().split()))
cum = [0]
for a in A:
cum.append(cum[-1] + a)
count = Counter(cum)
ans = 0
for v in list(count.values()):
ans += v * (v - 1) // 2
print(ans)
| 11 | 11 | 239 | 238 | from collections import Counter
N = int(eval(input()))
A = [int(i) for i in input().split()]
cum = [0]
for a in A:
cum.append(cum[-1] + a)
count = Counter(cum)
ans = 0
for v in list(count.values()):
ans += v * (v - 1) // 2
print(ans)
| from collections import Counter
N = int(eval(input()))
A = list(map(int, input().split()))
cum = [0]
for a in A:
cum.append(cum[-1] + a)
count = Counter(cum)
ans = 0
for v in list(count.values()):
ans += v * (v - 1) // 2
print(ans)
| false | 0 | [
"-A = [int(i) for i in input().split()]",
"+A = list(map(int, input().split()))"
] | false | 0.036849 | 0.040674 | 0.905957 | [
"s631763878",
"s446207022"
] |
u155757809 | p03962 | python | s337280686 | s541009885 | 27 | 24 | 9,044 | 8,992 | Accepted | Accepted | 11.11 | l = [ int(x) for x in input().split() ]
l = set(l)
print((len(list(l))))
| l = [ int(x) for x in input().split() ]
print((len(set(l))))
| 3 | 2 | 73 | 60 | l = [int(x) for x in input().split()]
l = set(l)
print((len(list(l))))
| l = [int(x) for x in input().split()]
print((len(set(l))))
| false | 33.333333 | [
"-l = set(l)",
"-print((len(list(l))))",
"+print((len(set(l))))"
] | false | 0.038127 | 0.03866 | 0.986204 | [
"s337280686",
"s541009885"
] |
u970197315 | p02848 | python | s131581412 | s929706426 | 25 | 21 | 3,188 | 3,060 | Accepted | Accepted | 16 | #ABC146 B
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
nl = lambda: list(map(int, input().split()))
N = ni()
S = si()
# SS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
# SSS = 'NOPQRSTUVWXYZABCDEFGHIJKLM'
S1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'... | # B
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
nl = lambda: list(map(int, input().split()))
n=ni()
s=si()
ans=''
for ss in s:
ans+=chr((ord(ss)+n-65)%26+65)
print(ans)
| 24 | 12 | 468 | 228 | # ABC146 B
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
nl = lambda: list(map(int, input().split()))
N = ni()
S = si()
# SS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
# SSS = 'NOPQRSTUVWXYZABCDEFGHIJKLM'
S1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = []
... | # B
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
nl = lambda: list(map(int, input().split()))
n = ni()
s = si()
ans = ""
for ss in s:
ans += chr((ord(ss) + n - 65) % 26 + 65)
print(ans)
| false | 50 | [
"-# ABC146 B",
"+# B",
"-N = ni()",
"-S = si()",
"-# SS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'",
"-# SSS = 'NOPQRSTUVWXYZABCDEFGHIJKLM'",
"-S1 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\"",
"-ans = []",
"-for i, s in enumerate(S):",
"- idx = S1.find(s)",
"- idx += N",
"- ans.app... | false | 0.034412 | 0.040082 | 0.85854 | [
"s131581412",
"s929706426"
] |
u693933222 | p03416 | python | s956429611 | s602557576 | 75 | 50 | 2,940 | 2,940 | Accepted | Accepted | 33.33 | a,b = list(map(int,input().split()))
ans = 0
for i in range(a,b+1):
li = list(str(i))
if(li[0] == li[4] and li[1] == li[3]):
ans += 1
print(ans) | a, b = list(map(int, input().split()))
ans = 0
for i in range(a, b + 1):
val = str(i)
if (val[0] == val[4] and val[1] == val[3]):
ans += 1
print(ans) | 10 | 9 | 174 | 169 | a, b = list(map(int, input().split()))
ans = 0
for i in range(a, b + 1):
li = list(str(i))
if li[0] == li[4] and li[1] == li[3]:
ans += 1
print(ans)
| a, b = list(map(int, input().split()))
ans = 0
for i in range(a, b + 1):
val = str(i)
if val[0] == val[4] and val[1] == val[3]:
ans += 1
print(ans)
| false | 10 | [
"- li = list(str(i))",
"- if li[0] == li[4] and li[1] == li[3]:",
"+ val = str(i)",
"+ if val[0] == val[4] and val[1] == val[3]:"
] | false | 0.175611 | 0.116061 | 1.513097 | [
"s956429611",
"s602557576"
] |
u389910364 | p03801 | python | s561172878 | s917998235 | 1,046 | 271 | 32,544 | 24,048 | Accepted | Accepted | 74.09 | import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator imp... | import os
import sys
if os.getenv("LOCAL"):
sys.stdin = open("_in.txt", "r")
sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
XY = [(a, i) for i, a in enumerate(A)]
XY.sort(reverse... | 101 | 25 | 2,054 | 528 | import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter... | import os
import sys
if os.getenv("LOCAL"):
sys.stdin = open("_in.txt", "r")
sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10**18
MOD = 10**9 + 7
N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
XY = [(a, i) for i, a in enumerate(A)]
XY.sort(reverse=True)
# 解説
ans = [0] ... | false | 75.247525 | [
"-import bisect",
"-import heapq",
"-import itertools",
"-import math",
"-import operator",
"-import re",
"-import string",
"-from collections import Counter, deque, defaultdict",
"-from copy import deepcopy",
"-from decimal import Decimal",
"-from fractions import gcd",
"-from functools impor... | false | 0.278692 | 0.041525 | 6.711353 | [
"s561172878",
"s917998235"
] |
u112364985 | p02659 | python | s999852510 | s565802236 | 142 | 25 | 71,584 | 10,084 | Accepted | Accepted | 82.39 | import math
from decimal import Decimal
a,b=input().split()
a=int(a)
new_a=Decimal(a)
new_b=Decimal(b)
print((math.floor(new_a*new_b))) | import math
from decimal import Decimal
a,b=input().split()
new_a=Decimal(a)
new_b=Decimal(b)
print((math.floor(new_a*new_b))) | 7 | 6 | 139 | 129 | import math
from decimal import Decimal
a, b = input().split()
a = int(a)
new_a = Decimal(a)
new_b = Decimal(b)
print((math.floor(new_a * new_b)))
| import math
from decimal import Decimal
a, b = input().split()
new_a = Decimal(a)
new_b = Decimal(b)
print((math.floor(new_a * new_b)))
| false | 14.285714 | [
"-a = int(a)"
] | false | 0.039258 | 0.045348 | 0.865718 | [
"s999852510",
"s565802236"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.