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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u966695411 | p03835 | python | s410946037 | s531129125 | 1,549 | 1,043 | 3,060 | 2,940 | Accepted | Accepted | 32.67 | K, S = list(map(int, input().split()))
K += 1
cnt = 0
for i in range(K):
if i+K*2<=S : continue
if i>S : continue
for j in range(min(K, S-i+1)):
if i+j+K<=S : continue
if i+j>S : break
cnt += 1
print(cnt) | #! /usr/bin/env python3
K, S = list(map(int, input().split()))
K += 1
cnt = 0
for i in range(min(K, S+1)):
if i+K*2<=S : continue
for j in range(min(K, S-i+1)):
if i+j+K<=S : continue
cnt += 1
print(cnt) | 11 | 11 | 250 | 238 | K, S = list(map(int, input().split()))
K += 1
cnt = 0
for i in range(K):
if i + K * 2 <= S:
continue
if i > S:
continue
for j in range(min(K, S - i + 1)):
if i + j + K <= S:
continue
if i + j > S:
break
cnt += 1
print(cnt)
| #! /usr/bin/env python3
K, S = list(map(int, input().split()))
K += 1
cnt = 0
for i in range(min(K, S + 1)):
if i + K * 2 <= S:
continue
for j in range(min(K, S - i + 1)):
if i + j + K <= S:
continue
cnt += 1
print(cnt)
| false | 0 | [
"+#! /usr/bin/env python3",
"-for i in range(K):",
"+for i in range(min(K, S + 1)):",
"- continue",
"- if i > S:",
"- if i + j > S:",
"- break"
] | false | 0.042061 | 0.035966 | 1.169467 | [
"s410946037",
"s531129125"
] |
u858885710 | p00006 | python | s075089214 | s775628595 | 20 | 10 | 4,180 | 4,184 | Accepted | Accepted | 50 | print(input().strip()[::-1]) | print(input()[::-1]) | 1 | 1 | 31 | 23 | print(input().strip()[::-1])
| print(input()[::-1])
| false | 0 | [
"-print(input().strip()[::-1])",
"+print(input()[::-1])"
] | false | 0.038577 | 0.039716 | 0.971323 | [
"s075089214",
"s775628595"
] |
u279605379 | p02297 | python | s809754282 | s793675868 | 30 | 20 | 7,728 | 7,728 | Accepted | Accepted | 33.33 | x=list(range(int(eval(input()))))
P=[]
Q=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:Q+=[P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]]
print((sum(Q)*0.5)) | x=list(range(int(eval(input()))))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j][0]*P[j+1][1]-P[j+1][0]*P[j][1]
print((_*0.5)) | 7 | 7 | 167 | 159 | x = list(range(int(eval(input()))))
P = []
Q = []
for _ in x:
P += [[int(i) for i in input().split()]]
P += [P[0]]
for j in x:
Q += [P[j][0] * P[j + 1][1] - P[j][1] * P[j + 1][0]]
print((sum(Q) * 0.5))
| x = list(range(int(eval(input()))))
P = []
for _ in x:
P += [[int(i) for i in input().split()]]
_ = 0
P += [P[0]]
for j in x:
_ += P[j][0] * P[j + 1][1] - P[j + 1][0] * P[j][1]
print((_ * 0.5))
| false | 0 | [
"-Q = []",
"+_ = 0",
"- Q += [P[j][0] * P[j + 1][1] - P[j][1] * P[j + 1][0]]",
"-print((sum(Q) * 0.5))",
"+ _ += P[j][0] * P[j + 1][1] - P[j + 1][0] * P[j][1]",
"+print((_ * 0.5))"
] | false | 0.046287 | 0.042902 | 1.078898 | [
"s809754282",
"s793675868"
] |
u711539583 | p03127 | python | s966629833 | s149184603 | 117 | 79 | 15,020 | 14,224 | Accepted | Accepted | 32.48 | n = int(eval(input()))
hps = list(map(int, input().split()))
m = min(hps)
def gojo(a, b):
if b == 0:
return a
else:
return gojo(b, a % b)
res = m
for hp in hps:
res = gojo(max(res, hp),min(res, hp))
print(res) | n = int(eval(input()))
hps = list(map(int, input().split()))
m = min(hps)
def gojo(a, b):
if b == 0:
return a
else:
return gojo(b, a % b)
res = m
for hp in hps:
res = gojo(hp, res)
print(res) | 12 | 12 | 228 | 210 | n = int(eval(input()))
hps = list(map(int, input().split()))
m = min(hps)
def gojo(a, b):
if b == 0:
return a
else:
return gojo(b, a % b)
res = m
for hp in hps:
res = gojo(max(res, hp), min(res, hp))
print(res)
| n = int(eval(input()))
hps = list(map(int, input().split()))
m = min(hps)
def gojo(a, b):
if b == 0:
return a
else:
return gojo(b, a % b)
res = m
for hp in hps:
res = gojo(hp, res)
print(res)
| false | 0 | [
"- res = gojo(max(res, hp), min(res, hp))",
"+ res = gojo(hp, res)"
] | false | 0.037555 | 0.007645 | 4.912472 | [
"s966629833",
"s149184603"
] |
u421674761 | p02659 | python | s931513790 | s792151581 | 37 | 25 | 9,988 | 9,032 | Accepted | Accepted | 32.43 | from decimal import *
a,b = input().split()
print((int(Decimal(a)*Decimal(b))))
| a,b = input().split()
a = int(a)
b = int(b.replace('.',''))
print((a*b//100))
| 4 | 6 | 82 | 83 | from decimal import *
a, b = input().split()
print((int(Decimal(a) * Decimal(b))))
| a, b = input().split()
a = int(a)
b = int(b.replace(".", ""))
print((a * b // 100))
| false | 33.333333 | [
"-from decimal import *",
"-",
"-print((int(Decimal(a) * Decimal(b))))",
"+a = int(a)",
"+b = int(b.replace(\".\", \"\"))",
"+print((a * b // 100))"
] | false | 0.08169 | 0.037612 | 2.171895 | [
"s931513790",
"s792151581"
] |
u811733736 | p00508 | python | s245200254 | s626390360 | 16,990 | 14,750 | 84,488 | 84,100 | Accepted | Accepted | 13.18 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0585
"""
import sys
from sys import stdin
from collections import namedtuple
input = stdin.readline
def closest_part(points, n):
# ?????¬???p324???
if n <= 1:
return float('inf')
m = n // 2
x ... | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0585
"""
import sys
from sys import stdin
input = stdin.readline
def closest_part(points, n):
# ?????¬???p324???
if n <= 1:
return float('inf')
m = n // 2
x = points[m][0]
d = min(closest_... | 46 | 44 | 1,111 | 998 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0585
"""
import sys
from sys import stdin
from collections import namedtuple
input = stdin.readline
def closest_part(points, n):
# ?????¬???p324???
if n <= 1:
return float("inf")
m = n // 2
x = points[m][0]
... | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0585
"""
import sys
from sys import stdin
input = stdin.readline
def closest_part(points, n):
# ?????¬???p324???
if n <= 1:
return float("inf")
m = n // 2
x = points[m][0]
d = min(closest_part(points[:m],... | false | 4.347826 | [
"-from collections import namedtuple",
"- for q in b[::-1]:",
"- # dx = p[0] - b[-j-1][0]",
"- # dy = p[1] - b[-j-1][1]",
"+ for q in b:",
"- b.append(p)",
"+ b.insert(0, p)"
] | false | 0.044355 | 0.046532 | 0.953217 | [
"s245200254",
"s626390360"
] |
u102461423 | p02973 | python | s437694518 | s145035966 | 117 | 88 | 7,964 | 12,528 | Accepted | Accepted | 24.79 | import sys
input = sys.stdin.readline
import bisect
INF = 10 ** 18
N = int(eval(input()))
A = [10 ** 10 - int(eval(input())) for _ in range(N)] # 逆順にしておく
# 最長単調減少列:狭義
dp = [INF] * (N+1) # 長さ、その長さの末端としてありうる最大値
for a in A:
idx = bisect.bisect_right(dp,a)
dp[idx] = a
answer = bisect.bisect_lef... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from bisect import bisect_right
N,*A = list(map(int,read().split()))
def LIS(seq):
# 狭義
N = len(seq)
INF = 10**18
dp = [INF] * (N+1)
for x in seq:
i = bisect_... | 18 | 21 | 333 | 427 | import sys
input = sys.stdin.readline
import bisect
INF = 10**18
N = int(eval(input()))
A = [10**10 - int(eval(input())) for _ in range(N)] # 逆順にしておく
# 最長単調減少列:狭義
dp = [INF] * (N + 1) # 長さ、その長さの末端としてありうる最大値
for a in A:
idx = bisect.bisect_right(dp, a)
dp[idx] = a
answer = bisect.bisect_left(dp, INF)
print(a... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from bisect import bisect_right
N, *A = list(map(int, read().split()))
def LIS(seq):
# 狭義
N = len(seq)
INF = 10**18
dp = [INF] * (N + 1)
for x in seq:
i = bisect_right(dp, ... | false | 14.285714 | [
"-input = sys.stdin.readline",
"-import bisect",
"+read = sys.stdin.buffer.read",
"+readline = sys.stdin.buffer.readline",
"+readlines = sys.stdin.buffer.readlines",
"+from bisect import bisect_right",
"-INF = 10**18",
"-N = int(eval(input()))",
"-A = [10**10 - int(eval(input())) for _ in range(N)] ... | false | 0.075458 | 0.111459 | 0.677003 | [
"s437694518",
"s145035966"
] |
u133936772 | p02763 | python | s644773076 | s791642925 | 1,705 | 1,302 | 120,308 | 28,928 | Accepted | Accepted | 23.64 | f=input
from bisect import bisect_left as g, insort as h
n,s=int(f()),list(f())
d={chr(97+i):[] for i in range(26)}
for i in range(n): d[s[i]]+=[i]
for _ in range(int(f())):
a,b,c=f().split(); b=int(b)-1
if a>'1': print((sum(1 for l in list(d.values()) if g(l,b)<len(l) and l[g(l,b)]<int(c))))
elif s[b]!=c... | f=input; from bisect import bisect_left as g, insort as h
f(); s,i=list(f()),0
from collections import *
d=defaultdict(list)
for c in s: d[c]+=[i]; i+=1
for _ in range(int(f())):
a,b,c=f().split(); b=int(b)-1
if a>'1': print((sum(1 for l in list(d.values()) if g(l,b)<len(l) and l[g(l,b)]<int(c))))
elif s[... | 9 | 9 | 357 | 362 | f = input
from bisect import bisect_left as g, insort as h
n, s = int(f()), list(f())
d = {chr(97 + i): [] for i in range(26)}
for i in range(n):
d[s[i]] += [i]
for _ in range(int(f())):
a, b, c = f().split()
b = int(b) - 1
if a > "1":
print(
(
sum(
... | f = input
from bisect import bisect_left as g, insort as h
f()
s, i = list(f()), 0
from collections import *
d = defaultdict(list)
for c in s:
d[c] += [i]
i += 1
for _ in range(int(f())):
a, b, c = f().split()
b = int(b) - 1
if a > "1":
print(
(
sum(
... | false | 0 | [
"-n, s = int(f()), list(f())",
"-d = {chr(97 + i): [] for i in range(26)}",
"-for i in range(n):",
"- d[s[i]] += [i]",
"+f()",
"+s, i = list(f()), 0",
"+from collections import *",
"+",
"+d = defaultdict(list)",
"+for c in s:",
"+ d[c] += [i]",
"+ i += 1"
] | false | 0.039101 | 0.039772 | 0.983113 | [
"s644773076",
"s791642925"
] |
u190167135 | p02911 | python | s106143120 | s272747886 | 189 | 93 | 11,492 | 11,612 | Accepted | Accepted | 50.79 | N,K,Q=list(map(int,input().split()))
scores=[K-Q]*N
for _ in range(Q):
scores[int(eval(input()))-1]+=1
for score in scores:
print(('Yes' if score>0 else 'No')) | import sys
sys.setrecursionlimit(1000000000)
input=sys.stdin.readline
N,K,Q=list(map(int,input().split()))
scores=[K-Q]*N
for _ in range(Q):
scores[int(eval(input()))-1]+=1
for score in scores:
print(('Yes' if score>0 else 'No')) | 6 | 9 | 158 | 231 | N, K, Q = list(map(int, input().split()))
scores = [K - Q] * N
for _ in range(Q):
scores[int(eval(input())) - 1] += 1
for score in scores:
print(("Yes" if score > 0 else "No"))
| import sys
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline
N, K, Q = list(map(int, input().split()))
scores = [K - Q] * N
for _ in range(Q):
scores[int(eval(input())) - 1] += 1
for score in scores:
print(("Yes" if score > 0 else "No"))
| false | 33.333333 | [
"+import sys",
"+",
"+sys.setrecursionlimit(1000000000)",
"+input = sys.stdin.readline"
] | false | 0.041252 | 0.042229 | 0.976859 | [
"s106143120",
"s272747886"
] |
u367701763 | p03112 | python | s032459620 | s119110020 | 778 | 717 | 121,608 | 89,704 | Accepted | Accepted | 7.84 | def near(x, Y):
i = bisect_left(Y,x)
if i == 0:
return Y[i]-x
elif i == len(Y):
return x-Y[i-1]
else:
return min(Y[i]-x, x-Y[i-1])
def near2(x, Y):
i = bisect_left(Y,x)
if i == 0:
return Y[i]-x + D[i][1]
elif i == len(Y):
return x-Y[i-1]... | def near(x, X):
i = bisect_left(X, x)
if i == 0: return [X[i]-x]
elif i == len(X): return [X[i-1]-x]
else: return [X[i]-x, X[i-1]-x]
from bisect import *
A, B, Q = list(map(int, input().split()))
S, T = [], []
for _ in range(A):
S.append(int(eval(input())))
for _ in range(B):
T.append... | 37 | 19 | 788 | 513 | def near(x, Y):
i = bisect_left(Y, x)
if i == 0:
return Y[i] - x
elif i == len(Y):
return x - Y[i - 1]
else:
return min(Y[i] - x, x - Y[i - 1])
def near2(x, Y):
i = bisect_left(Y, x)
if i == 0:
return Y[i] - x + D[i][1]
elif i == len(Y):
return x - Y... | def near(x, X):
i = bisect_left(X, x)
if i == 0:
return [X[i] - x]
elif i == len(X):
return [X[i - 1] - x]
else:
return [X[i] - x, X[i - 1] - x]
from bisect import *
A, B, Q = list(map(int, input().split()))
S, T = [], []
for _ in range(A):
S.append(int(eval(input())))
for... | false | 48.648649 | [
"-def near(x, Y):",
"- i = bisect_left(Y, x)",
"+def near(x, X):",
"+ i = bisect_left(X, x)",
"- return Y[i] - x",
"- elif i == len(Y):",
"- return x - Y[i - 1]",
"+ return [X[i] - x]",
"+ elif i == len(X):",
"+ return [X[i - 1] - x]",
"- return min... | false | 0.045492 | 0.088523 | 0.513907 | [
"s032459620",
"s119110020"
] |
u733608212 | p03409 | python | s906990167 | s789070826 | 39 | 23 | 3,064 | 3,064 | Accepted | Accepted | 41.03 | n = int(eval(input()))
red_li = [list(map(int, input().split())) for _ in range(n)]
blue_li = [list(map(int, input().split())) for _ in range(n)]
ans = 0
red_li.sort(reverse = True, key = lambda x : (x[0], x[1]))
blue_li.sort( key = lambda x : (x[0], x[1]))
def count(red, blue):
used_red = []
used_b... | n = int(eval(input()))
red_li = [list(map(int, input().split())) for _ in range(n)]
blue_li = [list(map(int, input().split())) for _ in range(n)]
ans = 0
red_li.sort(reverse = True, key = lambda x : (x[0], x[1]))
blue_li.sort( key = lambda x : (x[0], x[1]))
def count(red, blue):
used_red = []
used_b... | 33 | 27 | 1,118 | 800 | n = int(eval(input()))
red_li = [list(map(int, input().split())) for _ in range(n)]
blue_li = [list(map(int, input().split())) for _ in range(n)]
ans = 0
red_li.sort(reverse=True, key=lambda x: (x[0], x[1]))
blue_li.sort(key=lambda x: (x[0], x[1]))
def count(red, blue):
used_red = []
used_blue = []
for i ... | n = int(eval(input()))
red_li = [list(map(int, input().split())) for _ in range(n)]
blue_li = [list(map(int, input().split())) for _ in range(n)]
ans = 0
red_li.sort(reverse=True, key=lambda x: (x[0], x[1]))
blue_li.sort(key=lambda x: (x[0], x[1]))
def count(red, blue):
used_red = []
used_blue = []
for i ... | false | 18.181818 | [
"-ans = count(red_li, blue_li)",
"-red_li.sort(reverse=True, key=lambda x: (x[1], x[0]))",
"-blue_li.sort(key=lambda x: (x[1], x[0]))",
"-ans = max(ans, count(red_li, blue_li))",
"-red_li.sort(reverse=True, key=lambda x: (x[1], x[0]))",
"-blue_li.sort(key=lambda x: (x[0], x[1]))",
"-ans = max(ans, count... | false | 0.038263 | 0.038863 | 0.984556 | [
"s906990167",
"s789070826"
] |
u285891772 | p02882 | python | s604950446 | s054328820 | 55 | 38 | 5,588 | 5,204 | Accepted | Accepted | 30.91 | 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
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter,... | 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
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter,... | 35 | 31 | 1,055 | 996 | 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,
)
from itertools import (
accumulate,
permutations,
combinations,
combi... | 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,
)
from itertools import (
accumulate,
permutations,
combinations,
combi... | false | 11.428571 | [
"-S = x / a # 水の断面積",
"-if a * b / 2 >= S: # 水の断面:三角形",
"- c = 2 * S / b",
"- ans = degrees(atan(b / c))",
"-else: # 水の断面:台形",
"- c = 2 * S / a - b",
"- ans = degrees(atan((b - c) / a))",
"-print(ans)",
"+y = 2 * x / a / b",
"+h = x / a**2",
"+left = b - h",
"+if x <= a * a * b ... | false | 0.038275 | 0.038675 | 0.989666 | [
"s604950446",
"s054328820"
] |
u561083515 | p02837 | python | s378974375 | s086916273 | 336 | 216 | 3,316 | 3,064 | Accepted | Accepted | 35.71 | N = int(eval(input()))
xy = [[] for _ in range(N)]
for i in range(N):
A = int(eval(input()))
for _ in range(A):
x,y = list(map(int,input().split()))
xy[i].append([x-1,y])
answer = 0
# 状態n
for n in range(2 ** N):
# 正直者のリスト
true_person = []
index = 0
copy_n = n
... | N = int(eval(input()))
edge = [[] for _ in range(N)]
for i in range(N):
A = int(eval(input()))
for j in range(A):
x,y = list(map(int,input().split()))
edge[i].append((x-1,y))
ans = 0
for i in range(2**N):
# 1: 正直者
state = [0] * N
for j in range(N):
state[j] = (i... | 39 | 33 | 833 | 683 | N = int(eval(input()))
xy = [[] for _ in range(N)]
for i in range(N):
A = int(eval(input()))
for _ in range(A):
x, y = list(map(int, input().split()))
xy[i].append([x - 1, y])
answer = 0
# 状態n
for n in range(2**N):
# 正直者のリスト
true_person = []
index = 0
copy_n = n
while copy_n:... | N = int(eval(input()))
edge = [[] for _ in range(N)]
for i in range(N):
A = int(eval(input()))
for j in range(A):
x, y = list(map(int, input().split()))
edge[i].append((x - 1, y))
ans = 0
for i in range(2**N):
# 1: 正直者
state = [0] * N
for j in range(N):
state[j] = (i >> j) & ... | false | 15.384615 | [
"-xy = [[] for _ in range(N)]",
"+edge = [[] for _ in range(N)]",
"- for _ in range(A):",
"+ for j in range(A):",
"- xy[i].append([x - 1, y])",
"-answer = 0",
"-# 状態n",
"-for n in range(2**N):",
"- # 正直者のリスト",
"- true_person = []",
"- index = 0",
"- copy_n = n",
"- ... | false | 0.060466 | 0.047355 | 1.276869 | [
"s378974375",
"s086916273"
] |
u766477342 | p00244 | python | s253716786 | s204333140 | 1,870 | 940 | 6,768 | 6,780 | Accepted | Accepted | 49.73 | MAX_VAL = 99999999999
while 1:
n,m = list(map(int,input().split()))
if n == 0:break
costs = {x:[] for x in range(1,n+1)}
min_cost = [[MAX_VAL for x in range(2)] for y in range(n+1)]
for i in range(m):
a,b,c = list(map(int,input().split()))
costs[a].append((b,c))
cost... | MAX_V = 999999999999999999999
while 1:
n,m = list(map(int,input().split()))
if n == 0:break
costs = {x:[] for x in range(1,n+1)}
passed = [[0 for x in range(2)] for y in range(n+1)]
result = [MAX_V,MAX_V]
for i in range(m):
a,b,c = list(map(int,input().split()))
costs[a]... | 35 | 39 | 986 | 1,077 | MAX_VAL = 99999999999
while 1:
n, m = list(map(int, input().split()))
if n == 0:
break
costs = {x: [] for x in range(1, n + 1)}
min_cost = [[MAX_VAL for x in range(2)] for y in range(n + 1)]
for i in range(m):
a, b, c = list(map(int, input().split()))
costs[a].append((b, c))
... | MAX_V = 999999999999999999999
while 1:
n, m = list(map(int, input().split()))
if n == 0:
break
costs = {x: [] for x in range(1, n + 1)}
passed = [[0 for x in range(2)] for y in range(n + 1)]
result = [MAX_V, MAX_V]
for i in range(m):
a, b, c = list(map(int, input().split()))
... | false | 10.25641 | [
"-MAX_VAL = 99999999999",
"+MAX_V = 999999999999999999999",
"- min_cost = [[MAX_VAL for x in range(2)] for y in range(n + 1)]",
"+ passed = [[0 for x in range(2)] for y in range(n + 1)]",
"+ result = [MAX_V, MAX_V]",
"- if mc[2] != 1 and min_cost[mc[1]][tic_i] != MAX_VAL:",
"+ if ... | false | 0.089136 | 0.070438 | 1.265455 | [
"s253716786",
"s204333140"
] |
u401686269 | p02558 | python | s767085920 | s567845674 | 1,314 | 729 | 68,740 | 11,480 | Accepted | Accepted | 44.52 | from networkx.utils import UnionFind
N,Q=list(map(int,input().split()))
uf = UnionFind()
for i in range(Q):
t,u,v = list(map(int,input().split()))
if t:print((1 if uf[u]==uf[v] else 0))
else:uf.union(u,v) | class UnionFind():
def __init__(self, n=0):
self.d = [-1]*n
def find(self, x):
if self.d[x] < 0: return x
self.d[x] = self.find(self.d[x])
return self.d[x]
def unite(self, x, y):
x,y=self.find(x),self.find(y)
if x==y:return False
if s... | 7 | 32 | 202 | 786 | from networkx.utils import UnionFind
N, Q = list(map(int, input().split()))
uf = UnionFind()
for i in range(Q):
t, u, v = list(map(int, input().split()))
if t:
print((1 if uf[u] == uf[v] else 0))
else:
uf.union(u, v)
| class UnionFind:
def __init__(self, n=0):
self.d = [-1] * n
def find(self, x):
if self.d[x] < 0:
return x
self.d[x] = self.find(self.d[x])
return self.d[x]
def unite(self, x, y):
x, y = self.find(x), self.find(y)
if x == y:
return Fal... | false | 78.125 | [
"-from networkx.utils import UnionFind",
"+class UnionFind:",
"+ def __init__(self, n=0):",
"+ self.d = [-1] * n",
"-N, Q = list(map(int, input().split()))",
"-uf = UnionFind()",
"-for i in range(Q):",
"- t, u, v = list(map(int, input().split()))",
"- if t:",
"- print((1 if ... | false | 0.038341 | 0.047764 | 0.80272 | [
"s767085920",
"s567845674"
] |
u278955646 | p02780 | python | s575979469 | s969220322 | 1,495 | 1,264 | 26,328 | 26,328 | Accepted | Accepted | 15.45 | import queue
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
for i in range(len(p)):
p[i] = p[i] + 1
queue = queue.Queue()
currentSum = 0
maxSum = 0
for i in range(len(p)):
currentSum = currentSum + p[i]
queue.put(p[i])
if queue.qsize() > K:
currentSu... | import queue
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
for i in range(len(p)):
p[i] = p[i] + 1
queue = queue.Queue()
currentSum = 0
maxSum = 0
for i in range(len(p)):
currentSum = currentSum + p[i]
queue.put(p[i])
if i >= K:
currentSum = current... | 21 | 21 | 458 | 435 | import queue
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
for i in range(len(p)):
p[i] = p[i] + 1
queue = queue.Queue()
currentSum = 0
maxSum = 0
for i in range(len(p)):
currentSum = currentSum + p[i]
queue.put(p[i])
if queue.qsize() > K:
currentSum = currentSum - ... | import queue
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
for i in range(len(p)):
p[i] = p[i] + 1
queue = queue.Queue()
currentSum = 0
maxSum = 0
for i in range(len(p)):
currentSum = currentSum + p[i]
queue.put(p[i])
if i >= K:
currentSum = currentSum - queue.get()... | false | 0 | [
"- if queue.qsize() > K:",
"+ if i >= K:",
"- if queue.qsize() == K:",
"+ if i >= K - 1:"
] | false | 0.051597 | 0.008266 | 6.242197 | [
"s575979469",
"s969220322"
] |
u311379832 | p02844 | python | s808676834 | s799910428 | 23 | 21 | 3,064 | 3,064 | Accepted | Accepted | 8.7 |
N = int(eval(input()))
S = eval(input())
ans = 0
anslst = []
for i in range(10):
for j in range(10):
for k in range(10):
anslst.append(str(i) + str(j) + str(k))
tmp = ans
for i in anslst:
a, b, c = i
index1 = S.find(a)
index2 = S.find(b, index1 + 1)
index3 = S.fi... |
N = int(eval(input()))
S = eval(input())
cnt = 0
pin = []
for i in range(10):
for j in range(10):
for k in range(10):
pin.append(str(i) + str(j) + str(k))
for i in range(1000):
one = S.find(pin[i][0])
two = S.find(pin[i][1], one + 1)
three = S.find(pin[i][2], two + 1)
... | 19 | 18 | 411 | 388 | N = int(eval(input()))
S = eval(input())
ans = 0
anslst = []
for i in range(10):
for j in range(10):
for k in range(10):
anslst.append(str(i) + str(j) + str(k))
tmp = ans
for i in anslst:
a, b, c = i
index1 = S.find(a)
index2 = S.find(b, index1 + 1)
index3 = S.find(c, index2 + 1)... | N = int(eval(input()))
S = eval(input())
cnt = 0
pin = []
for i in range(10):
for j in range(10):
for k in range(10):
pin.append(str(i) + str(j) + str(k))
for i in range(1000):
one = S.find(pin[i][0])
two = S.find(pin[i][1], one + 1)
three = S.find(pin[i][2], two + 1)
if one != -... | false | 5.263158 | [
"-ans = 0",
"-anslst = []",
"+cnt = 0",
"+pin = []",
"- anslst.append(str(i) + str(j) + str(k))",
"-tmp = ans",
"-for i in anslst:",
"- a, b, c = i",
"- index1 = S.find(a)",
"- index2 = S.find(b, index1 + 1)",
"- index3 = S.find(c, index2 + 1)",
"- if index1 != -1 and... | false | 0.039947 | 0.040201 | 0.993683 | [
"s808676834",
"s799910428"
] |
u958506960 | p03495 | python | s453163880 | s418999576 | 219 | 79 | 49,020 | 35,996 | Accepted | Accepted | 63.93 | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
if len(set(a)) == k:
print((0))
exit()
d = {}
for i in a:
if i in d:
d[i] += 1
else:
d[i] = 1
s = sorted(list(d.items()), key=lambda x:x[1])
ans = 0
for j in range(len(s) - k):
ans += s[j][1]... | from collections import Counter
n, k = list(map(int, input().split()))
a = input().split()
c = sorted(list(Counter(a).values()), reverse=True)
print((max(0, sum(c[k:])))) | 19 | 7 | 320 | 164 | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
if len(set(a)) == k:
print((0))
exit()
d = {}
for i in a:
if i in d:
d[i] += 1
else:
d[i] = 1
s = sorted(list(d.items()), key=lambda x: x[1])
ans = 0
for j in range(len(s) - k):
ans += s[j][1]
print(ans)
| from collections import Counter
n, k = list(map(int, input().split()))
a = input().split()
c = sorted(list(Counter(a).values()), reverse=True)
print((max(0, sum(c[k:]))))
| false | 63.157895 | [
"+from collections import Counter",
"+",
"-a = list(map(int, input().split()))",
"-if len(set(a)) == k:",
"- print((0))",
"- exit()",
"-d = {}",
"-for i in a:",
"- if i in d:",
"- d[i] += 1",
"- else:",
"- d[i] = 1",
"-s = sorted(list(d.items()), key=lambda x: x[1])... | false | 0.043559 | 0.034312 | 1.269502 | [
"s453163880",
"s418999576"
] |
u519939795 | p03073 | python | s935762738 | s838571985 | 91 | 69 | 4,852 | 3,188 | Accepted | Accepted | 24.18 | s=eval(input())
a=[]
b=[]
for i in range(len(s)):
if i%2==0:
a.append('0')
else:
a.append('1')
for j in range(len(s)):
if j%2==1:
b.append('0')
else:
b.append('1')
ans1=0
ans2=0
for k in range(len(a)):
if a[k]!=s[k]:
ans1+=1
for z in range(le... | S = eval(input())
C = ["0","1"]
count1=count2=0
for i in range(len(S)):
# case 1
if S[i] == C[i%2]:
count1+=1
# case 2
if S[i] == C[(i+1)%2]:
count2+=1
print((min([count1, count2])))
| 22 | 13 | 380 | 206 | s = eval(input())
a = []
b = []
for i in range(len(s)):
if i % 2 == 0:
a.append("0")
else:
a.append("1")
for j in range(len(s)):
if j % 2 == 1:
b.append("0")
else:
b.append("1")
ans1 = 0
ans2 = 0
for k in range(len(a)):
if a[k] != s[k]:
ans1 += 1
for z in rang... | S = eval(input())
C = ["0", "1"]
count1 = count2 = 0
for i in range(len(S)):
# case 1
if S[i] == C[i % 2]:
count1 += 1
# case 2
if S[i] == C[(i + 1) % 2]:
count2 += 1
print((min([count1, count2])))
| false | 40.909091 | [
"-s = eval(input())",
"-a = []",
"-b = []",
"-for i in range(len(s)):",
"- if i % 2 == 0:",
"- a.append(\"0\")",
"- else:",
"- a.append(\"1\")",
"-for j in range(len(s)):",
"- if j % 2 == 1:",
"- b.append(\"0\")",
"- else:",
"- b.append(\"1\")",
"-an... | false | 0.045477 | 0.044207 | 1.028708 | [
"s935762738",
"s838571985"
] |
u845643816 | p02241 | python | s089812771 | s396024342 | 40 | 20 | 6,292 | 6,116 | Accepted | Accepted | 50 | n = int(eval(input()))
edgeArray = [list(map(int, input().split())) for i in range(n)]
edgeList = []
rootList = [-1 for i in range(n)]
sumLength = 0
def getRoot(x):
r = rootList[x]
if r < 0:
rootList[x] = x
elif r != x:
rootList[x] = getRoot(r)
return rootList[x]
... | n = int(eval(input()))
edgeList = []
for i in range(n):
a = list(map(int, input().split()))
for j in range(i):
if a[j] != -1:
edgeList.append([a[j], i, j])
rootList = [-1 for i in range(n)]
sumLength = 0
def getRoot(x):
r = rootList[x]
if r < 0:
rootList[x] = x
... | 26 | 27 | 654 | 610 | n = int(eval(input()))
edgeArray = [list(map(int, input().split())) for i in range(n)]
edgeList = []
rootList = [-1 for i in range(n)]
sumLength = 0
def getRoot(x):
r = rootList[x]
if r < 0:
rootList[x] = x
elif r != x:
rootList[x] = getRoot(r)
return rootList[x]
for i in range(n):
... | n = int(eval(input()))
edgeList = []
for i in range(n):
a = list(map(int, input().split()))
for j in range(i):
if a[j] != -1:
edgeList.append([a[j], i, j])
rootList = [-1 for i in range(n)]
sumLength = 0
def getRoot(x):
r = rootList[x]
if r < 0:
rootList[x] = x
elif r !... | false | 3.703704 | [
"-edgeArray = [list(map(int, input().split())) for i in range(n)]",
"+for i in range(n):",
"+ a = list(map(int, input().split()))",
"+ for j in range(i):",
"+ if a[j] != -1:",
"+ edgeList.append([a[j], i, j])",
"-for i in range(n):",
"- for j in range(i):",
"- if ed... | false | 0.067836 | 0.072062 | 0.941354 | [
"s089812771",
"s396024342"
] |
u190079347 | p02837 | python | s766618769 | s443003057 | 1,062 | 276 | 3,064 | 3,064 | Accepted | Accepted | 74.01 | n = int(eval(input()))
A = []
xy = []
max = 0
for i in range(n):
a = int(eval(input()))
A.append(a)
xy.append([list(map(int,input().split())) for i in range(a)])
for i in range(2**n):
ls = [0]*n
check = 0
for j in range(len(ls)):
if (i >> j) & 1:
ls[j] = 1
for p i... | n = int(eval(input()))
A = []
xy = []
max = 0
for i in range(n):
a = int(eval(input()))
A.append(a)
xy.append([list(map(int,input().split())) for i in range(a)])
for i in range(2**n):
ls = [0]*n
check = 0
for j in range(len(ls)):
if (i >> j) & 1:
ls[j] = 1
for p i... | 28 | 31 | 661 | 705 | n = int(eval(input()))
A = []
xy = []
max = 0
for i in range(n):
a = int(eval(input()))
A.append(a)
xy.append([list(map(int, input().split())) for i in range(a)])
for i in range(2**n):
ls = [0] * n
check = 0
for j in range(len(ls)):
if (i >> j) & 1:
ls[j] = 1
for p in ran... | n = int(eval(input()))
A = []
xy = []
max = 0
for i in range(n):
a = int(eval(input()))
A.append(a)
xy.append([list(map(int, input().split())) for i in range(a)])
for i in range(2**n):
ls = [0] * n
check = 0
for j in range(len(ls)):
if (i >> j) & 1:
ls[j] = 1
for p in ran... | false | 9.677419 | [
"+ else:",
"+ continue",
"+ break"
] | false | 0.041318 | 0.044051 | 0.937952 | [
"s766618769",
"s443003057"
] |
u860002137 | p02647 | python | s392596635 | s786666230 | 1,072 | 874 | 123,956 | 124,384 | Accepted | Accepted | 18.47 | import numpy as np
from numba import njit, i8
n, k = list(map(int, input().split()))
arr = np.array(list(map(int, input().split())))
@njit(i8[:](i8, i8, i8[:]), cache=True)
def solve(n, k, arr):
for i in range(min(k, 50)):
tmp_arr = np.zeros(n + 2, np.int64)
for i, power in enumerate(a... | import numpy as np
from numba import njit, i8
n, k = list(map(int, input().split()))
arr = np.array(list(map(int, input().split())))
@njit(i8[:](i8, i8, i8[:]), cache=True)
def solve(n, k, arr):
for i in range(min(k, 50)):
tmp_arr = np.zeros(n + 1, np.int64)
for i, power in enumerate(a... | 19 | 19 | 506 | 497 | import numpy as np
from numba import njit, i8
n, k = list(map(int, input().split()))
arr = np.array(list(map(int, input().split())))
@njit(i8[:](i8, i8, i8[:]), cache=True)
def solve(n, k, arr):
for i in range(min(k, 50)):
tmp_arr = np.zeros(n + 2, np.int64)
for i, power in enumerate(arr):
... | import numpy as np
from numba import njit, i8
n, k = list(map(int, input().split()))
arr = np.array(list(map(int, input().split())))
@njit(i8[:](i8, i8, i8[:]), cache=True)
def solve(n, k, arr):
for i in range(min(k, 50)):
tmp_arr = np.zeros(n + 1, np.int64)
for i, power in enumerate(arr):
... | false | 0 | [
"- tmp_arr = np.zeros(n + 2, np.int64)",
"+ tmp_arr = np.zeros(n + 1, np.int64)",
"- tmp_arr[max(0, i - power + 1)] += 1",
"- tmp_arr[min(n + 1, i + power + 2)] -= 1",
"- arr = np.cumsum(tmp_arr)[1:-1]",
"+ tmp_arr[max(0, i - power)] += 1",
"+ ... | false | 0.210477 | 0.220467 | 0.95469 | [
"s392596635",
"s786666230"
] |
u476604182 | p03142 | python | s685860172 | s420455188 | 248 | 225 | 37,228 | 36,844 | Accepted | Accepted | 9.27 | from collections import defaultdict, deque
def main():
N, M, *L = list(map(int, open(0).read().split()))
dic = defaultdict(list)
par = [None]*N
cnt = [0]*(N+1)
cnt[0] = 1
for a,b in zip(*[iter(L)]*2):
dic[a].append(b)
cnt[b] += 1
for i, m in enumerate(cnt):
if m==0:
q = de... | from collections import defaultdict, deque
def main():
N, M, *L = list(map(int, open(0).read().split()))
dic = defaultdict(list)
par = [None]*N
cnt = [0]*(N+1)
cnt[0] = 1
for a,b in zip(*[iter(L)]*2):
dic[a].append(b)
cnt[b] += 1
for i, m in enumerate(cnt):
if m==0:
q = de... | 30 | 30 | 586 | 588 | from collections import defaultdict, deque
def main():
N, M, *L = list(map(int, open(0).read().split()))
dic = defaultdict(list)
par = [None] * N
cnt = [0] * (N + 1)
cnt[0] = 1
for a, b in zip(*[iter(L)] * 2):
dic[a].append(b)
cnt[b] += 1
for i, m in enumerate(cnt):
... | from collections import defaultdict, deque
def main():
N, M, *L = list(map(int, open(0).read().split()))
dic = defaultdict(list)
par = [None] * N
cnt = [0] * (N + 1)
cnt[0] = 1
for a, b in zip(*[iter(L)] * 2):
dic[a].append(b)
cnt[b] += 1
for i, m in enumerate(cnt):
... | false | 0 | [
"- par[i - 1] = \"0\"",
"+ par[i - 1] = 0",
"- par[c - 1] = str(m)",
"+ par[c - 1] = m",
"- ans = \"\\n\".join(par)",
"+ ans = \"\\n\".join(map(str, par))"
] | false | 0.04662 | 0.043907 | 1.061811 | [
"s685860172",
"s420455188"
] |
u987164499 | p03469 | python | s510264997 | s829478567 | 149 | 17 | 12,248 | 2,940 | Accepted | Accepted | 88.59 | from sys import stdin
from itertools import combinations
from math import factorial
import numpy as np
import math
s = stdin.readline().rstrip()
print((s.replace("2017","2018"))) | s = eval(input())
print(("2018"+s[4:])) | 9 | 3 | 186 | 34 | from sys import stdin
from itertools import combinations
from math import factorial
import numpy as np
import math
s = stdin.readline().rstrip()
print((s.replace("2017", "2018")))
| s = eval(input())
print(("2018" + s[4:]))
| false | 66.666667 | [
"-from sys import stdin",
"-from itertools import combinations",
"-from math import factorial",
"-import numpy as np",
"-import math",
"-",
"-s = stdin.readline().rstrip()",
"-print((s.replace(\"2017\", \"2018\")))",
"+s = eval(input())",
"+print((\"2018\" + s[4:]))"
] | false | 0.043137 | 0.043755 | 0.985887 | [
"s510264997",
"s829478567"
] |
u585482323 | p03806 | python | s768879508 | s529217668 | 1,394 | 239 | 55,644 | 45,020 | Accepted | Accepted | 82.86 | #!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS... | #!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS... | 83 | 65 | 2,052 | 1,683 | #!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI():
return [int(x) for x in sys.stdin.buffer.readline().split()]
def I():
return int(sys.stdin.buffer.readline())
d... | #!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI():
return [int(x) for x in sys.stdin.buffer.readline().split()]
def I():
return int(sys.stdin.buffer.readline())
d... | false | 21.686747 | [
"- n1 = n >> 1",
"- n2 = n - n1",
"- s1 = defaultdict(lambda: float(\"inf\"))",
"- s2 = defaultdict(lambda: float(\"inf\"))",
"- for j in range(1 << n1):",
"- sa = 0",
"- sb = 0",
"- sc = 0",
"- for i in range(n1):",
"- if j & (1 << i):",
"- ... | false | 0.085362 | 0.045156 | 1.890368 | [
"s768879508",
"s529217668"
] |
u285443936 | p02915 | python | s795864070 | s990916659 | 164 | 17 | 38,384 | 2,940 | Accepted | Accepted | 89.63 | N = int(eval(input()))
print((N**3)) | num = int(eval(input()))
print((num ** 3)) | 3 | 3 | 31 | 37 | N = int(eval(input()))
print((N**3))
| num = int(eval(input()))
print((num**3))
| false | 0 | [
"-N = int(eval(input()))",
"-print((N**3))",
"+num = int(eval(input()))",
"+print((num**3))"
] | false | 0.091795 | 0.042412 | 2.164356 | [
"s795864070",
"s990916659"
] |
u600402037 | p02995 | python | s517394845 | s543065114 | 36 | 17 | 5,048 | 3,064 | Accepted | Accepted | 52.78 | from fractions import gcd
a,b,c,d=list(map(int,input().split()))
count=0
x=b-a+1
def cal(x):
return x//c+x//d-x//(c*d//gcd(c,d))
print((b-a+1-(cal(b)-cal(a-1))))
| import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def gcd(a, b): #最大公約数
while b:
a, b = b, a%b
return a
A, B, C, D = lr()
cnt_divided_C = B // C - (A-1) // C
cnt_divided_D = B // D - (A-1) // D
x = C * D // gcd(C, D)
... | 7 | 18 | 164 | 442 | from fractions import gcd
a, b, c, d = list(map(int, input().split()))
count = 0
x = b - a + 1
def cal(x):
return x // c + x // d - x // (c * d // gcd(c, d))
print((b - a + 1 - (cal(b) - cal(a - 1))))
| import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def gcd(a, b): # 最大公約数
while b:
a, b = b, a % b
return a
A, B, C, D = lr()
cnt_divided_C = B // C - (A - 1) // C
cnt_divided_D = B // D - (A - 1) // D
x = C * D // gcd(C, D)
cnt_d... | false | 61.111111 | [
"-from fractions import gcd",
"+import sys",
"-a, b, c, d = list(map(int, input().split()))",
"-count = 0",
"-x = b - a + 1",
"+sr = lambda: sys.stdin.readline().rstrip()",
"+ir = lambda: int(sr())",
"+lr = lambda: list(map(int, sr().split()))",
"-def cal(x):",
"- return x // c + x // d - x // ... | false | 0.062292 | 0.047375 | 1.314864 | [
"s517394845",
"s543065114"
] |
u119982001 | p02923 | python | s482756431 | s541264305 | 218 | 91 | 63,856 | 15,020 | Accepted | Accepted | 58.26 | #Lower
N = int(eval(input()))
H = list(map(int, input().split()))
max = 0
n=0
for i in range(N-1):
if H[i] >= H[i+1]:
n = n+1
else :
n = 0
if n > max:
max = n
print(max)
| N = int(eval(input()))
H = list(map(int,input().split()))
ans = 0
ctr = 0
for i in range(N-1):
if H[i] >= H[i+1]:
ctr += 1
else:
ctr = 0
ans = max(ans, ctr)
print(ans)
| 15 | 15 | 216 | 208 | # Lower
N = int(eval(input()))
H = list(map(int, input().split()))
max = 0
n = 0
for i in range(N - 1):
if H[i] >= H[i + 1]:
n = n + 1
else:
n = 0
if n > max:
max = n
print(max)
| N = int(eval(input()))
H = list(map(int, input().split()))
ans = 0
ctr = 0
for i in range(N - 1):
if H[i] >= H[i + 1]:
ctr += 1
else:
ctr = 0
ans = max(ans, ctr)
print(ans)
| false | 0 | [
"-# Lower",
"-max = 0",
"-n = 0",
"+ans = 0",
"+ctr = 0",
"- n = n + 1",
"+ ctr += 1",
"- n = 0",
"- if n > max:",
"- max = n",
"-print(max)",
"+ ctr = 0",
"+ ans = max(ans, ctr)",
"+print(ans)"
] | false | 0.034745 | 0.034538 | 1.005996 | [
"s482756431",
"s541264305"
] |
u796942881 | p03721 | python | s570216921 | s259218261 | 269 | 223 | 29,076 | 29,868 | Accepted | Accepted | 17.1 | from sys import stdin
def main():
lines = stdin.readlines()
N, K = list(map(int, lines[0].split()))
abn = [[int(abi) for abi in line.split()] for line in lines[1:]]
abn.sort()
cnt = 0
for ai, bi in abn:
cnt += bi
if K <= cnt:
print(ai)
break... | from sys import stdin
from operator import itemgetter
def main():
lines = stdin.readlines()
N, K = list(map(int, lines[0].split()))
abn = [[int(abi) for abi in line.split()] for line in lines[1:]]
abn.sort(key=itemgetter(0))
cnt = 0
for ai, bi in abn:
cnt += bi
if K... | 18 | 19 | 339 | 389 | from sys import stdin
def main():
lines = stdin.readlines()
N, K = list(map(int, lines[0].split()))
abn = [[int(abi) for abi in line.split()] for line in lines[1:]]
abn.sort()
cnt = 0
for ai, bi in abn:
cnt += bi
if K <= cnt:
print(ai)
break
return
... | from sys import stdin
from operator import itemgetter
def main():
lines = stdin.readlines()
N, K = list(map(int, lines[0].split()))
abn = [[int(abi) for abi in line.split()] for line in lines[1:]]
abn.sort(key=itemgetter(0))
cnt = 0
for ai, bi in abn:
cnt += bi
if K <= cnt:
... | false | 5.263158 | [
"+from operator import itemgetter",
"- abn.sort()",
"+ abn.sort(key=itemgetter(0))"
] | false | 0.071284 | 0.044353 | 1.60722 | [
"s570216921",
"s259218261"
] |
u181801282 | p03816 | python | s207876460 | s328346025 | 78 | 44 | 20,336 | 14,396 | Accepted | Accepted | 43.59 | N=int(eval(input()))
A=list(map(int,input().split()))
S={}
for i in range(N):
if A[i] in S: S[A[i]]+=1
else: S[A[i]]=1
d=0
for i in list(S.values()):
d+=(i-1)
print((len(set(A))-d%2)) | N=int(eval(input()))
K=len(set(list(map(int,input().split()))))
if K%2==0: print((K-1))
else: print(K) | 10 | 4 | 184 | 97 | N = int(eval(input()))
A = list(map(int, input().split()))
S = {}
for i in range(N):
if A[i] in S:
S[A[i]] += 1
else:
S[A[i]] = 1
d = 0
for i in list(S.values()):
d += i - 1
print((len(set(A)) - d % 2))
| N = int(eval(input()))
K = len(set(list(map(int, input().split()))))
if K % 2 == 0:
print((K - 1))
else:
print(K)
| false | 60 | [
"-A = list(map(int, input().split()))",
"-S = {}",
"-for i in range(N):",
"- if A[i] in S:",
"- S[A[i]] += 1",
"- else:",
"- S[A[i]] = 1",
"-d = 0",
"-for i in list(S.values()):",
"- d += i - 1",
"-print((len(set(A)) - d % 2))",
"+K = len(set(list(map(int, input().split(... | false | 0.088469 | 0.1057 | 0.836977 | [
"s207876460",
"s328346025"
] |
u102461423 | p02939 | python | s149932297 | s211356438 | 397 | 314 | 19,184 | 19,184 | Accepted | Accepted | 20.91 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
S = input().rstrip()
if len(S) == 1:
print((1))
exit()
# n文字目を最後に長さ1,2で見る
INF = 10 ** 10
dp_1 = [-INF] * (len(S))
dp_2 = [-INF] * (len(S))
dp_1[0] = 1
dp_2[1] = 1
if S[0] != S[1]:
dp_1[1] = 2
for i,s in enumerate(S... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# 長さ3以上は使わないとしてよい
S = '$$' + read().rstrip().decode('utf-8')
# 最後の長さ -> 文字列の個数
N = len(S)
INF = 10 ** 9
one = [-INF] * N; one[1] = 0
two = [-INF] * N; two[1] = 0
for i in range(2,N):
... | 37 | 35 | 649 | 683 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
S = input().rstrip()
if len(S) == 1:
print((1))
exit()
# n文字目を最後に長さ1,2で見る
INF = 10**10
dp_1 = [-INF] * (len(S))
dp_2 = [-INF] * (len(S))
dp_1[0] = 1
dp_2[1] = 1
if S[0] != S[1]:
dp_1[1] = 2
for i, s in enumerate(S[2:], 2):
# 2文字→1文字
... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# 長さ3以上は使わないとしてよい
S = "$$" + read().rstrip().decode("utf-8")
# 最後の長さ -> 文字列の個数
N = len(S)
INF = 10**9
one = [-INF] * N
one[1] = 0
two = [-INF] * N
two[1] = 0
for i in range(2, N):
# 2 -> 1
x = tw... | false | 5.405405 | [
"-input = sys.stdin.readline",
"-sys.setrecursionlimit(10**7)",
"-S = input().rstrip()",
"-if len(S) == 1:",
"- print((1))",
"- exit()",
"-# n文字目を最後に長さ1,2で見る",
"-INF = 10**10",
"-dp_1 = [-INF] * (len(S))",
"-dp_2 = [-INF] * (len(S))",
"-dp_1[0] = 1",
"-dp_2[1] = 1",
"-if S[0] != S[1]:"... | false | 0.196363 | 0.107859 | 1.820551 | [
"s149932297",
"s211356438"
] |
u484229314 | p02762 | python | s867747570 | s667460451 | 885 | 657 | 31,880 | 15,508 | Accepted | Accepted | 25.76 | class UnionFind:
"""
size の要素数の UnionFind を管理する
data 中の負数の要素が根となる
"""
def __init__(self, size):
# 根は子を含む集合のデータ数を負数でもつ
self.data = [-1] * size
def merge(self, x, y):
x = self.root(x)
y = self.root(y)
if x == y: return False
# y の方が... | class UnionFind:
"""
size の要素数の UnionFind を管理する
data 中の負数の要素が根となる
"""
def __init__(self, size):
# 根は子を含む集合のデータ数を負数でもつ
self.data = [-1] * size
def merge(self, x, y):
x = self.root(x)
y = self.root(y)
if x == y: return False
# y の方が... | 60 | 58 | 1,320 | 1,283 | class UnionFind:
"""
size の要素数の UnionFind を管理する
data 中の負数の要素が根となる
"""
def __init__(self, size):
# 根は子を含む集合のデータ数を負数でもつ
self.data = [-1] * size
def merge(self, x, y):
x = self.root(x)
y = self.root(y)
if x == y:
return False
# y の方がデータ数... | class UnionFind:
"""
size の要素数の UnionFind を管理する
data 中の負数の要素が根となる
"""
def __init__(self, size):
# 根は子を含む集合のデータ数を負数でもつ
self.data = [-1] * size
def merge(self, x, y):
x = self.root(x)
y = self.root(y)
if x == y:
return False
# y の方がデータ数... | false | 3.333333 | [
"-MG = [0] * (N + 1)",
"+NG = [0] * (N + 1)",
"- MG[a] += 1",
"- MG[b] += 1",
"-KG = [[] for _ in range(N + 1)]",
"+ NG[a] += 1",
"+ NG[b] += 1",
"+# KG = [[] for _ in range(N + 1)]",
"- KG[a].append(b)",
"- KG[b].append(a)",
"+ if uf.root(a) == uf.root(b):",
"+ NG[... | false | 0.039425 | 0.039219 | 1.005235 | [
"s867747570",
"s667460451"
] |
u546338822 | p03043 | python | s368551659 | s823527285 | 53 | 39 | 2,940 | 9,356 | Accepted | Accepted | 26.42 | n,k = list(map(int,input().split()))
ans = 0
for s in range(1,n+1):
r = s
i = 0
while r < k:
r = r*2
i = i+1
ans += (0.5**i)/n
print(ans) | def main():
n,k = list(map(int,input().split()))
ans = 0
for i in range(1,n+1):
c = 0
while i<k:
i = i*2
c += 1
ans += 1/n * (1/2)**c
print(ans)
if __name__ == "__main__":
main()
| 11 | 13 | 174 | 254 | n, k = list(map(int, input().split()))
ans = 0
for s in range(1, n + 1):
r = s
i = 0
while r < k:
r = r * 2
i = i + 1
ans += (0.5**i) / n
print(ans)
| def main():
n, k = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
c = 0
while i < k:
i = i * 2
c += 1
ans += 1 / n * (1 / 2) ** c
print(ans)
if __name__ == "__main__":
main()
| false | 15.384615 | [
"-n, k = list(map(int, input().split()))",
"-ans = 0",
"-for s in range(1, n + 1):",
"- r = s",
"- i = 0",
"- while r < k:",
"- r = r * 2",
"- i = i + 1",
"- ans += (0.5**i) / n",
"-print(ans)",
"+def main():",
"+ n, k = list(map(int, input().split()))",
"+ an... | false | 0.084446 | 0.046293 | 1.824147 | [
"s368551659",
"s823527285"
] |
u285443936 | p03037 | python | s572042157 | s295231726 | 354 | 166 | 3,060 | 3,064 | Accepted | Accepted | 53.11 | N, M = list(map(int, input().split()))
Lmax = 1
Rmin = N
for i in range(M):
L, R = list(map(int, input().split()))
Lmax = max(Lmax, L)
Rmin = min(Rmin, R)
if Rmin < Lmax:
print((0))
exit()
print((Rmin-Lmax+1)) | import sys
input = sys.stdin.readline
N, M = list(map(int, input().split()))
L, R = 0, N
for i in range(M):
l, r = list(map(int,input().split()))
L = max(L, l)
R = min(R, r)
if L > R:
print((0))
exit()
print((R-L+1)) | 12 | 13 | 221 | 229 | N, M = list(map(int, input().split()))
Lmax = 1
Rmin = N
for i in range(M):
L, R = list(map(int, input().split()))
Lmax = max(Lmax, L)
Rmin = min(Rmin, R)
if Rmin < Lmax:
print((0))
exit()
print((Rmin - Lmax + 1))
| import sys
input = sys.stdin.readline
N, M = list(map(int, input().split()))
L, R = 0, N
for i in range(M):
l, r = list(map(int, input().split()))
L = max(L, l)
R = min(R, r)
if L > R:
print((0))
exit()
print((R - L + 1))
| false | 7.692308 | [
"+import sys",
"+",
"+input = sys.stdin.readline",
"-Lmax = 1",
"-Rmin = N",
"+L, R = 0, N",
"- L, R = list(map(int, input().split()))",
"- Lmax = max(Lmax, L)",
"- Rmin = min(Rmin, R)",
"- if Rmin < Lmax:",
"+ l, r = list(map(int, input().split()))",
"+ L = max(L, l)",
"+ ... | false | 0.076158 | 0.039851 | 1.91107 | [
"s572042157",
"s295231726"
] |
u832039789 | p03478 | python | s064937558 | s051547908 | 37 | 31 | 3,060 | 2,940 | Accepted | Accepted | 16.22 | def digitsum(n):
res = 0
for i in range(5):
res += (n//10**i)%10
return res
n,a,b=list(map(int,input().split()))
res=0
for i in range(1,n+1):
if a<=digitsum(i)<=b:
res += i
print(res) | n,a,b = list(map(int,input().split()))
def digitsum(num):
s = str(num)
r = 0
for c in s:
r += int(c)
return r
res = 0
for i in range(1,n+1):
if a<=digitsum(i)<=b:
res += i
print(res)
| 11 | 14 | 219 | 228 | def digitsum(n):
res = 0
for i in range(5):
res += (n // 10**i) % 10
return res
n, a, b = list(map(int, input().split()))
res = 0
for i in range(1, n + 1):
if a <= digitsum(i) <= b:
res += i
print(res)
| n, a, b = list(map(int, input().split()))
def digitsum(num):
s = str(num)
r = 0
for c in s:
r += int(c)
return r
res = 0
for i in range(1, n + 1):
if a <= digitsum(i) <= b:
res += i
print(res)
| false | 21.428571 | [
"-def digitsum(n):",
"- res = 0",
"- for i in range(5):",
"- res += (n // 10**i) % 10",
"- return res",
"+n, a, b = list(map(int, input().split()))",
"-n, a, b = list(map(int, input().split()))",
"+def digitsum(num):",
"+ s = str(num)",
"+ r = 0",
"+ for c in s:",
"+ ... | false | 0.082378 | 0.081719 | 1.008067 | [
"s064937558",
"s051547908"
] |
u150984829 | p02397 | python | s501331906 | s756446128 | 40 | 30 | 5,976 | 5,876 | Accepted | Accepted | 25 | a=[]
while 1:
n=eval(input())
if n=='0 0':break
a.append(n)
for s in a:
print((*sorted(map(int, s.split())))) | a=[]
import sys
for s in sys.stdin:
if s=='0 0\n':break
a.append(s)
for t in a:
x,y=map(int,t.split())
print(f'{y} {x}') if x>y else print(t.strip())
| 7 | 8 | 111 | 160 | a = []
while 1:
n = eval(input())
if n == "0 0":
break
a.append(n)
for s in a:
print((*sorted(map(int, s.split()))))
| a = []
import sys
for s in sys.stdin:
if s == "0 0\n":
break
a.append(s)
for t in a:
x, y = map(int, t.split())
print(f"{y} {x}") if x > y else print(t.strip())
| false | 12.5 | [
"-while 1:",
"- n = eval(input())",
"- if n == \"0 0\":",
"+import sys",
"+",
"+for s in sys.stdin:",
"+ if s == \"0 0\\n\":",
"- a.append(n)",
"-for s in a:",
"- print((*sorted(map(int, s.split()))))",
"+ a.append(s)",
"+for t in a:",
"+ x, y = map(int, t.split())",
"... | false | 0.04418 | 0.042433 | 1.041155 | [
"s501331906",
"s756446128"
] |
u296518383 | p03448 | python | s718064967 | s725430439 | 37 | 33 | 3,060 | 3,060 | Accepted | Accepted | 10.81 | A, B, C, X = int(eval(input())), int(eval(input())), int(eval(input())), int(eval(input()))
X //= 50
answer = 0
for a in range(A + 1):
if a * 10 > X:
continue
for b in range(B + 1):
for c in range(C + 1):
if a * 10 + b * 2 + c == X:
answer += 1
print(answer) | A, B, C, X = int(eval(input())), int(eval(input())), int(eval(input())), int(eval(input()))
X //= 50
answer = 0
for a in range(A + 1):
if a * 10 > X:
continue
for b in range(B + 1):
if a * 10 + b * 2 > X:
continue
for c in range(C + 1):
if a * 10 + b * 2 + c == X:
answer... | 13 | 15 | 274 | 319 | A, B, C, X = (
int(eval(input())),
int(eval(input())),
int(eval(input())),
int(eval(input())),
)
X //= 50
answer = 0
for a in range(A + 1):
if a * 10 > X:
continue
for b in range(B + 1):
for c in range(C + 1):
if a * 10 + b * 2 + c == X:
answer += 1
pr... | A, B, C, X = (
int(eval(input())),
int(eval(input())),
int(eval(input())),
int(eval(input())),
)
X //= 50
answer = 0
for a in range(A + 1):
if a * 10 > X:
continue
for b in range(B + 1):
if a * 10 + b * 2 > X:
continue
for c in range(C + 1):
if a *... | false | 13.333333 | [
"+ if a * 10 + b * 2 > X:",
"+ continue"
] | false | 0.057126 | 0.050967 | 1.12083 | [
"s718064967",
"s725430439"
] |
u416011173 | p02630 | python | s922129676 | s412407083 | 380 | 342 | 30,028 | 30,072 | Accepted | Accepted | 10 | # -*- coding: utf-8 -*-
# モジュールのインポート
import collections
# 標準入力の取得
N = int(eval(input()))
A = list(map(int, input().split()))
Q = int(eval(input()))
B, C = [], []
for q in range(Q):
B_q, C_q = list(map(int, input().split()))
B.append(B_q)
C.append(C_q)
# 求解処理
S = sum(A)
counter_A = collect... | # -*- coding: utf-8 -*-
# モジュールのインポート
import collections
def get_input() -> tuple:
"""
標準入力を取得する.
Returns:\n
tuple: 標準入力
"""
# 標準入力の取得
N = int(eval(input()))
A = list(map(int, input().split()))
Q = int(eval(input()))
B, C = [], []
for q in range(Q):
... | 24 | 52 | 479 | 996 | # -*- coding: utf-8 -*-
# モジュールのインポート
import collections
# 標準入力の取得
N = int(eval(input()))
A = list(map(int, input().split()))
Q = int(eval(input()))
B, C = [], []
for q in range(Q):
B_q, C_q = list(map(int, input().split()))
B.append(B_q)
C.append(C_q)
# 求解処理
S = sum(A)
counter_A = collections.Counter(A)
f... | # -*- coding: utf-8 -*-
# モジュールのインポート
import collections
def get_input() -> tuple:
"""
標準入力を取得する.
Returns:\n
tuple: 標準入力
"""
# 標準入力の取得
N = int(eval(input()))
A = list(map(int, input().split()))
Q = int(eval(input()))
B, C = [], []
for q in range(Q):
B_q, C_q = l... | false | 53.846154 | [
"-# 標準入力の取得",
"-N = int(eval(input()))",
"-A = list(map(int, input().split()))",
"-Q = int(eval(input()))",
"-B, C = [], []",
"-for q in range(Q):",
"- B_q, C_q = list(map(int, input().split()))",
"- B.append(B_q)",
"- C.append(C_q)",
"-# 求解処理",
"-S = sum(A)",
"-counter_A = collection... | false | 0.035522 | 0.042472 | 0.836373 | [
"s922129676",
"s412407083"
] |
u761529120 | p03252 | python | s906487378 | s365540864 | 185 | 92 | 41,840 | 74,352 | Accepted | Accepted | 50.27 | def main():
S = eval(input())
T = eval(input())
start = [-1] * 26
goal = [-1] * 26
for i in range(len(S)):
a = ord(S[i]) - ord('a')
b = ord(T[i]) - ord('a')
if start[a] != -1 or goal[b] != -1:
if start[a] != b or goal[b] != a:
print... | from collections import Counter
def main():
S = eval(input())
T = eval(input())
cnt_S = []
cnt_T = []
for i, j in list(Counter(S).items()):
cnt_S.append(j)
for i, j in list(Counter(T).items()):
cnt_T.append(j)
cnt_S.sort()
cnt_T.sort()
if cnt_T == cnt_... | 22 | 22 | 425 | 396 | def main():
S = eval(input())
T = eval(input())
start = [-1] * 26
goal = [-1] * 26
for i in range(len(S)):
a = ord(S[i]) - ord("a")
b = ord(T[i]) - ord("a")
if start[a] != -1 or goal[b] != -1:
if start[a] != b or goal[b] != a:
print("No")
... | from collections import Counter
def main():
S = eval(input())
T = eval(input())
cnt_S = []
cnt_T = []
for i, j in list(Counter(S).items()):
cnt_S.append(j)
for i, j in list(Counter(T).items()):
cnt_T.append(j)
cnt_S.sort()
cnt_T.sort()
if cnt_T == cnt_S:
pri... | false | 0 | [
"+from collections import Counter",
"+",
"+",
"- start = [-1] * 26",
"- goal = [-1] * 26",
"- for i in range(len(S)):",
"- a = ord(S[i]) - ord(\"a\")",
"- b = ord(T[i]) - ord(\"a\")",
"- if start[a] != -1 or goal[b] != -1:",
"- if start[a] != b or goal[b] !... | false | 0.035876 | 0.038421 | 0.933765 | [
"s906487378",
"s365540864"
] |
u764600134 | p03163 | python | s538467930 | s982431319 | 703 | 283 | 121,272 | 40,048 | Accepted | Accepted | 59.74 | # -*- coding: utf-8 -*-
"""
D - Knapsack 1
https://atcoder.jp/contests/dp/tasks/dp_d
"""
import sys
def solve(N, W, items):
ans = {0: 0}
for w, v in items:
u = dict()
for x, y in list(ans.items()):
if x+w <= W and ans.get(x+w, 0) < y+v:
u[x+w] = y+v
... | # -*- coding: utf-8 -*-
"""
D - Knapsack 1
https://atcoder.jp/contests/dp/tasks/dp_d
"""
import sys
def solve(N, W, items):
dp = [0-1] * (W+1)
dp[0] = 0
for w, v in items:
for i in range(W, w-1, -1):
if dp[i-w] != -1:
dp[i] = max(dp[i], dp[i-w]+v)
r... | 29 | 29 | 607 | 563 | # -*- coding: utf-8 -*-
"""
D - Knapsack 1
https://atcoder.jp/contests/dp/tasks/dp_d
"""
import sys
def solve(N, W, items):
ans = {0: 0}
for w, v in items:
u = dict()
for x, y in list(ans.items()):
if x + w <= W and ans.get(x + w, 0) < y + v:
u[x + w] = y + v
... | # -*- coding: utf-8 -*-
"""
D - Knapsack 1
https://atcoder.jp/contests/dp/tasks/dp_d
"""
import sys
def solve(N, W, items):
dp = [0 - 1] * (W + 1)
dp[0] = 0
for w, v in items:
for i in range(W, w - 1, -1):
if dp[i - w] != -1:
dp[i] = max(dp[i], dp[i - w] + v)
return... | false | 0 | [
"- ans = {0: 0}",
"+ dp = [0 - 1] * (W + 1)",
"+ dp[0] = 0",
"- u = dict()",
"- for x, y in list(ans.items()):",
"- if x + w <= W and ans.get(x + w, 0) < y + v:",
"- u[x + w] = y + v",
"- ans.update(u)",
"- return max([v for v in list(ans.va... | false | 0.078603 | 0.039392 | 1.995427 | [
"s538467930",
"s982431319"
] |
u716043626 | p03607 | python | s811688474 | s538617850 | 218 | 200 | 15,076 | 16,640 | Accepted | Accepted | 8.26 | n = int(eval(input()))
a = {}
cnt = 0
for i in range(n):
tmp = int(eval(input()))
if tmp not in a:
a[tmp] = 1
else:
a[tmp] += 1
for v in list(a.values()):
if v % 2 != 0:
cnt += 1
print(cnt) | import collections
n = int(eval(input()))
a = [int(eval(input())) for _ in range(n)]
ans = 0
c = collections.Counter(a)
for i in list(c.values()):
if i % 2 != 0:
ans += 1
print(ans) | 15 | 13 | 227 | 191 | n = int(eval(input()))
a = {}
cnt = 0
for i in range(n):
tmp = int(eval(input()))
if tmp not in a:
a[tmp] = 1
else:
a[tmp] += 1
for v in list(a.values()):
if v % 2 != 0:
cnt += 1
print(cnt)
| import collections
n = int(eval(input()))
a = [int(eval(input())) for _ in range(n)]
ans = 0
c = collections.Counter(a)
for i in list(c.values()):
if i % 2 != 0:
ans += 1
print(ans)
| false | 13.333333 | [
"+import collections",
"+",
"-a = {}",
"-cnt = 0",
"-for i in range(n):",
"- tmp = int(eval(input()))",
"- if tmp not in a:",
"- a[tmp] = 1",
"- else:",
"- a[tmp] += 1",
"-for v in list(a.values()):",
"- if v % 2 != 0:",
"- cnt += 1",
"-print(cnt)",
"+a =... | false | 0.034202 | 0.042621 | 0.802477 | [
"s811688474",
"s538617850"
] |
u327466606 | p03334 | python | s723521343 | s529330911 | 591 | 319 | 21,424 | 4,276 | Accepted | Accepted | 46.02 | from math import sqrt
from itertools import product
import numpy as np
def judge(D):
n = 1
while D%4==0:
n *= 2
D //= 4
def h1(x,y):
return ~(x//n+y//n)%2
def h2(x,y):
return ~(x//n)%2
return h1 if D%2==1 else h2
N,D1,D2 = list(map(int,input().split()))
j1,j2 = judge(D1... | def judge(D):
n = 0
while D%4==0:
n += 1
D //= 4
def h1(x,y):
return ~((x>>n)^(y>>n))&1
def h2(x,y):
return ~(x>>n)&1
return h1 if D%2==1 else h2
N,D1,D2 = list(map(int,input().split()))
j1,j2 = judge(D1),judge(D2)
cnt = 0
for x in range(N*2):
for y in range(N*2):
... | 27 | 24 | 467 | 409 | from math import sqrt
from itertools import product
import numpy as np
def judge(D):
n = 1
while D % 4 == 0:
n *= 2
D //= 4
def h1(x, y):
return ~(x // n + y // n) % 2
def h2(x, y):
return ~(x // n) % 2
return h1 if D % 2 == 1 else h2
N, D1, D2 = list(map(int, ... | def judge(D):
n = 0
while D % 4 == 0:
n += 1
D //= 4
def h1(x, y):
return ~((x >> n) ^ (y >> n)) & 1
def h2(x, y):
return ~(x >> n) & 1
return h1 if D % 2 == 1 else h2
N, D1, D2 = list(map(int, input().split()))
j1, j2 = judge(D1), judge(D2)
cnt = 0
for x in rang... | false | 11.111111 | [
"-from math import sqrt",
"-from itertools import product",
"-import numpy as np",
"-",
"-",
"- n = 1",
"+ n = 0",
"- n *= 2",
"+ n += 1",
"- return ~(x // n + y // n) % 2",
"+ return ~((x >> n) ^ (y >> n)) & 1",
"- return ~(x // n) % 2",
"+ re... | false | 0.03839 | 0.071002 | 0.540692 | [
"s723521343",
"s529330911"
] |
u505420467 | p03160 | python | s909015322 | s559638164 | 139 | 127 | 13,980 | 13,980 | Accepted | Accepted | 8.63 | n=int(eval(input()))
h=list(map(int,input().split()))
dp=[0]*n
dp[1]=abs(h[0]-h[1])
for i in range(2,n):
dp[i]=min(dp[i-2]+abs(h[i]-h[i-2]),dp[i-1]+abs(h[i]-h[i-1]))
print((dp[n-1]))
| n = int(eval(input()))
h = list(map(int, input().split()))
dp= [10 ** 9 + 7] * (n + 10)
dp[0] = 0
dp[1] = abs(h[1] - h[0])
for i in range(2, n):
dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))
print((dp[n - 1]))
| 7 | 12 | 185 | 255 | n = int(eval(input()))
h = list(map(int, input().split()))
dp = [0] * n
dp[1] = abs(h[0] - h[1])
for i in range(2, n):
dp[i] = min(dp[i - 2] + abs(h[i] - h[i - 2]), dp[i - 1] + abs(h[i] - h[i - 1]))
print((dp[n - 1]))
| n = int(eval(input()))
h = list(map(int, input().split()))
dp = [10**9 + 7] * (n + 10)
dp[0] = 0
dp[1] = abs(h[1] - h[0])
for i in range(2, n):
dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))
print((dp[n - 1]))
| false | 41.666667 | [
"-dp = [0] * n",
"-dp[1] = abs(h[0] - h[1])",
"+dp = [10**9 + 7] * (n + 10)",
"+dp[0] = 0",
"+dp[1] = abs(h[1] - h[0])",
"- dp[i] = min(dp[i - 2] + abs(h[i] - h[i - 2]), dp[i - 1] + abs(h[i] - h[i - 1]))",
"+ dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))"
] | false | 0.037571 | 0.042929 | 0.875189 | [
"s909015322",
"s559638164"
] |
u072053884 | p02235 | python | s357999282 | s973299669 | 4,430 | 2,480 | 7,772 | 7,752 | Accepted | Accepted | 44.02 | def lcs_len(x, y):
ly = len(y)
tcsl = [0] * (ly + 1)
for x_i in x:
pre_tcsl = list(tcsl)
for j in range(ly):
if x_i == y[j]:
tcsl[j] = pre_tcsl[j - 1] + 1
elif tcsl[j] < tcsl[j - 1]:
tcsl[j] = tcsl[j - 1]
print((tcsl[j]))
... | def lcs_len(x, y):
indices = [0]
for y_i in y:
t_index = 0
for i, index in enumerate(indices, 1):
c_index = x.find(y_i, t_index) + 1
if c_index:
if i < len(indices):
t_index = indices[i]
indices[i] = min(c_i... | 19 | 22 | 418 | 559 | def lcs_len(x, y):
ly = len(y)
tcsl = [0] * (ly + 1)
for x_i in x:
pre_tcsl = list(tcsl)
for j in range(ly):
if x_i == y[j]:
tcsl[j] = pre_tcsl[j - 1] + 1
elif tcsl[j] < tcsl[j - 1]:
tcsl[j] = tcsl[j - 1]
print((tcsl[j]))
q = int(... | def lcs_len(x, y):
indices = [0]
for y_i in y:
t_index = 0
for i, index in enumerate(indices, 1):
c_index = x.find(y_i, t_index) + 1
if c_index:
if i < len(indices):
t_index = indices[i]
indices[i] = min(c_index, t_i... | false | 13.636364 | [
"- ly = len(y)",
"- tcsl = [0] * (ly + 1)",
"- for x_i in x:",
"- pre_tcsl = list(tcsl)",
"- for j in range(ly):",
"- if x_i == y[j]:",
"- tcsl[j] = pre_tcsl[j - 1] + 1",
"- elif tcsl[j] < tcsl[j - 1]:",
"- tcsl[j] = tcsl[j -... | false | 0.092278 | 0.044138 | 2.090685 | [
"s357999282",
"s973299669"
] |
u708255304 | p03078 | python | s827122509 | s815168488 | 1,009 | 38 | 148,864 | 4,340 | Accepted | Accepted | 96.23 | X, Y, Z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
a_b = []
for i in range(X):
for j in range(Y):
a_b.append(A[i]+B[j])
a_b = sorted(a_b, reverse=True)
ans = []
for k in range(min(K, len(a_b))):... | # 優先度付き待ち行列で解く
import heapq
X, Y, Z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A = sorted(A, reverse=True)
B = sorted(B, reverse=True)
C = sorted(C, reverse=True)
A.append(-10**20)
B.append(-10**20)
C.appe... | 17 | 27 | 457 | 813 | X, Y, Z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
a_b = []
for i in range(X):
for j in range(Y):
a_b.append(A[i] + B[j])
a_b = sorted(a_b, reverse=True)
ans = []
for k in range(min(K, len(a_b))):
for l... | # 優先度付き待ち行列で解く
import heapq
X, Y, Z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A = sorted(A, reverse=True)
B = sorted(B, reverse=True)
C = sorted(C, reverse=True)
A.append(-(10**20))
B.append(-(10**20))
C.append(-(10*... | false | 37.037037 | [
"+# 優先度付き待ち行列で解く",
"+import heapq",
"+",
"-a_b = []",
"-for i in range(X):",
"- for j in range(Y):",
"- a_b.append(A[i] + B[j])",
"-a_b = sorted(a_b, reverse=True)",
"-ans = []",
"-for k in range(min(K, len(a_b))):",
"- for l in range(min(K, len(C))):",
"- ans.append(a_b[k]... | false | 0.113469 | 0.037173 | 3.052471 | [
"s827122509",
"s815168488"
] |
u761320129 | p03593 | python | s574105566 | s422950993 | 232 | 24 | 3,444 | 3,380 | Accepted | Accepted | 89.66 | from collections import Counter
H,W = list(map(int,input().split()))
src = [eval(input()) for i in range(H)]
counter = Counter()
for row in src:
counter.update(row)
def solve():
if H%2 == 0 and W%2 == 0:
for n in list(counter.values()):
if n%4 != 0: return False
return Tr... | H,W = list(map(int,input().split()))
A = [eval(input()) for i in range(H)]
from collections import Counter
ctr = Counter()
for row in A:
ctr.update(row)
if H%2==0 and W%2==0:
print(('Yes' if all(v%4==0 for v in list(ctr.values())) else 'No'))
elif H%2 and W%2:
odd = 0
for k,v in list(ctr.ite... | 34 | 32 | 963 | 783 | from collections import Counter
H, W = list(map(int, input().split()))
src = [eval(input()) for i in range(H)]
counter = Counter()
for row in src:
counter.update(row)
def solve():
if H % 2 == 0 and W % 2 == 0:
for n in list(counter.values()):
if n % 4 != 0:
return False
... | H, W = list(map(int, input().split()))
A = [eval(input()) for i in range(H)]
from collections import Counter
ctr = Counter()
for row in A:
ctr.update(row)
if H % 2 == 0 and W % 2 == 0:
print(("Yes" if all(v % 4 == 0 for v in list(ctr.values())) else "No"))
elif H % 2 and W % 2:
odd = 0
for k, v in list... | false | 5.882353 | [
"+H, W = list(map(int, input().split()))",
"+A = [eval(input()) for i in range(H)]",
"-H, W = list(map(int, input().split()))",
"-src = [eval(input()) for i in range(H)]",
"-counter = Counter()",
"-for row in src:",
"- counter.update(row)",
"-",
"-",
"-def solve():",
"- if H % 2 == 0 and W... | false | 0.122942 | 0.039856 | 3.084652 | [
"s574105566",
"s422950993"
] |
u745087332 | p03128 | python | s158402316 | s959906452 | 652 | 134 | 15,092 | 14,692 | Accepted | Accepted | 79.45 | # coding:utf-8
import sys
import math
INF = float('inf')
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): ... | # coding:utf-8
import sys
INF = float('inf')
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return eval(i... | 41 | 30 | 952 | 662 | # coding:utf-8
import sys
import math
INF = float("inf")
MOD = 10**9 + 7
def LI():
return [int(x) for x in sys.stdin.readline().split()]
def LI_():
return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS():
return sys.stdin.readline().split()
def II():
return int(sys.stdin.readline())
... | # coding:utf-8
import sys
INF = float("inf")
MOD = 10**9 + 7
def LI():
return [int(x) for x in sys.stdin.readline().split()]
def LI_():
return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS():
return sys.stdin.readline().split()
def II():
return int(sys.stdin.readline())
def SI():
... | false | 26.829268 | [
"-import math",
"- A.sort()",
"- A.reverse()",
"- match = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]",
"- # dp[i]: ちょうどマッチをi本使ったときに作れる整数の最大の桁数(-1: 作れない)",
"- dp = [-1] * (n + 1)",
"+ match = [6, 2, 5, 5, 4, 5, 6, 3, 7, 6]",
"+ # dp[i]: ちょうどマッチをi本使ったときに作れる整数の最大の値",
"+ dp = [-INF] * (n + 1... | false | 0.078508 | 0.036043 | 2.178161 | [
"s158402316",
"s959906452"
] |
u987164499 | p03371 | python | s442207093 | s856863761 | 152 | 18 | 12,508 | 3,064 | Accepted | Accepted | 88.16 | from sys import stdin
import numpy as np
a,b,c,x,y= [int(x) for x in stdin.readline().rstrip().split()]
if x >= y:
print((min(a*x+b*y,c*2*y+a*(x-y),c*2*x)))
else:
print((min(a*x+b*y,c*2*x+b*(y-x),c*2*y))) | from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)
a,b,c,x,y = list(map(int,stdin.readline().rstrip().split()))
mi = 10**10
mi = min(mi,max(x,y)*2*c)
mi = min(mi,a*x+b*y)
if x >= y:
mi = min(mi,y*2*c+(x-y)*a)
else:
mi = min(mi,x*2*c+(y-x)*b)
print(mi) | 8 | 16 | 216 | 304 | from sys import stdin
import numpy as np
a, b, c, x, y = [int(x) for x in stdin.readline().rstrip().split()]
if x >= y:
print((min(a * x + b * y, c * 2 * y + a * (x - y), c * 2 * x)))
else:
print((min(a * x + b * y, c * 2 * x + b * (y - x), c * 2 * y)))
| from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10**7)
a, b, c, x, y = list(map(int, stdin.readline().rstrip().split()))
mi = 10**10
mi = min(mi, max(x, y) * 2 * c)
mi = min(mi, a * x + b * y)
if x >= y:
mi = min(mi, y * 2 * c + (x - y) * a)
else:
mi = min(mi, x * 2 * c + (y - x) * b)... | false | 50 | [
"-import numpy as np",
"+from sys import setrecursionlimit",
"-a, b, c, x, y = [int(x) for x in stdin.readline().rstrip().split()]",
"+setrecursionlimit(10**7)",
"+a, b, c, x, y = list(map(int, stdin.readline().rstrip().split()))",
"+mi = 10**10",
"+mi = min(mi, max(x, y) * 2 * c)",
"+mi = min(mi, a *... | false | 0.046203 | 0.08715 | 0.530154 | [
"s442207093",
"s856863761"
] |
u044459372 | p02881 | python | s737144183 | s689241217 | 195 | 139 | 2,940 | 3,060 | Accepted | Accepted | 28.72 | n = int(eval(input()))
i = int(n**(1/2))
while n%i:
i-=1
j = n//i
ans = (i - 1) + (j - 1)
#print(i,j)
print(ans) | n = int(eval(input()))
for i in range(1,int(n**(1/2)+1))[::-1]:
if not n%i:
j = n//i
print((i-1+j-1))
break
| 8 | 6 | 114 | 134 | n = int(eval(input()))
i = int(n ** (1 / 2))
while n % i:
i -= 1
j = n // i
ans = (i - 1) + (j - 1)
# print(i,j)
print(ans)
| n = int(eval(input()))
for i in range(1, int(n ** (1 / 2) + 1))[::-1]:
if not n % i:
j = n // i
print((i - 1 + j - 1))
break
| false | 25 | [
"-i = int(n ** (1 / 2))",
"-while n % i:",
"- i -= 1",
"-j = n // i",
"-ans = (i - 1) + (j - 1)",
"-# print(i,j)",
"-print(ans)",
"+for i in range(1, int(n ** (1 / 2) + 1))[::-1]:",
"+ if not n % i:",
"+ j = n // i",
"+ print((i - 1 + j - 1))",
"+ break"
] | false | 0.066076 | 0.124946 | 0.528839 | [
"s737144183",
"s689241217"
] |
u359358631 | p02899 | python | s425758704 | s507845911 | 273 | 127 | 99,140 | 86,112 | Accepted | Accepted | 53.48 | def main():
n = int(input())
a_list = list(map(int, input().split()))
lst = [[i, x] for i, x in enumerate(a_list)]
lst.sort(key = lambda x: x[1])
for i in lst:
print(i[0] + 1, end=" ")
if __name__ == "__main__":
main()
| def main():
n = int(input())
a_list = list(map(int, input().split()))
ans_list = [0] * n
for i in range(n):
ans_list[a_list[i] - 1] = i + 1
for ans in ans_list:
print(ans, end=" ")
if __name__ == "__main__":
main()
| 11 | 14 | 263 | 272 | def main():
n = int(input())
a_list = list(map(int, input().split()))
lst = [[i, x] for i, x in enumerate(a_list)]
lst.sort(key=lambda x: x[1])
for i in lst:
print(i[0] + 1, end=" ")
if __name__ == "__main__":
main()
| def main():
n = int(input())
a_list = list(map(int, input().split()))
ans_list = [0] * n
for i in range(n):
ans_list[a_list[i] - 1] = i + 1
for ans in ans_list:
print(ans, end=" ")
if __name__ == "__main__":
main()
| false | 21.428571 | [
"- lst = [[i, x] for i, x in enumerate(a_list)]",
"- lst.sort(key=lambda x: x[1])",
"- for i in lst:",
"- print(i[0] + 1, end=\" \")",
"+ ans_list = [0] * n",
"+ for i in range(n):",
"+ ans_list[a_list[i] - 1] = i + 1",
"+ for ans in ans_list:",
"+ print(ans, e... | false | 0.066599 | 0.067569 | 0.985644 | [
"s425758704",
"s507845911"
] |
u132350318 | p03413 | python | s164334701 | s842575857 | 331 | 151 | 20,992 | 14,472 | Accepted | Accepted | 54.38 | import numpy as np
def main():
n = int(input())
a = [int(x) for x in input().split()]
best, solution = int(-1e10), []
for p in range(2):
c = a.copy()
indexes = list(range(p, n, 2))
if len(indexes) == 0:
continue
maks = max([c[i] for i in in... | import numpy as np
def main():
n = int(input())
a = [int(x) for x in input().split()]
sol_tot, sol_tracker = int(-1e10), []
for p in range(2):
c = a.copy()
idx = list(range(p, n, 2))
if not idx:
continue
pick = max(idx, key=lambda i: c[i])
... | 43 | 48 | 1,269 | 1,316 | import numpy as np
def main():
n = int(input())
a = [int(x) for x in input().split()]
best, solution = int(-1e10), []
for p in range(2):
c = a.copy()
indexes = list(range(p, n, 2))
if len(indexes) == 0:
continue
maks = max([c[i] for i in indexes])
pi... | import numpy as np
def main():
n = int(input())
a = [int(x) for x in input().split()]
sol_tot, sol_tracker = int(-1e10), []
for p in range(2):
c = a.copy()
idx = list(range(p, n, 2))
if not idx:
continue
pick = max(idx, key=lambda i: c[i])
if c[pick]... | false | 10.416667 | [
"- best, solution = int(-1e10), []",
"+ sol_tot, sol_tracker = int(-1e10), []",
"- indexes = list(range(p, n, 2))",
"- if len(indexes) == 0:",
"+ idx = list(range(p, n, 2))",
"+ if not idx:",
"- maks = max([c[i] for i in indexes])",
"- pick = next(filter... | false | 0.275502 | 0.217555 | 1.266358 | [
"s164334701",
"s842575857"
] |
u759412327 | p02786 | python | s438234472 | s336825866 | 31 | 28 | 9,096 | 9,144 | Accepted | Accepted | 9.68 | from math import *
H = int(eval(input()))
print((2**(int(log2(H))+1)-1)) | print((2**int(eval(input())).bit_length()-1)) | 3 | 1 | 66 | 37 | from math import *
H = int(eval(input()))
print((2 ** (int(log2(H)) + 1) - 1))
| print((2 ** int(eval(input())).bit_length() - 1))
| false | 66.666667 | [
"-from math import *",
"-",
"-H = int(eval(input()))",
"-print((2 ** (int(log2(H)) + 1) - 1))",
"+print((2 ** int(eval(input())).bit_length() - 1))"
] | false | 0.043771 | 0.04843 | 0.903792 | [
"s438234472",
"s336825866"
] |
u334712262 | p02559 | python | s512853764 | s044970842 | 1,500 | 892 | 225,708 | 184,928 | Accepted | Accepted | 40.53 | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import combinations, combinations_with... | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import combinations, combinations_with... | 127 | 114 | 2,907 | 2,165 | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import (
combinations,
combinations_wit... | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import (
combinations,
combinations_wit... | false | 10.23622 | [
"-class SegmentTree:",
"- def __init__(self, array, operator, identity_element):",
"- _len = len(array)",
"- self.__op = operator",
"- self.__size = 1 << (_len - 1).bit_length()",
"- self.__tree = (",
"- [identity_element] * self.__size",
"- + array... | false | 0.038366 | 0.039195 | 0.97885 | [
"s512853764",
"s044970842"
] |
u232852711 | p03361 | python | s858230098 | s332754382 | 156 | 23 | 12,408 | 3,064 | Accepted | Accepted | 85.26 | H, W = list(map(int, input().split(' ')))
import numpy as np
import sys
grid = np.zeros((H, W))
for h in range(H):
grid[h,:] = [0 if g == '.' else 1 for g in eval(input())]
# print(grid)
for h in range(H):
for w in range(W):
if grid[h, w] == 0:
continue
around = []
if h > 0:
... | h, w = list(map(int, input().split()))
s = [eval(input()) for _ in range(h)]
adj = [(1, 0), (0, 1), (-1, 0), (0, -1)]
non_adj = 0
for y in range(h):
for x in range(w):
if s[y][x] == '.':
continue
n_adj = 0
for dx, dy in adj:
i, j = y+dy, x+dx
... | 29 | 23 | 627 | 566 | H, W = list(map(int, input().split(" ")))
import numpy as np
import sys
grid = np.zeros((H, W))
for h in range(H):
grid[h, :] = [0 if g == "." else 1 for g in eval(input())]
# print(grid)
for h in range(H):
for w in range(W):
if grid[h, w] == 0:
continue
around = []
if h > 0... | h, w = list(map(int, input().split()))
s = [eval(input()) for _ in range(h)]
adj = [(1, 0), (0, 1), (-1, 0), (0, -1)]
non_adj = 0
for y in range(h):
for x in range(w):
if s[y][x] == ".":
continue
n_adj = 0
for dx, dy in adj:
i, j = y + dy, x + dx
if i < 0 ... | false | 20.689655 | [
"-H, W = list(map(int, input().split(\" \")))",
"-import numpy as np",
"-import sys",
"-",
"-grid = np.zeros((H, W))",
"-for h in range(H):",
"- grid[h, :] = [0 if g == \".\" else 1 for g in eval(input())]",
"-# print(grid)",
"-for h in range(H):",
"- for w in range(W):",
"- if grid... | false | 0.207994 | 0.037954 | 5.480185 | [
"s858230098",
"s332754382"
] |
u606174760 | p03700 | python | s168391366 | s971705751 | 1,813 | 1,245 | 10,960 | 10,952 | Accepted | Accepted | 31.33 | # -*- coding:utf-8 -*-
import math
import sys
line = input().split(' ')
N = int(line[0])
A = int(line[1])
B = int(line[2])
hn = sorted([int(eval(input())) for i in range(N)])
maxT = int(hn[-1] / B) + 1
minT = 0
def enough(T):
count = sum([math.ceil((h - B*T) / (A-B)) if math.ceil((h - B*T) / (A-B))... | # -*- coding:utf-8 -*-
import math
N, A, B = list(map(int, input().split(' ')))
hn = sorted([int(eval(input())) for i in range(N)])
maxT = int(hn[-1] / B) + 1
minT = 0
def enough(T):
count = sum([math.ceil((h - B*T) / (A-B)) if (h - B*T) >= 0 else 0 for h in hn])
return True if count <= T else Fal... | 26 | 22 | 558 | 486 | # -*- coding:utf-8 -*-
import math
import sys
line = input().split(" ")
N = int(line[0])
A = int(line[1])
B = int(line[2])
hn = sorted([int(eval(input())) for i in range(N)])
maxT = int(hn[-1] / B) + 1
minT = 0
def enough(T):
count = sum(
[
math.ceil((h - B * T) / (A - B))
if math... | # -*- coding:utf-8 -*-
import math
N, A, B = list(map(int, input().split(" ")))
hn = sorted([int(eval(input())) for i in range(N)])
maxT = int(hn[-1] / B) + 1
minT = 0
def enough(T):
count = sum(
[math.ceil((h - B * T) / (A - B)) if (h - B * T) >= 0 else 0 for h in hn]
)
return True if count <= T... | false | 15.384615 | [
"-import sys",
"-line = input().split(\" \")",
"-N = int(line[0])",
"-A = int(line[1])",
"-B = int(line[2])",
"+N, A, B = list(map(int, input().split(\" \")))",
"- [",
"- math.ceil((h - B * T) / (A - B))",
"- if math.ceil((h - B * T) / (A - B)) >= 0",
"- els... | false | 0.101041 | 0.046912 | 2.153838 | [
"s168391366",
"s971705751"
] |
u716530146 | p02981 | python | s832139951 | s923823073 | 170 | 21 | 38,256 | 3,316 | Accepted | Accepted | 87.65 | #!/usr/bin/env python3
import sys, math
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans=count=0
n,a,b=list(map(int,input().split()))
print((min(b,a*n))) | #!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0
n,a,b=list(map(int,input().split()))
print((min(n*a,b))) | 10 | 9 | 228 | 269 | #!/usr/bin/env python3
import sys, math
input = lambda: sys.stdin.buffer.readline().rstrip().decode("utf-8")
sys.setrecursionlimit(10**8)
inf = float("inf")
ans = count = 0
n, a, b = list(map(int, input().split()))
print((min(b, a * n)))
| #!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode("utf-8")
sys.setrecursionlimit(10**8)
inf = float("inf")
ans = count = 0
n, a, b = list(map(int, input().split()))
print((min(n * a, b)))
| false | 10 | [
"-import sys, math",
"+import sys, math, itertools, heapq, collections, bisect",
"-print((min(b, a * n)))",
"+print((min(n * a, b)))"
] | false | 0.044004 | 0.038032 | 1.157017 | [
"s832139951",
"s923823073"
] |
u903005414 | p02683 | python | s716558180 | s458393165 | 157 | 95 | 27,128 | 9,132 | Accepted | Accepted | 39.49 | import numpy as np
N, M, X = list(map(int, input().split()))
C = []
A = []
for _ in range(N):
tmp = list(map(int, input().split()))
c = tmp[0]
a = tmp[1:]
C.append(c)
A.append(a)
A = np.array(A)
ans = 10**18
for bit in range(1 << N):
cost = 0
V = np.array([0] * M)
for ... | import itertools as it
N, M, X = list(map(int, input().split()))
book = [[int(_) for _ in input().split()] for i in range(N)]
# print(f'book={book}')
combs = it.product([0, 1], repeat=N)
prices = []
for comb in combs:
# print(comb)
bag = [0] * (M + 1)
for i in range(N):
if comb[i] == 0:
... | 27 | 24 | 515 | 604 | import numpy as np
N, M, X = list(map(int, input().split()))
C = []
A = []
for _ in range(N):
tmp = list(map(int, input().split()))
c = tmp[0]
a = tmp[1:]
C.append(c)
A.append(a)
A = np.array(A)
ans = 10**18
for bit in range(1 << N):
cost = 0
V = np.array([0] * M)
for i in range(N):
... | import itertools as it
N, M, X = list(map(int, input().split()))
book = [[int(_) for _ in input().split()] for i in range(N)]
# print(f'book={book}')
combs = it.product([0, 1], repeat=N)
prices = []
for comb in combs:
# print(comb)
bag = [0] * (M + 1)
for i in range(N):
if comb[i] == 0:
... | false | 11.111111 | [
"-import numpy as np",
"+import itertools as it",
"-C = []",
"-A = []",
"-for _ in range(N):",
"- tmp = list(map(int, input().split()))",
"- c = tmp[0]",
"- a = tmp[1:]",
"- C.append(c)",
"- A.append(a)",
"-A = np.array(A)",
"-ans = 10**18",
"-for bit in range(1 << N):",
"- ... | false | 0.286424 | 0.19814 | 1.445568 | [
"s716558180",
"s458393165"
] |
u840310460 | p03469 | python | s282347734 | s939591517 | 168 | 18 | 38,256 | 2,940 | Accepted | Accepted | 89.29 | S = [i for i in input().split("/")]
if S[0] == "2017":
print(("2018/"+S[1]+"/"+S[2])) | S = eval(input())
print((S.replace("2017", "2018"))) | 3 | 2 | 89 | 45 | S = [i for i in input().split("/")]
if S[0] == "2017":
print(("2018/" + S[1] + "/" + S[2]))
| S = eval(input())
print((S.replace("2017", "2018")))
| false | 33.333333 | [
"-S = [i for i in input().split(\"/\")]",
"-if S[0] == \"2017\":",
"- print((\"2018/\" + S[1] + \"/\" + S[2]))",
"+S = eval(input())",
"+print((S.replace(\"2017\", \"2018\")))"
] | false | 0.046949 | 0.067899 | 0.69146 | [
"s282347734",
"s939591517"
] |
u634461820 | p03013 | python | s005929402 | s600359845 | 675 | 254 | 471,684 | 17,144 | Accepted | Accepted | 62.37 | import bisect
from operator import itemgetter
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return ... | import bisect
from operator import itemgetter
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return ... | 36 | 36 | 681 | 683 | import bisect
from operator import itemgetter
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL():
return list(map(int, input().split()))
def SL():
return input().split()
def I():
... | import bisect
from operator import itemgetter
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL():
return list(map(int, input().split()))
def SL():
return input().split()
def I():
... | false | 0 | [
"- dp[i + 1] += dp[i]",
"+ dp[i + 1] += dp[i] % mod",
"- dp[i + 2] += dp[i]",
"+ dp[i + 2] += dp[i] % mod"
] | false | 0.046964 | 0.037617 | 1.248493 | [
"s005929402",
"s600359845"
] |
u953237709 | p03062 | python | s100935795 | s837216596 | 164 | 97 | 16,800 | 15,020 | Accepted | Accepted | 40.85 | n = int(eval(input()))
a = list(map(int, input().split()))
def solveDp():
POS, NEG = 0, 1
dp = [[0 for _ in range(n + 1)] for _ in range(2)]
dp[NEG][0] = -float('inf')
for i in range(n):
dp[POS][i + 1] = max(dp[POS][i] + a[i], dp[NEG][i] - a[i])
dp[NEG][i + 1] = max(dp[POS][i] ... | n = int(eval(input()))
a = list(map(int, input().split()))
negCnt = 0
absSum = 0
minAbs = float('inf')
for val in a:
negCnt += val < 0
absVal = abs(val)
absSum += absVal
minAbs = min(minAbs, absVal)
print((absSum - 2 * minAbs if negCnt & 1 else absSum)) | 25 | 12 | 665 | 273 | n = int(eval(input()))
a = list(map(int, input().split()))
def solveDp():
POS, NEG = 0, 1
dp = [[0 for _ in range(n + 1)] for _ in range(2)]
dp[NEG][0] = -float("inf")
for i in range(n):
dp[POS][i + 1] = max(dp[POS][i] + a[i], dp[NEG][i] - a[i])
dp[NEG][i + 1] = max(dp[POS][i] - a[i], ... | n = int(eval(input()))
a = list(map(int, input().split()))
negCnt = 0
absSum = 0
minAbs = float("inf")
for val in a:
negCnt += val < 0
absVal = abs(val)
absSum += absVal
minAbs = min(minAbs, absVal)
print((absSum - 2 * minAbs if negCnt & 1 else absSum))
| false | 52 | [
"-",
"-",
"-def solveDp():",
"- POS, NEG = 0, 1",
"- dp = [[0 for _ in range(n + 1)] for _ in range(2)]",
"- dp[NEG][0] = -float(\"inf\")",
"- for i in range(n):",
"- dp[POS][i + 1] = max(dp[POS][i] + a[i], dp[NEG][i] - a[i])",
"- dp[NEG][i + 1] = max(dp[POS][i] - a[i], dp[... | false | 0.047457 | 0.046583 | 1.018753 | [
"s100935795",
"s837216596"
] |
u282228874 | p04045 | python | s736814111 | s937489161 | 103 | 84 | 2,940 | 2,940 | Accepted | Accepted | 18.45 | n,k = list(map(int,input().split()))
D = list(input().split())
while True:
if any (d in str(n) for d in D):
n += 1
else:
print(n)
exit()
| n,k = list(map(int,input().split()))
d = set(eval(input()))
while len(set(str(n))&d):
n += 1
print(n) | 8 | 5 | 146 | 94 | n, k = list(map(int, input().split()))
D = list(input().split())
while True:
if any(d in str(n) for d in D):
n += 1
else:
print(n)
exit()
| n, k = list(map(int, input().split()))
d = set(eval(input()))
while len(set(str(n)) & d):
n += 1
print(n)
| false | 37.5 | [
"-D = list(input().split())",
"-while True:",
"- if any(d in str(n) for d in D):",
"- n += 1",
"- else:",
"- print(n)",
"- exit()",
"+d = set(eval(input()))",
"+while len(set(str(n)) & d):",
"+ n += 1",
"+print(n)"
] | false | 0.080722 | 0.049359 | 1.635416 | [
"s736814111",
"s937489161"
] |
u141610915 | p03949 | python | s052196084 | s831652621 | 829 | 326 | 98,652 | 146,616 | Accepted | Accepted | 60.68 | import sys
from collections import defaultdict as dd
from collections import deque as dq
import heapq
hpush = heapq.heappush
hpop = heapq.heappop
input = sys.stdin.readline
N = int(eval(input()))
e = dd(list)
for _ in range(N - 1):
u, v = list(map(int, input().split()))
e[u].append(v)
e[v].append(u)
... | import sys
input = sys.stdin.readline
N = int(eval(input()))
e = [[] for _ in range(N + 1)]
for _ in range(N - 1):
u, v = list(map(int, input().split()))
e[u].append(v)
e[v].append(u)
s = [1]
color = [0] * (N + 1)
color[1] = 1
while len(s):
x = s.pop()
for y in e[x]:
if color[y]:
if... | 59 | 51 | 1,141 | 1,059 | import sys
from collections import defaultdict as dd
from collections import deque as dq
import heapq
hpush = heapq.heappush
hpop = heapq.heappop
input = sys.stdin.readline
N = int(eval(input()))
e = dd(list)
for _ in range(N - 1):
u, v = list(map(int, input().split()))
e[u].append(v)
e[v].append(u)
K = in... | import sys
input = sys.stdin.readline
N = int(eval(input()))
e = [[] for _ in range(N + 1)]
for _ in range(N - 1):
u, v = list(map(int, input().split()))
e[u].append(v)
e[v].append(u)
s = [1]
color = [0] * (N + 1)
color[1] = 1
while len(s):
x = s.pop()
for y in e[x]:
if color[y]:
... | false | 13.559322 | [
"-from collections import defaultdict as dd",
"-from collections import deque as dq",
"-import heapq",
"-hpush = heapq.heappush",
"-hpop = heapq.heappop",
"-e = dd(list)",
"+e = [[] for _ in range(N + 1)]",
"-K = int(eval(input()))",
"-ls = [-(10**10)] * (N + 1)",
"-rs = [10**10] * (N + 1)",
"-Q... | false | 0.03684 | 0.034904 | 1.055458 | [
"s052196084",
"s831652621"
] |
u547085427 | p03311 | python | s804655068 | s311523371 | 229 | 201 | 25,196 | 26,708 | Accepted | Accepted | 12.23 | N = int(eval(input()))
A = list(map(int,input().split()))
for i in range(N):
A[i] -= i
A.sort()
Ans = 0
mi = len(A)//2 # 中央値のindex
for i in range(N):
Ans += abs(A[i]-A[mi])
print(Ans) | n = int(eval(input()))
a = list(map(int, input().split()))
b = [(a[i] - i) for i in range(n)]
b.sort()
num = b[ n // 2]
result = 0
for i in b:
result += abs(num - i)
print(result) | 14 | 12 | 206 | 194 | N = int(eval(input()))
A = list(map(int, input().split()))
for i in range(N):
A[i] -= i
A.sort()
Ans = 0
mi = len(A) // 2 # 中央値のindex
for i in range(N):
Ans += abs(A[i] - A[mi])
print(Ans)
| n = int(eval(input()))
a = list(map(int, input().split()))
b = [(a[i] - i) for i in range(n)]
b.sort()
num = b[n // 2]
result = 0
for i in b:
result += abs(num - i)
print(result)
| false | 14.285714 | [
"-N = int(eval(input()))",
"-A = list(map(int, input().split()))",
"-for i in range(N):",
"- A[i] -= i",
"-A.sort()",
"-Ans = 0",
"-mi = len(A) // 2 # 中央値のindex",
"-for i in range(N):",
"- Ans += abs(A[i] - A[mi])",
"-print(Ans)",
"+n = int(eval(input()))",
"+a = list(map(int, input().s... | false | 0.077752 | 0.044609 | 1.742981 | [
"s804655068",
"s311523371"
] |
u803617136 | p02981 | python | s560363729 | s903938617 | 174 | 19 | 38,256 | 2,940 | Accepted | Accepted | 89.08 | N, A, B = list(map(int, input().split()))
print((min(N * A, B))) | n, a, b = list(map(int, input().split()))
ans = min(n * a, b)
print(ans) | 2 | 3 | 57 | 68 | N, A, B = list(map(int, input().split()))
print((min(N * A, B)))
| n, a, b = list(map(int, input().split()))
ans = min(n * a, b)
print(ans)
| false | 33.333333 | [
"-N, A, B = list(map(int, input().split()))",
"-print((min(N * A, B)))",
"+n, a, b = list(map(int, input().split()))",
"+ans = min(n * a, b)",
"+print(ans)"
] | false | 0.0413 | 0.036438 | 1.133425 | [
"s560363729",
"s903938617"
] |
u832039789 | p02577 | python | s228425459 | s286761763 | 197 | 174 | 68,852 | 78,016 | Accepted | Accepted | 11.68 | print(('YNeos'[int(eval(input()))%9>0::2])) | print("YNeos"[eval(input())%9>0::2]) | 1 | 1 | 35 | 28 | print(("YNeos"[int(eval(input())) % 9 > 0 :: 2]))
| print("YNeos"[eval(input()) % 9 > 0 :: 2])
| false | 0 | [
"-print((\"YNeos\"[int(eval(input())) % 9 > 0 :: 2]))",
"+print(\"YNeos\"[eval(input()) % 9 > 0 :: 2])"
] | false | 0.036326 | 0.053802 | 0.675184 | [
"s228425459",
"s286761763"
] |
u477977638 | p02936 | python | s644931429 | s118971745 | 1,999 | 1,688 | 90,116 | 64,128 | Accepted | Accepted | 15.56 | import collections
n,q=list(map(int,input().split()))
a=sorted(list(list(map(int,input().split())) for i in range(n-1)))
p=collections.defaultdict(int)
for i in range(q):
k,v=list(map(int,input().split()))
p[k]+=v
li=[0]*n
li[0]+=p[1]
for i in range(n-1):
li[a[i][1]-1]+=li[a[i][0]-1]+p[a[i][1]]
pri... | from collections import deque
n,q=list(map(int,input().split()))
li=[[] for i in range(n+1)]
ans=[0]*(n+1)
for i in range(n-1):
a,b=list(map(int,input().split()))
li[a].append(b)
li[b].append(a)
for i in range(q):
p,x=list(map(int,input().split()))
ans[p]+=x
Q=deque([1])
sumi=set([1])
... | 14 | 30 | 315 | 486 | import collections
n, q = list(map(int, input().split()))
a = sorted(list(list(map(int, input().split())) for i in range(n - 1)))
p = collections.defaultdict(int)
for i in range(q):
k, v = list(map(int, input().split()))
p[k] += v
li = [0] * n
li[0] += p[1]
for i in range(n - 1):
li[a[i][1] - 1] += li[a[i]... | from collections import deque
n, q = list(map(int, input().split()))
li = [[] for i in range(n + 1)]
ans = [0] * (n + 1)
for i in range(n - 1):
a, b = list(map(int, input().split()))
li[a].append(b)
li[b].append(a)
for i in range(q):
p, x = list(map(int, input().split()))
ans[p] += x
Q = deque([1])... | false | 53.333333 | [
"-import collections",
"+from collections import deque",
"-a = sorted(list(list(map(int, input().split())) for i in range(n - 1)))",
"-p = collections.defaultdict(int)",
"+li = [[] for i in range(n + 1)]",
"+ans = [0] * (n + 1)",
"+for i in range(n - 1):",
"+ a, b = list(map(int, input().split()))"... | false | 0.088794 | 0.047476 | 1.870309 | [
"s644931429",
"s118971745"
] |
u254871849 | p03611 | python | s761108469 | s935743300 | 150 | 106 | 18,352 | 19,056 | Accepted | Accepted | 29.33 | import sys
from collections import defaultdict
cnt = defaultdict(int)
def main():
n, *a = list(map(int, sys.stdin.read().split()))
a.sort()
l = a[0]
r = a[-1]
for val in a:
cnt[val] += 1
ans = 0
for i in range(l, r+1):
ans = max(ans, cnt[i-1] + cnt[i] ... | import sys
from collections import defaultdict
n, *a = list(map(int, sys.stdin.read().split()))
def main():
res = defaultdict(int)
for i in a:
res[i-1] += 1
res[i] += 1
res[i+1] += 1
return max(res.values())
if __name__ == '__main__':
ans = main()
pri... | 22 | 17 | 385 | 321 | import sys
from collections import defaultdict
cnt = defaultdict(int)
def main():
n, *a = list(map(int, sys.stdin.read().split()))
a.sort()
l = a[0]
r = a[-1]
for val in a:
cnt[val] += 1
ans = 0
for i in range(l, r + 1):
ans = max(ans, cnt[i - 1] + cnt[i] + cnt[i + 1])
... | import sys
from collections import defaultdict
n, *a = list(map(int, sys.stdin.read().split()))
def main():
res = defaultdict(int)
for i in a:
res[i - 1] += 1
res[i] += 1
res[i + 1] += 1
return max(res.values())
if __name__ == "__main__":
ans = main()
print(ans)
| false | 22.727273 | [
"-cnt = defaultdict(int)",
"+n, *a = list(map(int, sys.stdin.read().split()))",
"- n, *a = list(map(int, sys.stdin.read().split()))",
"- a.sort()",
"- l = a[0]",
"- r = a[-1]",
"- for val in a:",
"- cnt[val] += 1",
"- ans = 0",
"- for i in range(l, r + 1):",
"- ... | false | 0.037571 | 0.07989 | 0.470287 | [
"s761108469",
"s935743300"
] |
u533232830 | p02579 | python | s197310302 | s772878465 | 1,074 | 722 | 210,980 | 128,368 | Accepted | Accepted | 32.77 | from collections import deque
h, w = list(map(int, input().split()))
C = list(map(int, input().split()))
C = tuple([C[0]-1, C[1]-1])
D = tuple(map(int, input().split()))
D = tuple([D[0]-1, D[1]-1])
maze = [list(eval(input())) for _ in range(h)]
visit = [[False]*w for _ in range(h)]
for i in range(h):
f... | from collections import deque
H, W = list(map(int, input().split()))
Ch, Cw = list(map(int, input().split()))
Dh, Dw = list(map(int, input().split()))
Ch, Cw, Dh, Dw = Ch-1, Cw-1, Dh-1, Dw-1
maze = [list(eval(input())) for _ in range(H)]
visit = [[-1] * W for _ in range(H)]
visit[Ch][Cw] = 0
DQ = deque([(... | 53 | 44 | 1,317 | 1,137 | from collections import deque
h, w = list(map(int, input().split()))
C = list(map(int, input().split()))
C = tuple([C[0] - 1, C[1] - 1])
D = tuple(map(int, input().split()))
D = tuple([D[0] - 1, D[1] - 1])
maze = [list(eval(input())) for _ in range(h)]
visit = [[False] * w for _ in range(h)]
for i in range(h):
for... | from collections import deque
H, W = list(map(int, input().split()))
Ch, Cw = list(map(int, input().split()))
Dh, Dw = list(map(int, input().split()))
Ch, Cw, Dh, Dw = Ch - 1, Cw - 1, Dh - 1, Dw - 1
maze = [list(eval(input())) for _ in range(H)]
visit = [[-1] * W for _ in range(H)]
visit[Ch][Cw] = 0
DQ = deque([(Ch, C... | false | 16.981132 | [
"-h, w = list(map(int, input().split()))",
"-C = list(map(int, input().split()))",
"-C = tuple([C[0] - 1, C[1] - 1])",
"-D = tuple(map(int, input().split()))",
"-D = tuple([D[0] - 1, D[1] - 1])",
"-maze = [list(eval(input())) for _ in range(h)]",
"-visit = [[False] * w for _ in range(h)]",
"-for i in ... | false | 0.082049 | 0.038378 | 2.137938 | [
"s197310302",
"s772878465"
] |
u672898046 | p03610 | python | s922155107 | s685138242 | 85 | 17 | 4,596 | 3,188 | Accepted | Accepted | 80 | s = input()
for i, r in enumerate(s):
if i%2==0:
print(r, end="")
| s = eval(input())
print((s[::2])) | 4 | 2 | 74 | 26 | s = input()
for i, r in enumerate(s):
if i % 2 == 0:
print(r, end="")
| s = eval(input())
print((s[::2]))
| false | 50 | [
"-s = input()",
"-for i, r in enumerate(s):",
"- if i % 2 == 0:",
"- print(r, end=\"\")",
"+s = eval(input())",
"+print((s[::2]))"
] | false | 0.037878 | 0.03884 | 0.975251 | [
"s922155107",
"s685138242"
] |
u671060652 | p02922 | python | s072430727 | s701347976 | 173 | 63 | 39,824 | 61,840 | Accepted | Accepted | 63.58 | a, b = list(map(int, input().split()))
n = 0
while a*n-(n-1) < b:
n += 1
print(n)
| def main():
# n = int(input())
n, k = list(map(int, input().split()))
# h = list(map(int, input().split()))
# s = input()
ans = 0
while True:
if (n - 1) * ans + 1 >= k:
print(ans)
break
ans += 1
if __name__ == '__main__':
main()
| 7 | 16 | 88 | 309 | a, b = list(map(int, input().split()))
n = 0
while a * n - (n - 1) < b:
n += 1
print(n)
| def main():
# n = int(input())
n, k = list(map(int, input().split()))
# h = list(map(int, input().split()))
# s = input()
ans = 0
while True:
if (n - 1) * ans + 1 >= k:
print(ans)
break
ans += 1
if __name__ == "__main__":
main()
| false | 56.25 | [
"-a, b = list(map(int, input().split()))",
"-n = 0",
"-while a * n - (n - 1) < b:",
"- n += 1",
"-print(n)",
"+def main():",
"+ # n = int(input())",
"+ n, k = list(map(int, input().split()))",
"+ # h = list(map(int, input().split()))",
"+ # s = input()",
"+ ans = 0",
"+ wh... | false | 0.037399 | 0.007548 | 4.954834 | [
"s072430727",
"s701347976"
] |
u254871849 | p03776 | python | s126600602 | s821186120 | 38 | 20 | 5,404 | 3,188 | Accepted | Accepted | 47.37 | from statistics import mean
nCr = {}
def cmb(n, r):
if n < r:
return 0
if r == 0 or r == n: return 1
if r == 1: return n
if (n,r) in nCr: return nCr[(n,r)]
nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
return nCr[(n,r)]
n, a, b = [int(_) for _ in input().split()]
values = [int(... | nCr = {}
def cmb(n, r):
if n < r:
return 0
if r == 0 or r == n: return 1
if r == 1: return n
if (n,r) in nCr: return nCr[(n,r)]
nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
return nCr[(n,r)]
n, a, b = [int(_) for _ in input().split()]
values = [int(v) for v in input().split()]
v... | 30 | 28 | 688 | 660 | from statistics import mean
nCr = {}
def cmb(n, r):
if n < r:
return 0
if r == 0 or r == n:
return 1
if r == 1:
return n
if (n, r) in nCr:
return nCr[(n, r)]
nCr[(n, r)] = cmb(n - 1, r) + cmb(n - 1, r - 1)
return nCr[(n, r)]
n, a, b = [int(_) for _ in input()... | nCr = {}
def cmb(n, r):
if n < r:
return 0
if r == 0 or r == n:
return 1
if r == 1:
return n
if (n, r) in nCr:
return nCr[(n, r)]
nCr[(n, r)] = cmb(n - 1, r) + cmb(n - 1, r - 1)
return nCr[(n, r)]
n, a, b = [int(_) for _ in input().split()]
values = [int(v) fo... | false | 6.666667 | [
"-from statistics import mean",
"-",
"-maximum_mean = mean(values[:a])",
"+maximum_mean = sum(values[:a]) / a"
] | false | 0.122961 | 0.143418 | 0.857361 | [
"s126600602",
"s821186120"
] |
u427344224 | p03127 | python | s630667208 | s105983449 | 100 | 87 | 14,252 | 14,252 | Accepted | Accepted | 13 | N = int(eval(input()))
a_list = list(map(int, input().split()))
import fractions
num = a_list[0]
for i in range(N):
a = a_list[i]
num = fractions.gcd(num, a)
print(num)
| N = int(eval(input()))
a_list = list(map(int, input().split()))
def gcd(a, b):
return a if b == 0 else gcd(b, a % b)
ans = a_list[0]
for i in range(N):
ans = gcd(ans, a_list[i])
print(ans)
| 11 | 13 | 184 | 208 | N = int(eval(input()))
a_list = list(map(int, input().split()))
import fractions
num = a_list[0]
for i in range(N):
a = a_list[i]
num = fractions.gcd(num, a)
print(num)
| N = int(eval(input()))
a_list = list(map(int, input().split()))
def gcd(a, b):
return a if b == 0 else gcd(b, a % b)
ans = a_list[0]
for i in range(N):
ans = gcd(ans, a_list[i])
print(ans)
| false | 15.384615 | [
"-import fractions",
"-num = a_list[0]",
"+",
"+def gcd(a, b):",
"+ return a if b == 0 else gcd(b, a % b)",
"+",
"+",
"+ans = a_list[0]",
"- a = a_list[i]",
"- num = fractions.gcd(num, a)",
"-print(num)",
"+ ans = gcd(ans, a_list[i])",
"+print(ans)"
] | false | 0.117957 | 0.102162 | 1.154606 | [
"s630667208",
"s105983449"
] |
u467736898 | p02868 | python | s918046334 | s853286688 | 1,758 | 1,190 | 112,152 | 77,272 | Accepted | Accepted | 32.31 | # https://atcoder.jp/contests/abc014/submissions/3935971
class SegmentTree(object):
__slots__ = ["elem_size", "tree", "default", "op"]
def __init__(self, a: list, default: int, op):
from math import ceil, log
real_size = len(a)
self.elem_size = elem_size = 1 << ceil(log(real_size, ... | # https://atcoder.jp/contests/nikkei2019-2-qual/submissions/8357999 を
# 平方分割に書き換えた
class Rmq:
# 平方分割
# 値を変更すると元のリストの値も書き換わる
def __init__(self, a, sqrt_n=500):
from itertools import zip_longest
self.n = len(a)
self.sqrt_n = sqrt_n
self.layer1 = a
self.layer... | 60 | 66 | 1,960 | 1,833 | # https://atcoder.jp/contests/abc014/submissions/3935971
class SegmentTree(object):
__slots__ = ["elem_size", "tree", "default", "op"]
def __init__(self, a: list, default: int, op):
from math import ceil, log
real_size = len(a)
self.elem_size = elem_size = 1 << ceil(log(real_size, 2))
... | # https://atcoder.jp/contests/nikkei2019-2-qual/submissions/8357999 を
# 平方分割に書き換えた
class Rmq:
# 平方分割
# 値を変更すると元のリストの値も書き換わる
def __init__(self, a, sqrt_n=500):
from itertools import zip_longest
self.n = len(a)
self.sqrt_n = sqrt_n
self.layer1 = a
self.layer0 = [
... | false | 9.090909 | [
"-# https://atcoder.jp/contests/abc014/submissions/3935971",
"-class SegmentTree(object):",
"- __slots__ = [\"elem_size\", \"tree\", \"default\", \"op\"]",
"+# https://atcoder.jp/contests/nikkei2019-2-qual/submissions/8357999 を",
"+# 平方分割に書き換えた",
"+class Rmq:",
"+ # 平方分割",
"+ # 値を変更すると元のリストの値... | false | 0.045755 | 0.045839 | 0.998175 | [
"s918046334",
"s853286688"
] |
u562935282 | p02852 | python | s137680600 | s176021379 | 249 | 85 | 15,084 | 11,388 | Accepted | Accepted | 65.86 | # https://atcoder.jp/contests/abc146/submissions/8617148
def solve(N, M, S):
from collections import namedtuple
from heapq import heappop, heappush
INF = N * 2
V = namedtuple('V', 'cnt index')
cnt_from_N = [INF] * (N + 1)
cnt_from_N[N] = 0
parent = [0] * (N + 1)
h = [V... | def main():
N, M = list(map(int, input().split()))
*G, = list(map(int, eval(input())))
ans = []
cur = N
ecur = cur - 1
while cur > 0:
ncur = cur
while (cur - ecur) <= M and ecur >= 0:
if G[ecur] == 0:
ncur = ecur
ecur -= 1
... | 58 | 28 | 1,184 | 506 | # https://atcoder.jp/contests/abc146/submissions/8617148
def solve(N, M, S):
from collections import namedtuple
from heapq import heappop, heappush
INF = N * 2
V = namedtuple("V", "cnt index")
cnt_from_N = [INF] * (N + 1)
cnt_from_N[N] = 0
parent = [0] * (N + 1)
h = [V(cnt=0, index=N)]
... | def main():
N, M = list(map(int, input().split()))
(*G,) = list(map(int, eval(input())))
ans = []
cur = N
ecur = cur - 1
while cur > 0:
ncur = cur
while (cur - ecur) <= M and ecur >= 0:
if G[ecur] == 0:
ncur = ecur
ecur -= 1
if ncur... | false | 51.724138 | [
"-# https://atcoder.jp/contests/abc146/submissions/8617148",
"-def solve(N, M, S):",
"- from collections import namedtuple",
"- from heapq import heappop, heappush",
"-",
"- INF = N * 2",
"- V = namedtuple(\"V\", \"cnt index\")",
"- cnt_from_N = [INF] * (N + 1)",
"- cnt_from_N[N] =... | false | 0.171657 | 0.117939 | 1.455469 | [
"s137680600",
"s176021379"
] |
u991542950 | p02572 | python | s278700468 | s875960106 | 119 | 109 | 105,292 | 105,436 | Accepted | Accepted | 8.4 | import sys
input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
sum_A = sum(A)
ans = 0
for a in A[:-1]:
sum_A -= a
ans += a * sum_A
ans %= mod
print(ans) | import sys
input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
sum_A = sum(A) % mod
ans = 0
for a in A[:-1]:
sum_A -= a
sum_A %= mod
ans += a * sum_A
ans %= mod
ans %= mod
print(ans) | 15 | 17 | 219 | 257 | import sys
input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10**9 + 7
sum_A = sum(A)
ans = 0
for a in A[:-1]:
sum_A -= a
ans += a * sum_A
ans %= mod
print(ans)
| import sys
input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10**9 + 7
sum_A = sum(A) % mod
ans = 0
for a in A[:-1]:
sum_A -= a
sum_A %= mod
ans += a * sum_A
ans %= mod
ans %= mod
print(ans)
| false | 11.764706 | [
"-sum_A = sum(A)",
"+sum_A = sum(A) % mod",
"+ sum_A %= mod",
"+ ans %= mod"
] | false | 0.049198 | 0.043017 | 1.143699 | [
"s278700468",
"s875960106"
] |
u362771726 | p02831 | python | s679325533 | s682461192 | 42 | 37 | 5,432 | 5,304 | Accepted | Accepted | 11.9 | from fractions import gcd
a, b = list(map(int, input().split()))
lcm = a * b / gcd(a, b)
print((int(lcm))) | # import math これだとエラーになる 3.4なので
from fractions import gcd
a, b = list(map(int, input().split()))
hoge = (a*b) / gcd(a, b)
print((int(hoge))) | 5 | 6 | 103 | 138 | from fractions import gcd
a, b = list(map(int, input().split()))
lcm = a * b / gcd(a, b)
print((int(lcm)))
| # import math これだとエラーになる 3.4なので
from fractions import gcd
a, b = list(map(int, input().split()))
hoge = (a * b) / gcd(a, b)
print((int(hoge)))
| false | 16.666667 | [
"+# import math これだとエラーになる 3.4なので",
"-lcm = a * b / gcd(a, b)",
"-print((int(lcm)))",
"+hoge = (a * b) / gcd(a, b)",
"+print((int(hoge)))"
] | false | 0.049893 | 0.060905 | 0.819195 | [
"s679325533",
"s682461192"
] |
u463775490 | p02755 | python | s456486364 | s919365308 | 19 | 17 | 3,060 | 2,940 | Accepted | Accepted | 10.53 | import math
a, b = list(map(int, input().split()))
for i in range(b+1,1001):
if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
ans = i
break
else:
ans = -1
print(ans) | a, b = list(map(int,input().split()))
if b * 10 <= (a * 25 + 24) // 2 and -(-a * 25 // 2) < (b + 1) * 10:
print((max(-(-a*25//2), b * 10)))
else:
print((-1)) | 11 | 5 | 205 | 159 | import math
a, b = list(map(int, input().split()))
for i in range(b + 1, 1001):
if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
ans = i
break
else:
ans = -1
print(ans)
| a, b = list(map(int, input().split()))
if b * 10 <= (a * 25 + 24) // 2 and -(-a * 25 // 2) < (b + 1) * 10:
print((max(-(-a * 25 // 2), b * 10)))
else:
print((-1))
| false | 54.545455 | [
"-import math",
"-",
"-for i in range(b + 1, 1001):",
"- if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:",
"- ans = i",
"- break",
"+if b * 10 <= (a * 25 + 24) // 2 and -(-a * 25 // 2) < (b + 1) * 10:",
"+ print((max(-(-a * 25 // 2), b * 10)))",
"- ans = -1",
"-pr... | false | 0.037778 | 0.036816 | 1.026141 | [
"s456486364",
"s919365308"
] |
u500376440 | p03633 | python | s479651375 | s936644114 | 30 | 25 | 9,180 | 9,176 | Accepted | Accepted | 16.67 | from math import *
N=int(eval(input()))
T=list(int(eval(input())) for _ in range(N))
ans=T[0]
for i in range(1,N):
ans=ans*T[i]//gcd(ans,T[i])
print(ans)
| from math import *
def lcm(x,y):
return (x*y)//gcd(x,y)
N=int(eval(input()))
T=[int(eval(input())) for _ in range(N)]
ans=T[0]
for i in range(1,N):
ans=lcm(ans,T[i])
print(ans)
| 8 | 11 | 152 | 181 | from math import *
N = int(eval(input()))
T = list(int(eval(input())) for _ in range(N))
ans = T[0]
for i in range(1, N):
ans = ans * T[i] // gcd(ans, T[i])
print(ans)
| from math import *
def lcm(x, y):
return (x * y) // gcd(x, y)
N = int(eval(input()))
T = [int(eval(input())) for _ in range(N)]
ans = T[0]
for i in range(1, N):
ans = lcm(ans, T[i])
print(ans)
| false | 27.272727 | [
"+",
"+def lcm(x, y):",
"+ return (x * y) // gcd(x, y)",
"+",
"+",
"-T = list(int(eval(input())) for _ in range(N))",
"+T = [int(eval(input())) for _ in range(N)]",
"- ans = ans * T[i] // gcd(ans, T[i])",
"+ ans = lcm(ans, T[i])"
] | false | 0.040621 | 0.048434 | 0.838698 | [
"s479651375",
"s936644114"
] |
u211160392 | p02862 | python | s471268144 | s459541457 | 306 | 231 | 3,064 | 55,660 | Accepted | Accepted | 24.51 | MOD = 10**9+7
X,Y = list(map(int,input().split()))
if (X+Y) % 3 != 0:
print((0))
exit()
N = (X+Y)//3
X -= N
Y -= N
if X < 0 or Y < 0:
print((0))
exit()
si = 1
bo = 1
for i in range(N):
si = (si*(i+1)) % MOD
for i in range(min(X,Y)):
bo = (bo*(i+1)) % MOD
for i in range(N-min(X... | MOD = 10**9+7 # 問題に合わせて適宜書き換え
list_size = 10**6+100 # 問題に合わせて適宜書き換え
f_list = [1] * list_size
f_r_list = [1] * list_size
for i in range(list_size - 1):
f_list[i + 1] = ((f_list[i] * (i+2)) % MOD)
f_r_list[-1] = pow(f_list[-1], MOD - 2, MOD)
for i in range(-2, -list_size-1, -1):
f_r_list[i] = (... | 21 | 30 | 377 | 685 | MOD = 10**9 + 7
X, Y = list(map(int, input().split()))
if (X + Y) % 3 != 0:
print((0))
exit()
N = (X + Y) // 3
X -= N
Y -= N
if X < 0 or Y < 0:
print((0))
exit()
si = 1
bo = 1
for i in range(N):
si = (si * (i + 1)) % MOD
for i in range(min(X, Y)):
bo = (bo * (i + 1)) % MOD
for i in range(N - min... | MOD = 10**9 + 7 # 問題に合わせて適宜書き換え
list_size = 10**6 + 100 # 問題に合わせて適宜書き換え
f_list = [1] * list_size
f_r_list = [1] * list_size
for i in range(list_size - 1):
f_list[i + 1] = (f_list[i] * (i + 2)) % MOD
f_r_list[-1] = pow(f_list[-1], MOD - 2, MOD)
for i in range(-2, -list_size - 1, -1):
f_r_list[i] = (f_r_list[i ... | false | 30 | [
"-MOD = 10**9 + 7",
"+MOD = 10**9 + 7 # 問題に合わせて適宜書き換え",
"+list_size = 10**6 + 100 # 問題に合わせて適宜書き換え",
"+f_list = [1] * list_size",
"+f_r_list = [1] * list_size",
"+for i in range(list_size - 1):",
"+ f_list[i + 1] = (f_list[i] * (i + 2)) % MOD",
"+f_r_list[-1] = pow(f_list[-1], MOD - 2, MOD)",
"+... | false | 0.127599 | 0.868346 | 0.146944 | [
"s471268144",
"s459541457"
] |
u254871849 | p03240 | python | s472239262 | s344021281 | 36 | 31 | 3,064 | 3,064 | Accepted | Accepted | 13.89 | # 2019-11-10 20:23:41(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
... | # 2019-11-10 20:23:41(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
... | 42 | 41 | 1,284 | 1,319 | # 2019-11-10 20:23:41(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import ... | # 2019-11-10 20:23:41(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import ... | false | 2.380952 | [
"- break # 中心は一意に決まるので見つかったらそれ以上調べる必要ない",
"- for i in range(3):",
"- res[i] = str(res[i])",
"- print((\" \".join(res)))",
"+ for i in range(3):",
"+ res[i] = str(res[i])",
"+ print((\" \".join(res)))",
"+ sys.... | false | 0.060972 | 0.040486 | 1.506002 | [
"s472239262",
"s344021281"
] |
u761320129 | p03687 | python | s882108304 | s627111202 | 73 | 39 | 3,064 | 3,064 | Accepted | Accepted | 46.58 | S = eval(input())
ans = len(S)
for i in range(26):
c = chr(ord('a') + i)
t1 = S
cnt = 0
while any(list([x!=c for x in t1])):
t2 = ''
for ca,cb in zip(t1,t1[1:]):
if ca == c or cb == c:
t2 += c
else:
t2 += ca
t... | S = eval(input())
ans = len(S)
for i in range(26):
c = chr(ord('a') + i)
if not c in S: continue
if all([c==a for a in S]):
print((0))
exit()
arr = list(S)
tmp = 0
while 1:
arr2 = []
diff = False
tmp += 1
for a,b in zip(arr,arr[1:])... | 19 | 26 | 381 | 553 | S = eval(input())
ans = len(S)
for i in range(26):
c = chr(ord("a") + i)
t1 = S
cnt = 0
while any(list([x != c for x in t1])):
t2 = ""
for ca, cb in zip(t1, t1[1:]):
if ca == c or cb == c:
t2 += c
else:
t2 += ca
t1 = t2
... | S = eval(input())
ans = len(S)
for i in range(26):
c = chr(ord("a") + i)
if not c in S:
continue
if all([c == a for a in S]):
print((0))
exit()
arr = list(S)
tmp = 0
while 1:
arr2 = []
diff = False
tmp += 1
for a, b in zip(arr, arr[1:]):
... | false | 26.923077 | [
"- t1 = S",
"- cnt = 0",
"- while any(list([x != c for x in t1])):",
"- t2 = \"\"",
"- for ca, cb in zip(t1, t1[1:]):",
"- if ca == c or cb == c:",
"- t2 += c",
"+ if not c in S:",
"+ continue",
"+ if all([c == a for a in S]):",
"+ ... | false | 0.041692 | 0.037469 | 1.112714 | [
"s882108304",
"s627111202"
] |
u773265208 | p04001 | python | s182424565 | s466255952 | 181 | 39 | 40,304 | 3,064 | Accepted | Accepted | 78.45 | import itertools
s = eval(input())
n = len(s)
l = []
for i in range(1,n):
l.append(i)
ans = []
for i in range(1,n):
index = list(itertools.combinations(l,i))
for j in range(len(index)):
start = 0
for k in index[j]:
ans.append(int(s[start:k]))
start = k
ans.append(int(s[k:n]))
pri... | s = eval(input())
n = len(s)
ans = 0
for i in range(2**n):
l = []
for j in range(n):
if i & (1 << j):
l.append(j)
#print(l)
string = s
if len(l) == 0:
continue
for k in range(len(l)):
if l[k] == 0:
string = '+' + string
else:
string = string[:l[k]+k] + '+' + string[l[k]+k:]
... | 21 | 23 | 336 | 364 | import itertools
s = eval(input())
n = len(s)
l = []
for i in range(1, n):
l.append(i)
ans = []
for i in range(1, n):
index = list(itertools.combinations(l, i))
for j in range(len(index)):
start = 0
for k in index[j]:
ans.append(int(s[start:k]))
start = k
ans... | s = eval(input())
n = len(s)
ans = 0
for i in range(2**n):
l = []
for j in range(n):
if i & (1 << j):
l.append(j)
# print(l)
string = s
if len(l) == 0:
continue
for k in range(len(l)):
if l[k] == 0:
string = "+" + string
else:
s... | false | 8.695652 | [
"-import itertools",
"-",
"-l = []",
"-for i in range(1, n):",
"- l.append(i)",
"-ans = []",
"-for i in range(1, n):",
"- index = list(itertools.combinations(l, i))",
"- for j in range(len(index)):",
"- start = 0",
"- for k in index[j]:",
"- ans.append(int(s[s... | false | 0.044699 | 0.006325 | 7.066899 | [
"s182424565",
"s466255952"
] |
u499381410 | p02867 | python | s322720553 | s907472336 | 1,116 | 727 | 96,508 | 92,680 | Accepted | Accepted | 34.86 | 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
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, ... | 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
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, ... | 96 | 92 | 2,825 | 2,597 | 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
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
fro... | 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
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
fro... | false | 4.166667 | [
"+class UnionFind:",
"+ def __init__(self, n):",
"+ # 負 : 根であることを示す。絶対値はランクを示す",
"+ # 非負: 根でないことを示す。値は親を示す",
"+ self.table = [-1] * n",
"+ self.size = [1] * n",
"+ self.group_num = n",
"+",
"+ def root(self, x):",
"+ if self.table[x] < 0:",
"+ ... | false | 0.036479 | 0.037217 | 0.980169 | [
"s322720553",
"s907472336"
] |
u254871849 | p03494 | python | s561201098 | s781915041 | 20 | 18 | 3,060 | 2,940 | Accepted | Accepted | 10 | n = int(eval(input()))
a = list(map(int, input().split()))
count = 0
only_even = True
while only_even:
for i in range(n):
if a[i] % 2 != 0:
only_even = False
if only_even == False:
break
for i in range(n):
a[i] /= 2
count += 1
print(count) | import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
def main():
n, *numbers = (int(x) for x in sys.stdin.read().split())
still_can_be_divided = True
count = 0
while still_can_be_divided:
for i in range(n)... | 17 | 27 | 285 | 627 | n = int(eval(input()))
a = list(map(int, input().split()))
count = 0
only_even = True
while only_even:
for i in range(n):
if a[i] % 2 != 0:
only_even = False
if only_even == False:
break
for i in range(n):
a[i] /= 2
count += 1
print(count)
| import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
def main():
n, *numbers = (int(x) for x in sys.stdin.read().split())
still_can_be_divided = True
count = 0
while still_can_be_divided:
for i in range(n):
... | false | 37.037037 | [
"-n = int(eval(input()))",
"-a = list(map(int, input().split()))",
"-count = 0",
"-only_even = True",
"-while only_even:",
"- for i in range(n):",
"- if a[i] % 2 != 0:",
"- only_even = False",
"- if only_even == False:",
"- break",
"- for i in range(n):",
"- ... | false | 0.045136 | 0.04473 | 1.009084 | [
"s561201098",
"s781915041"
] |
u353797797 | p03183 | python | s590130742 | s950978800 | 1,595 | 1,446 | 82,036 | 82,036 | Accepted | Accepted | 9.34 | def f(n):
dp = [0] * (n * 10 ** 4 + 1)
bs = [list(map(int, input().split())) for _ in range(n)]
bs.sort(key=lambda x: x[0] + x[1])
for w, s, v in bs:
for i in range(w + s, w - 1, -1):
dpw = dp[i - w] + v
if dpw > dp[i]:
dp[i] = dpw
print((max(... | def f(n):
mx = 0
dp = [0] * (n * 10 ** 4 + 1)
bs = [list(map(int, input().split())) for _ in range(n)]
bs.sort(key=lambda x: x[0] + x[1])
for w, s, v in bs:
for i in range(w + s, w - 1, -1):
dpw = dp[i - w] + v
if dpw > dp[i]:
dp[i] = dpw
... | 14 | 17 | 352 | 419 | def f(n):
dp = [0] * (n * 10**4 + 1)
bs = [list(map(int, input().split())) for _ in range(n)]
bs.sort(key=lambda x: x[0] + x[1])
for w, s, v in bs:
for i in range(w + s, w - 1, -1):
dpw = dp[i - w] + v
if dpw > dp[i]:
dp[i] = dpw
print((max(dp)))
n =... | def f(n):
mx = 0
dp = [0] * (n * 10**4 + 1)
bs = [list(map(int, input().split())) for _ in range(n)]
bs.sort(key=lambda x: x[0] + x[1])
for w, s, v in bs:
for i in range(w + s, w - 1, -1):
dpw = dp[i - w] + v
if dpw > dp[i]:
dp[i] = dpw
... | false | 17.647059 | [
"+ mx = 0",
"- print((max(dp)))",
"+ if dpw > mx:",
"+ mx = dpw",
"+ print(mx)"
] | false | 0.046297 | 0.044457 | 1.041379 | [
"s590130742",
"s950978800"
] |
u997641430 | p02922 | python | s252283756 | s873823238 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | A,B=list(map(int,input().split()))
x=0
while (A-1)*x+1<B:
x+=1
print(x) | a, b = list(map(int, input().split()))
print((-(-(b-1)//(a-1))))
| 5 | 2 | 73 | 58 | A, B = list(map(int, input().split()))
x = 0
while (A - 1) * x + 1 < B:
x += 1
print(x)
| a, b = list(map(int, input().split()))
print((-(-(b - 1) // (a - 1))))
| false | 60 | [
"-A, B = list(map(int, input().split()))",
"-x = 0",
"-while (A - 1) * x + 1 < B:",
"- x += 1",
"-print(x)",
"+a, b = list(map(int, input().split()))",
"+print((-(-(b - 1) // (a - 1))))"
] | false | 0.044876 | 0.068655 | 0.653646 | [
"s252283756",
"s873823238"
] |
u631277801 | p03456 | python | s813468155 | s539642768 | 151 | 17 | 12,504 | 3,064 | Accepted | Accepted | 88.74 | import numpy as np
# input
a, b = input().split()
ab = int(a+b)
if np.sqrt(ab)-round(np.sqrt(ab)):
print('No')
else:
print('Yes') | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**5)
def li(): return list(map(int, stdin.readline().split()))
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return list(map(float, stdin.readline().split()))
def ls(): return stdin.readline().split()
def ns(): return stdin.re... | 11 | 27 | 150 | 612 | import numpy as np
# input
a, b = input().split()
ab = int(a + b)
if np.sqrt(ab) - round(np.sqrt(ab)):
print("No")
else:
print("Yes")
| import sys
stdin = sys.stdin
sys.setrecursionlimit(10**5)
def li():
return list(map(int, stdin.readline().split()))
def li_():
return [int(x) - 1 for x in stdin.readline().split()]
def lf():
return list(map(float, stdin.readline().split()))
def ls():
return stdin.readline().split()
def ns():
... | false | 59.259259 | [
"-import numpy as np",
"+import sys",
"-# input",
"-a, b = input().split()",
"-ab = int(a + b)",
"-if np.sqrt(ab) - round(np.sqrt(ab)):",
"+stdin = sys.stdin",
"+sys.setrecursionlimit(10**5)",
"+",
"+",
"+def li():",
"+ return list(map(int, stdin.readline().split()))",
"+",
"+",
"+def... | false | 0.431549 | 0.03488 | 12.372538 | [
"s813468155",
"s539642768"
] |
u037430802 | p02900 | python | s307682302 | s143850631 | 469 | 333 | 5,268 | 3,060 | Accepted | Accepted | 29 | #from collections import defaultdict
import copy
import math
A,B = list(map(int, input().split()))
num = min(A,B)
tmps = {}
p = 2
for p in range(2, math.ceil(num**0.5)+1):
if A % p == 0 and B % p == 0:
tmps[p] = True
if A % (num//p) == 0 and B % (num//p) == 0:
tmps[num//p] = Tr... | A,B = list(map(int, input().split()))
def getPrimeFactorsList(num):
pn = 2 #素数は2から
pflist = [] #素因数のリスト
while pn * pn <= num: #√numまで調べる
while num % pn == 0: #現在の素数で割り切れる範囲でループ
num = num / pn
pflist.append(pn)
pn += 1 #割り切れなくなったら次の素数へ
if num > 1:
pflist.append(int(num))... | 36 | 22 | 704 | 451 | # from collections import defaultdict
import copy
import math
A, B = list(map(int, input().split()))
num = min(A, B)
tmps = {}
p = 2
for p in range(2, math.ceil(num**0.5) + 1):
if A % p == 0 and B % p == 0:
tmps[p] = True
if A % (num // p) == 0 and B % (num // p) == 0:
tmps[num // p] = True
... | A, B = list(map(int, input().split()))
def getPrimeFactorsList(num):
pn = 2 # 素数は2から
pflist = [] # 素因数のリスト
while pn * pn <= num: # √numまで調べる
while num % pn == 0: # 現在の素数で割り切れる範囲でループ
num = num / pn
pflist.append(pn)
pn += 1 # 割り切れなくなったら次の素数へ
if num > 1:
... | false | 38.888889 | [
"-# from collections import defaultdict",
"-import copy",
"-import math",
"+A, B = list(map(int, input().split()))",
"-A, B = list(map(int, input().split()))",
"-num = min(A, B)",
"-tmps = {}",
"-p = 2",
"-for p in range(2, math.ceil(num**0.5) + 1):",
"- if A % p == 0 and B % p == 0:",
"- ... | false | 0.038475 | 0.047133 | 0.816305 | [
"s307682302",
"s143850631"
] |
u969850098 | p02708 | python | s862002772 | s345762744 | 120 | 105 | 9,056 | 9,204 | Accepted | Accepted | 12.5 | import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
def main():
N, K = list(map(int, readline().rstrip().split()))
ans = 0
for k in range(K, N+2):
mi = ((k-1) * k) // 2
ma = (N * (N + 1)) // 2 - ((N-k) * (N-k+1)) // 2
ans += (ma - mi + 1) % MOD
print((ans % M... | import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
def main():
N, K = list(map(int, readline().rstrip().split()))
ans = 0
m = (N * (N + 1)) // 2
for k in range(K, N+2):
mi = ((k-1) * k) // 2
ma = m - ((N-k) * (N-k+1)) // 2
ans += (ma - mi + 1) % MOD
pri... | 17 | 18 | 360 | 371 | import sys
readline = sys.stdin.readline
MOD = 10**9 + 7
def main():
N, K = list(map(int, readline().rstrip().split()))
ans = 0
for k in range(K, N + 2):
mi = ((k - 1) * k) // 2
ma = (N * (N + 1)) // 2 - ((N - k) * (N - k + 1)) // 2
ans += (ma - mi + 1) % MOD
print((ans % MOD)... | import sys
readline = sys.stdin.readline
MOD = 10**9 + 7
def main():
N, K = list(map(int, readline().rstrip().split()))
ans = 0
m = (N * (N + 1)) // 2
for k in range(K, N + 2):
mi = ((k - 1) * k) // 2
ma = m - ((N - k) * (N - k + 1)) // 2
ans += (ma - mi + 1) % MOD
print((... | false | 5.555556 | [
"+ m = (N * (N + 1)) // 2",
"- ma = (N * (N + 1)) // 2 - ((N - k) * (N - k + 1)) // 2",
"+ ma = m - ((N - k) * (N - k + 1)) // 2"
] | false | 0.079021 | 0.075194 | 1.050898 | [
"s862002772",
"s345762744"
] |
u528124741 | p03037 | python | s426135742 | s486383352 | 380 | 228 | 27,340 | 22,280 | Accepted | Accepted | 40 |
n,m = list(map(int,input().split(" ")))
gates = []
for i in range(m):
gates.append(list(map(int,input().split(" "))))
result = [1, n]
for card in gates:
if result[0] < card[0]:
result[0] = card[0]
if result[1] > card[1]:
result[1] = card[1]
tmp = result[1] - result[0] + 1... | n,m = list(map(int,input().split(" ")))
lr = []
ming = 0
maxg = 10 **6
for i in range(m):
a,b = list(map(int,input().split(" ")))
lr.append((a,b))
for i in lr:
if i[0] > ming:
ming = i[0]
if i[1] < maxg:
maxg = i[1]
print((max([0, maxg - ming + 1]))) | 20 | 18 | 366 | 290 | n, m = list(map(int, input().split(" ")))
gates = []
for i in range(m):
gates.append(list(map(int, input().split(" "))))
result = [1, n]
for card in gates:
if result[0] < card[0]:
result[0] = card[0]
if result[1] > card[1]:
result[1] = card[1]
tmp = result[1] - result[0] + 1
if tmp >= 0:
... | n, m = list(map(int, input().split(" ")))
lr = []
ming = 0
maxg = 10**6
for i in range(m):
a, b = list(map(int, input().split(" ")))
lr.append((a, b))
for i in lr:
if i[0] > ming:
ming = i[0]
if i[1] < maxg:
maxg = i[1]
print((max([0, maxg - ming + 1])))
| false | 10 | [
"-gates = []",
"+lr = []",
"+ming = 0",
"+maxg = 10**6",
"- gates.append(list(map(int, input().split(\" \"))))",
"-result = [1, n]",
"-for card in gates:",
"- if result[0] < card[0]:",
"- result[0] = card[0]",
"- if result[1] > card[1]:",
"- result[1] = card[1]",
"-tmp =... | false | 0.040258 | 0.04092 | 0.983816 | [
"s426135742",
"s486383352"
] |
u823513038 | p02397 | python | s406174400 | s665112123 | 70 | 50 | 7,516 | 5,612 | Accepted | Accepted | 28.57 | while True:
a, b = sorted(map(int, input().split()))
if (a == 0) & (b == 0): break
print((a, b)) | while True:
a, b = list(map(int, input().split()))
if a == 0 and b == 0:
break
if a < b:
print((a, b))
else:
print((b, a))
| 4 | 8 | 100 | 130 | while True:
a, b = sorted(map(int, input().split()))
if (a == 0) & (b == 0):
break
print((a, b))
| while True:
a, b = list(map(int, input().split()))
if a == 0 and b == 0:
break
if a < b:
print((a, b))
else:
print((b, a))
| false | 50 | [
"- a, b = sorted(map(int, input().split()))",
"- if (a == 0) & (b == 0):",
"+ a, b = list(map(int, input().split()))",
"+ if a == 0 and b == 0:",
"- print((a, b))",
"+ if a < b:",
"+ print((a, b))",
"+ else:",
"+ print((b, a))"
] | false | 0.05329 | 0.053343 | 0.999005 | [
"s406174400",
"s665112123"
] |
u119148115 | p03762 | python | s231098380 | s196818782 | 128 | 112 | 113,628 | 90,904 | Accepted | Accepted | 12.5 | import sys
def MI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり
n,m = MI()
x,y = LI(),LI()
mod = 10**9+7
n,m = n-1,m-1
dx = [x[i+1]-x[i] for i in range(n)]
dy = [y[i+1]-y[i] for i in range(m)]
if n % 2 == 0:
... | import sys
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし
def ... | 31 | 26 | 831 | 715 | import sys
def MI():
return list(map(int, sys.stdin.readline().rstrip().split()))
def LI():
return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり
n, m = MI()
x, y = LI(), LI()
mod = 10**9 + 7
n, m = n - 1, m - 1
dx = [x[i + 1] - x[i] for i in range(n)]
dy = [y[i + 1] - y[i] for i in range(m... | import sys
sys.setrecursionlimit(10**7)
def I():
return int(sys.stdin.readline().rstrip())
def MI():
return list(map(int, sys.stdin.readline().rstrip().split()))
def LI():
return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり
def LI2():
return list(map(int, sys.stdin.readline().r... | false | 16.129032 | [
"+",
"+sys.setrecursionlimit(10**7)",
"+",
"+",
"+def I():",
"+ return int(sys.stdin.readline().rstrip())",
"-n, m = MI()",
"-x, y = LI(), LI()",
"+def LI2():",
"+ return list(map(int, sys.stdin.readline().rstrip())) # 空白なし",
"+",
"+",
"+def S():",
"+ return sys.stdin.readline().... | false | 0.032267 | 0.035035 | 0.921013 | [
"s231098380",
"s196818782"
] |
u596276291 | p03828 | python | s584965455 | s510943678 | 30 | 27 | 3,444 | 3,316 | Accepted | Accepted | 10 | from collections import defaultdict
MOD = 10 ** 9 + 7
# nを素因数分解する(O(n ^ (1 / 2)))
# primeFactorDecomposition(12): {2: 2, 3: 1}
def prime_factor_decomposition(n):
m = defaultdict(int)
while n > 1:
find_factor = False
for i in range(2, int(n ** 1/2) + 1):
if n % i == 0... | from collections import defaultdict
MOD = 10 ** 9 + 7
# nを素因数分解する(O(n ^ (1 / 2)))
# primeFactorDecomposition(12): {2: 2, 3: 1}
def prime_factor_decomposition(n):
import math
m = defaultdict(int)
while n > 1:
find_factor = False
for i in range(2, int(math.sqrt(n)) + 1):
... | 44 | 41 | 875 | 873 | from collections import defaultdict
MOD = 10**9 + 7
# nを素因数分解する(O(n ^ (1 / 2)))
# primeFactorDecomposition(12): {2: 2, 3: 1}
def prime_factor_decomposition(n):
m = defaultdict(int)
while n > 1:
find_factor = False
for i in range(2, int(n**1 / 2) + 1):
if n % i == 0:
... | from collections import defaultdict
MOD = 10**9 + 7
# nを素因数分解する(O(n ^ (1 / 2)))
# primeFactorDecomposition(12): {2: 2, 3: 1}
def prime_factor_decomposition(n):
import math
m = defaultdict(int)
while n > 1:
find_factor = False
for i in range(2, int(math.sqrt(n)) + 1):
if n % i =... | false | 6.818182 | [
"+ import math",
"+",
"- for i in range(2, int(n**1 / 2) + 1):",
"+ for i in range(2, int(math.sqrt(n)) + 1):",
"- all_m = defaultdict(int)",
"+ m = defaultdict(int)",
"- m = prime_factor_decomposition(i)",
"- for k, v in list(m.items()):",
"- all_m[k]... | false | 0.240643 | 0.063432 | 3.793717 | [
"s584965455",
"s510943678"
] |
u311669106 | p03494 | python | s505917010 | s516794059 | 20 | 18 | 2,940 | 2,940 | Accepted | Accepted | 10 | n=int(eval(input()))
ln=[int(a) for a in input().split()]
i=0
while all(a % 2 ==0 for a in ln):
ln=[a/2 for a in ln]
i+=1
print(i) | n=int(eval(input()))
ln=[int(a) for a in input().split()]
i=0
while all(a%2==0 for a in ln):
ln=[a//2 for a in ln]
i+=1
print(i) | 7 | 7 | 138 | 136 | n = int(eval(input()))
ln = [int(a) for a in input().split()]
i = 0
while all(a % 2 == 0 for a in ln):
ln = [a / 2 for a in ln]
i += 1
print(i)
| n = int(eval(input()))
ln = [int(a) for a in input().split()]
i = 0
while all(a % 2 == 0 for a in ln):
ln = [a // 2 for a in ln]
i += 1
print(i)
| false | 0 | [
"- ln = [a / 2 for a in ln]",
"+ ln = [a // 2 for a in ln]"
] | false | 0.031376 | 0.033465 | 0.937558 | [
"s505917010",
"s516794059"
] |
u368249389 | p03150 | python | s105854419 | s519131461 | 186 | 18 | 38,640 | 2,940 | Accepted | Accepted | 90.32 | # KEYENCE String 全通りのパターンを探索する
# input process
S = eval(input())
s_length = len(S)
# initialization
is_same = False
for i in range(s_length):
for j in range(i, s_length):
# string slice
tmp_str = S[:i+1] + S[j:]
if tmp_str=="keyence":
is_same = True
br... | # Problem B - KEYENCE String
# input
s = eval(input())
s_l = len(s)
# initialization
is_ok = False
# check
for i in range(s_l):
for j in range(i, s_l):
tmp_s = s[:i] + s[j:]
if tmp_s=='keyence':
is_ok = True
break
# output
if is_ok:
print("YES")
el... | 20 | 22 | 375 | 335 | # KEYENCE String 全通りのパターンを探索する
# input process
S = eval(input())
s_length = len(S)
# initialization
is_same = False
for i in range(s_length):
for j in range(i, s_length):
# string slice
tmp_str = S[: i + 1] + S[j:]
if tmp_str == "keyence":
is_same = True
break
if is_s... | # Problem B - KEYENCE String
# input
s = eval(input())
s_l = len(s)
# initialization
is_ok = False
# check
for i in range(s_l):
for j in range(i, s_l):
tmp_s = s[:i] + s[j:]
if tmp_s == "keyence":
is_ok = True
break
# output
if is_ok:
print("YES")
else:
print("NO")
| false | 9.090909 | [
"-# KEYENCE String 全通りのパターンを探索する",
"-# input process",
"-S = eval(input())",
"-s_length = len(S)",
"+# Problem B - KEYENCE String",
"+# input",
"+s = eval(input())",
"+s_l = len(s)",
"-is_same = False",
"-for i in range(s_length):",
"- for j in range(i, s_length):",
"- # string slice... | false | 0.075385 | 0.036587 | 2.060403 | [
"s105854419",
"s519131461"
] |
u912237403 | p00008 | python | s865378961 | s180174739 | 4,940 | 20 | 4,352 | 4,208 | Accepted | Accepted | 99.6 | import sys,itertools
for n in map(int,sys.stdin):
x=0
for num in itertools.product("0123456789",repeat=4):
eq="{}+{}+{}+{}".format(*(num))
if eval(eq)==n:x+=1
print(x) | import sys
A=list(range(10))
for n in map(int,sys.stdin):
x=0
for a in A:
d=n-a
if 0>d or d>27:continue
for b in A:
e=d-b
if 0>e or e>18:continue
for c in A:
if (e-c)in A:x+=1
print(x) | 7 | 13 | 186 | 233 | import sys, itertools
for n in map(int, sys.stdin):
x = 0
for num in itertools.product("0123456789", repeat=4):
eq = "{}+{}+{}+{}".format(*(num))
if eval(eq) == n:
x += 1
print(x)
| import sys
A = list(range(10))
for n in map(int, sys.stdin):
x = 0
for a in A:
d = n - a
if 0 > d or d > 27:
continue
for b in A:
e = d - b
if 0 > e or e > 18:
continue
for c in A:
if (e - c) in A:
... | false | 46.153846 | [
"-import sys, itertools",
"+import sys",
"+A = list(range(10))",
"- for num in itertools.product(\"0123456789\", repeat=4):",
"- eq = \"{}+{}+{}+{}\".format(*(num))",
"- if eval(eq) == n:",
"- x += 1",
"+ for a in A:",
"+ d = n - a",
"+ if 0 > d or d > ... | false | 0.463186 | 0.050065 | 9.251623 | [
"s865378961",
"s180174739"
] |
u888092736 | p02580 | python | s660451352 | s268885217 | 456 | 398 | 101,032 | 77,808 | Accepted | Accepted | 12.72 | H, W, M, *hw = list(map(int, open(0).read().split()))
H_cnt = [0] * (H + 1)
W_cnt = [0] * (W + 1)
bombs = [(h, w) for h, w in zip(*[iter(hw)] * 2)]
for h, w in bombs:
H_cnt[h] += 1
W_cnt[w] += 1
H_max_cnt = max(H_cnt)
W_max_cnt = max(W_cnt)
H_max = {i for i in range(1, H + 1) if H_cnt[i] == H_max_c... | H, W, M, *hw = list(map(int, open(0).read().split()))
H_cnt = [0] * (H + 1)
W_cnt = [0] * (W + 1)
bombs = [(h, w) for h, w in zip(*[iter(hw)] * 2)]
for h, w in bombs:
H_cnt[h] += 1
W_cnt[w] += 1
H_max_cnt = max(H_cnt)
W_max_cnt = max(W_cnt)
comb_cnt = H_cnt.count(H_max_cnt) * W_cnt.count(W_max_cnt)... | 21 | 18 | 587 | 483 | H, W, M, *hw = list(map(int, open(0).read().split()))
H_cnt = [0] * (H + 1)
W_cnt = [0] * (W + 1)
bombs = [(h, w) for h, w in zip(*[iter(hw)] * 2)]
for h, w in bombs:
H_cnt[h] += 1
W_cnt[w] += 1
H_max_cnt = max(H_cnt)
W_max_cnt = max(W_cnt)
H_max = {i for i in range(1, H + 1) if H_cnt[i] == H_max_cnt}
W_max = {... | H, W, M, *hw = list(map(int, open(0).read().split()))
H_cnt = [0] * (H + 1)
W_cnt = [0] * (W + 1)
bombs = [(h, w) for h, w in zip(*[iter(hw)] * 2)]
for h, w in bombs:
H_cnt[h] += 1
W_cnt[w] += 1
H_max_cnt = max(H_cnt)
W_max_cnt = max(W_cnt)
comb_cnt = H_cnt.count(H_max_cnt) * W_cnt.count(W_max_cnt)
for h, w in ... | false | 14.285714 | [
"-H_max = {i for i in range(1, H + 1) if H_cnt[i] == H_max_cnt}",
"-W_max = {i for i in range(1, W + 1) if W_cnt[i] == W_max_cnt}",
"-comb_cnt = len(H_max) * len(W_max)",
"+comb_cnt = H_cnt.count(H_max_cnt) * W_cnt.count(W_max_cnt)"
] | false | 0.041053 | 0.039969 | 1.027137 | [
"s660451352",
"s268885217"
] |
u498487134 | p02935 | python | s659370614 | s372721493 | 162 | 67 | 38,256 | 61,508 | Accepted | Accepted | 58.64 | N=int(eval(input()))
v=list(map(int,input().split()))
v.sort()
ans=v[0]
for i in range(1,N):
ans=(ans+v[i])/2
print(ans) | import sys
input = sys.stdin.readline
def I(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def LI(): return list(map(int, input().split()))
def main():
mod=10**9+7
N=I()
v=LI()
v.sort()
ans=v[0]
for i in range(1,N):
ans=(ans+v[i])/2
pri... | 8 | 18 | 126 | 326 | N = int(eval(input()))
v = list(map(int, input().split()))
v.sort()
ans = v[0]
for i in range(1, N):
ans = (ans + v[i]) / 2
print(ans)
| import sys
input = sys.stdin.readline
def I():
return int(eval(input()))
def MI():
return list(map(int, input().split()))
def LI():
return list(map(int, input().split()))
def main():
mod = 10**9 + 7
N = I()
v = LI()
v.sort()
ans = v[0]
for i in range(1, N):
ans = (an... | false | 55.555556 | [
"-N = int(eval(input()))",
"-v = list(map(int, input().split()))",
"-v.sort()",
"-ans = v[0]",
"-for i in range(1, N):",
"- ans = (ans + v[i]) / 2",
"-print(ans)",
"+import sys",
"+",
"+input = sys.stdin.readline",
"+",
"+",
"+def I():",
"+ return int(eval(input()))",
"+",
"+",
... | false | 0.035038 | 0.042028 | 0.833698 | [
"s659370614",
"s372721493"
] |
u426764965 | p03503 | python | s934208629 | s359054360 | 1,855 | 133 | 14,440 | 3,188 | Accepted | Accepted | 92.83 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
def abc080_c():
N = int(readline()) # 他店の数
# 他店の営業パターン:店→日付→営業01
F = np.array([list(map(int, readline().split())) for _ in range(N)], dtype=np.int32)
# 他店と何回... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def abc080_c():
N = int(readline()) # 他店の数
# 他店の営業パターン:店→日付→営業01
F = [list(map(int, readline().split())) for _ in range(N)]
# 他店と何回重なると利益がどうなるか:店→重複回数→利益
P = [list(map(int,... | 27 | 28 | 867 | 882 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
def abc080_c():
N = int(readline()) # 他店の数
# 他店の営業パターン:店→日付→営業01
F = np.array([list(map(int, readline().split())) for _ in range(N)], dtype=np.int32)
# 他店と何回重なると利益がど... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def abc080_c():
N = int(readline()) # 他店の数
# 他店の営業パターン:店→日付→営業01
F = [list(map(int, readline().split())) for _ in range(N)]
# 他店と何回重なると利益がどうなるか:店→重複回数→利益
P = [list(map(int, readlin... | false | 3.571429 | [
"-import numpy as np",
"- F = np.array([list(map(int, readline().split())) for _ in range(N)], dtype=np.int32)",
"+ F = [list(map(int, readline().split())) for _ in range(N)]",
"- P = np.array([list(map(int, readline().split())) for _ in range(N)], dtype=np.int32)",
"+ P = [list(map(int, readlin... | false | 0.556904 | 0.0387 | 14.390164 | [
"s934208629",
"s359054360"
] |
u562935282 | p02993 | python | s859907773 | s149234766 | 181 | 17 | 38,384 | 2,940 | Accepted | Accepted | 90.61 | s = eval(input())
flg = True
for s1, s2 in zip(s, s[1:]):
if s1 == s2:
flg = False
break
print(('Good' if flg else 'Bad'))
| s = eval(input())
bl = 1 in (len(set(x)) for x in zip(s, s[1:]))
print(('Bad' if bl else 'Good'))
| 9 | 3 | 145 | 92 | s = eval(input())
flg = True
for s1, s2 in zip(s, s[1:]):
if s1 == s2:
flg = False
break
print(("Good" if flg else "Bad"))
| s = eval(input())
bl = 1 in (len(set(x)) for x in zip(s, s[1:]))
print(("Bad" if bl else "Good"))
| false | 66.666667 | [
"-flg = True",
"-for s1, s2 in zip(s, s[1:]):",
"- if s1 == s2:",
"- flg = False",
"- break",
"-print((\"Good\" if flg else \"Bad\"))",
"+bl = 1 in (len(set(x)) for x in zip(s, s[1:]))",
"+print((\"Bad\" if bl else \"Good\"))"
] | false | 0.066588 | 0.046671 | 1.42676 | [
"s859907773",
"s149234766"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.