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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u261103969 | p02785 | python | s739855078 | s664848874 | 167 | 136 | 26,180 | 105,612 | Accepted | Accepted | 18.56 | n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
h = sorted(h)
h[-1:-k-1:-1] = [0,] * min(n, k)
print((sum(h))) | import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)
def main():
N, K = list(map(int, readline().split()))
H = list(map(int, readline().split()))
H.sort()
if N <= K:
ans = 0
else:
ans = sum(H[:N - K])
pr... | 7 | 22 | 147 | 367 | n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
h = sorted(h)
h[-1 : -k - 1 : -1] = [
0,
] * min(n, k)
print((sum(h)))
| import sys
readline = sys.stdin.readline
MOD = 10**9 + 7
INF = float("INF")
sys.setrecursionlimit(10**5)
def main():
N, K = list(map(int, readline().split()))
H = list(map(int, readline().split()))
H.sort()
if N <= K:
ans = 0
else:
ans = sum(H[: N - K])
print(ans)
if __name_... | false | 68.181818 | [
"-n, k = [int(i) for i in input().split()]",
"-h = [int(i) for i in input().split()]",
"-h = sorted(h)",
"-h[-1 : -k - 1 : -1] = [",
"- 0,",
"-] * min(n, k)",
"-print((sum(h)))",
"+import sys",
"+",
"+readline = sys.stdin.readline",
"+MOD = 10**9 + 7",
"+INF = float(\"INF\")",
"+sys.setre... | false | 0.046393 | 0.116584 | 0.397941 | [
"s739855078",
"s664848874"
] |
u142415823 | p02971 | python | s346102656 | s758275355 | 483 | 343 | 21,520 | 18,948 | Accepted | Accepted | 28.99 | N = int(eval(input()))
A = [int(eval(input())) for _ in range(N)]
mls = [-1 for _ in range(N+1)]
for i, a in enumerate(A, 1):
mls[i] = max(mls[i-1], a)
mrs = [-1 for _ in range(N+1)]
for i, a in enumerate(A[::-1], 1):
mrs[i] = max(mrs[i-1], a)
mrs = mrs[::-1]
for i in range(N):
print((max(ml... | N = int(eval(input()))
A = [int(eval(input())) for _ in range(N)]
m1, m2 = sorted(A, reverse=True)[0:2]
for a in A:
print((m2 if a == m1 else m1)) | 14 | 6 | 324 | 142 | N = int(eval(input()))
A = [int(eval(input())) for _ in range(N)]
mls = [-1 for _ in range(N + 1)]
for i, a in enumerate(A, 1):
mls[i] = max(mls[i - 1], a)
mrs = [-1 for _ in range(N + 1)]
for i, a in enumerate(A[::-1], 1):
mrs[i] = max(mrs[i - 1], a)
mrs = mrs[::-1]
for i in range(N):
print((max(mls[i], mr... | N = int(eval(input()))
A = [int(eval(input())) for _ in range(N)]
m1, m2 = sorted(A, reverse=True)[0:2]
for a in A:
print((m2 if a == m1 else m1))
| false | 57.142857 | [
"-mls = [-1 for _ in range(N + 1)]",
"-for i, a in enumerate(A, 1):",
"- mls[i] = max(mls[i - 1], a)",
"-mrs = [-1 for _ in range(N + 1)]",
"-for i, a in enumerate(A[::-1], 1):",
"- mrs[i] = max(mrs[i - 1], a)",
"-mrs = mrs[::-1]",
"-for i in range(N):",
"- print((max(mls[i], mrs[i + 1])))"... | false | 0.035212 | 0.036247 | 0.971456 | [
"s346102656",
"s758275355"
] |
u984276646 | p02792 | python | s061612314 | s017809879 | 302 | 199 | 10,756 | 3,060 | Accepted | Accepted | 34.11 | N = int(eval(input()))
D = {i: [0] for i in range(100)}
for i in range(1, N+1):
if i % 10 != 0:
s = str(i)
D[int(s[0])*10+int(s[-1])][0] += 1
D[int(s[0])*10+int(s[-1])].append(i)
S = 0
for i in range(10):
for j in range(10):
S += D[i*10+j][0] * D[j*10+i][0]
print(S) | N = int(eval(input()))
D = {i: 0 for i in range(100)}
for i in range(1, N+1):
if i % 10 != 0:
s = str(i)
D[int(s[0])*10+int(s[-1])] += 1
S = 0
for i in range(10):
for j in range(10):
S += D[i*10+j] * D[j*10+i]
print(S) | 12 | 11 | 291 | 238 | N = int(eval(input()))
D = {i: [0] for i in range(100)}
for i in range(1, N + 1):
if i % 10 != 0:
s = str(i)
D[int(s[0]) * 10 + int(s[-1])][0] += 1
D[int(s[0]) * 10 + int(s[-1])].append(i)
S = 0
for i in range(10):
for j in range(10):
S += D[i * 10 + j][0] * D[j * 10 + i][0]
prin... | N = int(eval(input()))
D = {i: 0 for i in range(100)}
for i in range(1, N + 1):
if i % 10 != 0:
s = str(i)
D[int(s[0]) * 10 + int(s[-1])] += 1
S = 0
for i in range(10):
for j in range(10):
S += D[i * 10 + j] * D[j * 10 + i]
print(S)
| false | 8.333333 | [
"-D = {i: [0] for i in range(100)}",
"+D = {i: 0 for i in range(100)}",
"- D[int(s[0]) * 10 + int(s[-1])][0] += 1",
"- D[int(s[0]) * 10 + int(s[-1])].append(i)",
"+ D[int(s[0]) * 10 + int(s[-1])] += 1",
"- S += D[i * 10 + j][0] * D[j * 10 + i][0]",
"+ S += D[i * 10 + j... | false | 0.093748 | 0.076065 | 1.232471 | [
"s061612314",
"s017809879"
] |
u083960235 | p03578 | python | s754082064 | s610226512 | 391 | 312 | 58,812 | 68,380 | Accepted | Accepted | 20.2 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii... | 37 | 37 | 973 | 986 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... | false | 0 | [
"+from bisect import bisect, bisect_left, bisect_right",
"-a = Counter(D)",
"-b = Counter(T)",
"-# print(a)",
"-for d in T:",
"- if a[d] == 0:",
"+d = Counter(D)",
"+t = Counter(T)",
"+S = set(T)",
"+for s in S:",
"+ if d[s] >= t[s]:",
"+ continue",
"+ else:",
"- else:",... | false | 0.042961 | 0.069683 | 0.616515 | [
"s754082064",
"s610226512"
] |
u573754721 | p02787 | python | s101209600 | s269475347 | 1,317 | 416 | 69,092 | 42,348 | Accepted | Accepted | 68.41 | import sys
input = sys.stdin.buffer.readline
h,n = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(n)]
inf=float("inf")
dp=[inf]*(h+1)
dp[0]=0
for a,b in AB:
for i in range(h):
if dp[i]!=float("inf"):
dp[min(i+a,h)]=min(dp[min(i+a,h)],dp[i... | h, n = list(map(int, input().split()))
A = []
B = []
for i in range(n):
a,b=list(map(int,input().split()))
A.append(a)
B.append(b)
Ama = max(A)
dp=[float("inf")]*(h+Ama+1)
dp[0]=0
for i in range(h+1):
for j in range(n):
dp[i+A[j]]=min(dp[i+A[j]],dp[i]+B[j])
print((min(dp[h:... | 17 | 17 | 347 | 310 | import sys
input = sys.stdin.buffer.readline
h, n = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(n)]
inf = float("inf")
dp = [inf] * (h + 1)
dp[0] = 0
for a, b in AB:
for i in range(h):
if dp[i] != float("inf"):
dp[min(i + a, h)] = min(dp[min(i + a, h)], ... | h, n = list(map(int, input().split()))
A = []
B = []
for i in range(n):
a, b = list(map(int, input().split()))
A.append(a)
B.append(b)
Ama = max(A)
dp = [float("inf")] * (h + Ama + 1)
dp[0] = 0
for i in range(h + 1):
for j in range(n):
dp[i + A[j]] = min(dp[i + A[j]], dp[i] + B[j])
print((min(dp... | false | 0 | [
"-import sys",
"-",
"-input = sys.stdin.buffer.readline",
"-AB = [list(map(int, input().split())) for _ in range(n)]",
"-inf = float(\"inf\")",
"-dp = [inf] * (h + 1)",
"+A = []",
"+B = []",
"+for i in range(n):",
"+ a, b = list(map(int, input().split()))",
"+ A.append(a)",
"+ B.appen... | false | 0.117546 | 0.112103 | 1.048547 | [
"s101209600",
"s269475347"
] |
u150985282 | p03478 | python | s522692907 | s543980334 | 32 | 29 | 3,060 | 3,064 | Accepted | Accepted | 9.38 | [N, A, B] = list(map(int, input().split(" ")))
n = 0
for i in range(1, N+1):
J = 0
for j in str(i):
J += int(j)
if A <= J and J <= B:
n += i
print(n) | [N, A, B] = list(map(int, input().split(" ")))
def numOfSumDigit(n):
sum = 0
while n > 0:
sum += n%10
n = int(n / 10)
return sum
total = 0
for i in range(1, N+1):
SUM = numOfSumDigit(i)
if A <= SUM and SUM <= B:
total += i
print(total) | 11 | 17 | 182 | 281 | [N, A, B] = list(map(int, input().split(" ")))
n = 0
for i in range(1, N + 1):
J = 0
for j in str(i):
J += int(j)
if A <= J and J <= B:
n += i
print(n)
| [N, A, B] = list(map(int, input().split(" ")))
def numOfSumDigit(n):
sum = 0
while n > 0:
sum += n % 10
n = int(n / 10)
return sum
total = 0
for i in range(1, N + 1):
SUM = numOfSumDigit(i)
if A <= SUM and SUM <= B:
total += i
print(total)
| false | 35.294118 | [
"-n = 0",
"+",
"+",
"+def numOfSumDigit(n):",
"+ sum = 0",
"+ while n > 0:",
"+ sum += n % 10",
"+ n = int(n / 10)",
"+ return sum",
"+",
"+",
"+total = 0",
"- J = 0",
"- for j in str(i):",
"- J += int(j)",
"- if A <= J and J <= B:",
"- n... | false | 0.042241 | 0.037342 | 1.131194 | [
"s522692907",
"s543980334"
] |
u285891772 | p03687 | python | s349755261 | s690014031 | 64 | 42 | 10,520 | 10,528 | Accepted | Accepted | 34.38 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemge... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upp... | 42 | 26 | 1,207 | 880 | import sys, re
from collections import deque, defaultdict, Counter
from math import (
ceil,
sqrt,
hypot,
factorial,
pi,
sin,
cos,
tan,
asin,
acos,
atan,
radians,
degrees,
log2,
gcd,
)
from itertools import (
accumulate,
permutations,
combinations,
... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase... | false | 38.095238 | [
"-from math import (",
"- ceil,",
"- sqrt,",
"- hypot,",
"- factorial,",
"- pi,",
"- sin,",
"- cos,",
"- tan,",
"- asin,",
"- acos,",
"- atan,",
"- radians,",
"- degrees,",
"- log2,",
"- gcd,",
"-)",
"-from itertools import (",
"- a... | false | 0.084124 | 0.044733 | 1.880605 | [
"s349755261",
"s690014031"
] |
u917558625 | p03964 | python | s099061194 | s047439755 | 31 | 28 | 9,216 | 9,260 | Accepted | Accepted | 9.68 | def gcd(x,y):
if y==0:
return x
else:
return gcd(y,x%y)
def lcm(x,y):
return x*y//gcd(x,y)
N=int(eval(input()))
x,y=0,0
for i in range(N):
p=0
T,A=list(map(int,input().split()))
if i==0:
x,y=T,A
continue
if x<=T and y<=A:
x,y=T,A
elif x<=T and A<y:
... | N=int(eval(input()))
x,y=0,0
for i in range(N):
p=0
T,A=list(map(int,input().split()))
if i==0:
x,y=T,A
continue
if x<=T and y<=A:
x,y=T,A
elif x<=T and A<y:
if y%A!=0:
p=1
x=T*(y//A+p)
y=A*(y//A+p)
elif T<x and y<=T:
if x%T!=0:
p=1
y=A*(x//T+p)
... | 39 | 32 | 653 | 527 | def gcd(x, y):
if y == 0:
return x
else:
return gcd(y, x % y)
def lcm(x, y):
return x * y // gcd(x, y)
N = int(eval(input()))
x, y = 0, 0
for i in range(N):
p = 0
T, A = list(map(int, input().split()))
if i == 0:
x, y = T, A
continue
if x <= T and y <= A:
... | N = int(eval(input()))
x, y = 0, 0
for i in range(N):
p = 0
T, A = list(map(int, input().split()))
if i == 0:
x, y = T, A
continue
if x <= T and y <= A:
x, y = T, A
elif x <= T and A < y:
if y % A != 0:
p = 1
x = T * (y // A + p)
y = A * (y... | false | 17.948718 | [
"-def gcd(x, y):",
"- if y == 0:",
"- return x",
"- else:",
"- return gcd(y, x % y)",
"-",
"-",
"-def lcm(x, y):",
"- return x * y // gcd(x, y)",
"-",
"-"
] | false | 0.047856 | 0.114106 | 0.419399 | [
"s099061194",
"s047439755"
] |
u118211443 | p03288 | python | s831095329 | s583424107 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | N=int(eval(input()))
if N<1200:
print("ABC")
elif N<2800:
print("ARC")
else:
print("AGC") | N=int(eval(input()))
print(("ABC" if N<1200 else("ARC" if N<2800 else "AGC"))) | 7 | 2 | 101 | 71 | N = int(eval(input()))
if N < 1200:
print("ABC")
elif N < 2800:
print("ARC")
else:
print("AGC")
| N = int(eval(input()))
print(("ABC" if N < 1200 else ("ARC" if N < 2800 else "AGC")))
| false | 71.428571 | [
"-if N < 1200:",
"- print(\"ABC\")",
"-elif N < 2800:",
"- print(\"ARC\")",
"-else:",
"- print(\"AGC\")",
"+print((\"ABC\" if N < 1200 else (\"ARC\" if N < 2800 else \"AGC\")))"
] | false | 0.051581 | 0.14789 | 0.348778 | [
"s831095329",
"s583424107"
] |
u179169725 | p03013 | python | s703493716 | s455496434 | 1,140 | 438 | 13,264 | 17,820 | Accepted | Accepted | 61.58 | # https://atcoder.jp/contests/abc129/tasks/abc129_c
# 典型的なDP
MOD = 10**9 + 7
import numpy as np
# dp[i]をi段目までの通りの数とする。
N, M = list(map(int, input().split()))
to_zero = np.full((N + 1), False, dtype=bool)
for _ in range(M):
to_zero[int(eval(input()))] = True # 床が抜けているところ
# dpテーブルの用意
dp = np.full((N + ... | # https://atcoder.jp/contests/abc129/tasks/abc129_c
# 典型的なDP
MOD = 10**9 + 7
import numpy as np
# dp[i]をi段目までの通りの数とする。
N, M = list(map(int, input().split()))
to_zero = np.full((N + 1), False, dtype=bool)
for _ in range(M):
to_zero[int(eval(input()))] = True # 床が抜けているところ
# dpテーブルの用意
dp = np.full((N + ... | 21 | 21 | 521 | 523 | # https://atcoder.jp/contests/abc129/tasks/abc129_c
# 典型的なDP
MOD = 10**9 + 7
import numpy as np
# dp[i]をi段目までの通りの数とする。
N, M = list(map(int, input().split()))
to_zero = np.full((N + 1), False, dtype=bool)
for _ in range(M):
to_zero[int(eval(input()))] = True # 床が抜けているところ
# dpテーブルの用意
dp = np.full((N + 1), -1, dtype... | # https://atcoder.jp/contests/abc129/tasks/abc129_c
# 典型的なDP
MOD = 10**9 + 7
import numpy as np
# dp[i]をi段目までの通りの数とする。
N, M = list(map(int, input().split()))
to_zero = np.full((N + 1), False, dtype=bool)
for _ in range(M):
to_zero[int(eval(input()))] = True # 床が抜けているところ
# dpテーブルの用意
dp = np.full((N + 1), -1, dtype... | false | 0 | [
"- dp[i] = 0 if to_zero[i] else dp[(i - 2) : i].sum()",
"+ dp[i] = 0 if to_zero[i] else dp[i - 2] + dp[i - 1]"
] | false | 0.308484 | 0.215711 | 1.43008 | [
"s703493716",
"s455496434"
] |
u291543340 | p02702 | python | s113618269 | s353953800 | 102 | 71 | 74,108 | 74,212 | Accepted | Accepted | 30.39 | # import itertools
S = input()[::-1]
# l = len(S)
# nums = range(1, l+1)
count = [0]*2019
count[0] = 1
num = 0
d = 1
for i in S:
num += int(i)*d
count[num % 2019] += 1
d *= 10
d %= 2019
ans = 0
for i in count:
ans += i*(i-1)//2
print(ans)
| # import itertools
S = input()[::-1]
# l = len(S)
# nums = range(1, l+1)
count = [0]*2019
count[0] = 1
num = 0
d = 1
for i in S:
num += int(i)*d
num %= 2019
count[num] += 1
d *= 10
d %= 2019
ans = 0
for i in count:
ans += i*(i-1)//2
print(ans)
| 18 | 19 | 277 | 287 | # import itertools
S = input()[::-1]
# l = len(S)
# nums = range(1, l+1)
count = [0] * 2019
count[0] = 1
num = 0
d = 1
for i in S:
num += int(i) * d
count[num % 2019] += 1
d *= 10
d %= 2019
ans = 0
for i in count:
ans += i * (i - 1) // 2
print(ans)
| # import itertools
S = input()[::-1]
# l = len(S)
# nums = range(1, l+1)
count = [0] * 2019
count[0] = 1
num = 0
d = 1
for i in S:
num += int(i) * d
num %= 2019
count[num] += 1
d *= 10
d %= 2019
ans = 0
for i in count:
ans += i * (i - 1) // 2
print(ans)
| false | 5.263158 | [
"- count[num % 2019] += 1",
"+ num %= 2019",
"+ count[num] += 1"
] | false | 0.088082 | 0.067369 | 1.30746 | [
"s113618269",
"s353953800"
] |
u476383383 | p02900 | python | s786768186 | s610716570 | 130 | 117 | 3,956 | 3,700 | Accepted | Accepted | 10 | import sys
from bisect import *
from collections import *
from copy import deepcopy
from heapq import *
from itertools import *
from math import *
from operator import *
from pprint import *
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
def gcd(a, b):
while b:
a, b = b, a%b
... | import sys
from bisect import *
from collections import *
from copy import deepcopy
from heapq import *
from itertools import *
from math import *
from operator import *
from pprint import *
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
def factorize(n):
res = []
for i in range(2,in... | 52 | 39 | 1,039 | 762 | import sys
from bisect import *
from collections import *
from copy import deepcopy
from heapq import *
from itertools import *
from math import *
from operator import *
from pprint import *
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
def gcd(a, b):
while b:
a, b = b, a % b
return a
def... | import sys
from bisect import *
from collections import *
from copy import deepcopy
from heapq import *
from itertools import *
from math import *
from operator import *
from pprint import *
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
def factorize(n):
res = []
for i in range(2, int(n**0.5) + 1):... | false | 25 | [
"+def factorize(n):",
"+ res = []",
"+ for i in range(2, int(n**0.5) + 1):",
"+ if n % i == 0:",
"+ cnt = 0",
"+ while n % i == 0:",
"+ n //= i",
"+ cnt += 1",
"+ res.append((i, cnt))",
"+ if n > 1:",
"+ res.ap... | false | 0.035504 | 0.037045 | 0.95841 | [
"s786768186",
"s610716570"
] |
u494058663 | p02791 | python | s968478864 | s247670583 | 236 | 136 | 24,744 | 32,272 | Accepted | Accepted | 42.37 | N = int(eval(input()))
Num = [int(i) for i in input().split()]
Max = Num[0]
Min = Num[0]
cnt = 1
for i in range(1,N):
if Num[i] <= Max and Min>=Num[i] :
cnt +=1
Max = max(Max,Num[i])
Min = min(Min,Num[i])
#print(Max,Min)
print(cnt)
| def main():
n = int(eval(input()))
p = [int(i) for i in input().split()]
Min = [10**9]
ans = 0
for i in range(n):
Min.append(min(Min[-1],p[i]))
for i in range(n):
if Min[i]>p[i]:
ans += 1
print(ans)
main() | 14 | 12 | 275 | 266 | N = int(eval(input()))
Num = [int(i) for i in input().split()]
Max = Num[0]
Min = Num[0]
cnt = 1
for i in range(1, N):
if Num[i] <= Max and Min >= Num[i]:
cnt += 1
Max = max(Max, Num[i])
Min = min(Min, Num[i])
# print(Max,Min)
print(cnt)
| def main():
n = int(eval(input()))
p = [int(i) for i in input().split()]
Min = [10**9]
ans = 0
for i in range(n):
Min.append(min(Min[-1], p[i]))
for i in range(n):
if Min[i] > p[i]:
ans += 1
print(ans)
main()
| false | 14.285714 | [
"-N = int(eval(input()))",
"-Num = [int(i) for i in input().split()]",
"-Max = Num[0]",
"-Min = Num[0]",
"-cnt = 1",
"-for i in range(1, N):",
"- if Num[i] <= Max and Min >= Num[i]:",
"- cnt += 1",
"- Max = max(Max, Num[i])",
"- Min = min(Min, Num[i])",
"- # print(Max,Min)",
... | false | 0.040874 | 0.042589 | 0.959743 | [
"s968478864",
"s247670583"
] |
u098994567 | p02657 | python | s258401858 | s562222668 | 30 | 27 | 9,044 | 8,992 | Accepted | Accepted | 10 | # 169A
# 値 A × B を整数として出力せよ。
# 1.標準入力をプログラムで扱えるように受け取る
a, b = list(map(int, input().split()))
# print(a, b)
# 2.受け取った入力値を使って、適切に処理(計算)する
answer = a * b
# 3.計算結果を出力する
print(answer)
| # A × B を求めてください。
# 制約
# 1 ≤ A ≤ 100
# 1 ≤ B ≤ 100
# 入力は全て整数である。
# 標準入力からA、Bを取得する
a, b = list(map(int, input().split()))
# A x B を計算し、出力する
result = a * b
print(result)
| 12 | 14 | 188 | 179 | # 169A
# 値 A × B を整数として出力せよ。
# 1.標準入力をプログラムで扱えるように受け取る
a, b = list(map(int, input().split()))
# print(a, b)
# 2.受け取った入力値を使って、適切に処理(計算)する
answer = a * b
# 3.計算結果を出力する
print(answer)
| # A × B を求めてください。
# 制約
# 1 ≤ A ≤ 100
# 1 ≤ B ≤ 100
# 入力は全て整数である。
# 標準入力からA、Bを取得する
a, b = list(map(int, input().split()))
# A x B を計算し、出力する
result = a * b
print(result)
| false | 14.285714 | [
"-# 169A",
"-# 値 A × B を整数として出力せよ。",
"-# 1.標準入力をプログラムで扱えるように受け取る",
"+# A × B を求めてください。",
"+# 制約",
"+# 1 ≤ A ≤ 100",
"+# 1 ≤ B ≤ 100",
"+# 入力は全て整数である。",
"+# 標準入力からA、Bを取得する",
"-# print(a, b)",
"-# 2.受け取った入力値を使って、適切に処理(計算)する",
"-answer = a * b",
"-# 3.計算結果を出力する",
"-print(answer)",
"+# A x B... | false | 0.047626 | 0.047109 | 1.010961 | [
"s258401858",
"s562222668"
] |
u499381410 | p02744 | python | s778876664 | s374037696 | 1,385 | 385 | 120,324 | 58,200 | Accepted | Accepted | 72.2 | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import... | 55 | 38 | 1,580 | 1,272 | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factori... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factori... | false | 30.909091 | [
"-L = [[[0]]]",
"-for i in range(1, n):",
"- new_L = []",
"- for each_type in L:",
"- new_L += [each_type + [[i]]]",
"- for j in range(len(each_type)):",
"- new_type = deepcopy(each_type)",
"- new_type[j] += [i]",
"- new_L += [new_type]",
"- ... | false | 0.070506 | 0.074512 | 0.946244 | [
"s778876664",
"s374037696"
] |
u893063840 | p03732 | python | s108957548 | s924168815 | 661 | 263 | 31,656 | 3,064 | Accepted | Accepted | 60.21 | n, W = list(map(int, input().split()))
wv = [list(map(int, input().split())) for _ in range(n)]
dp = [[[-1] * (3 * n + 1) for _ in range(n + 1)] for _ in range(n + 1)]
dp[0][0][0] = 0
w1 = wv[0][0]
for i, (w, v) in enumerate(wv):
for j in range(i + 1):
for k in range(3 * n + 1):
if d... | from itertools import accumulate
n, W = list(map(int, input().split()))
wv = [list(map(int, input().split())) for _ in range(n)]
w1 = wv[0][0]
weights = [[] for _ in range(4)]
for w, v in wv:
w_diff = w - w1
weights[w_diff].append(v)
for i in range(4):
weights[i].sort(reverse=True)
acc =... | 23 | 26 | 739 | 676 | n, W = list(map(int, input().split()))
wv = [list(map(int, input().split())) for _ in range(n)]
dp = [[[-1] * (3 * n + 1) for _ in range(n + 1)] for _ in range(n + 1)]
dp[0][0][0] = 0
w1 = wv[0][0]
for i, (w, v) in enumerate(wv):
for j in range(i + 1):
for k in range(3 * n + 1):
if dp[i][j][k] !... | from itertools import accumulate
n, W = list(map(int, input().split()))
wv = [list(map(int, input().split())) for _ in range(n)]
w1 = wv[0][0]
weights = [[] for _ in range(4)]
for w, v in wv:
w_diff = w - w1
weights[w_diff].append(v)
for i in range(4):
weights[i].sort(reverse=True)
acc = [[0] + list(accumu... | false | 11.538462 | [
"+from itertools import accumulate",
"+",
"-dp = [[[-1] * (3 * n + 1) for _ in range(n + 1)] for _ in range(n + 1)]",
"-dp[0][0][0] = 0",
"-for i, (w, v) in enumerate(wv):",
"- for j in range(i + 1):",
"- for k in range(3 * n + 1):",
"- if dp[i][j][k] != -1:",
"- ... | false | 0.073629 | 0.093148 | 0.790445 | [
"s108957548",
"s924168815"
] |
u994988729 | p03817 | python | s155579451 | s426756233 | 19 | 17 | 3,064 | 2,940 | Accepted | Accepted | 10.53 | X = int(eval(input()))
d, m = divmod(X, 11)
ans = 2 * d
if m > 6:
ans += 2
elif m > 0:
ans += 1
print(ans) | X = int(eval(input()))
d, m = divmod(X, 11)
d *= 2
if m > 6:
d += 2
elif m > 0:
d += 1
print(d) | 11 | 9 | 121 | 106 | X = int(eval(input()))
d, m = divmod(X, 11)
ans = 2 * d
if m > 6:
ans += 2
elif m > 0:
ans += 1
print(ans)
| X = int(eval(input()))
d, m = divmod(X, 11)
d *= 2
if m > 6:
d += 2
elif m > 0:
d += 1
print(d)
| false | 18.181818 | [
"-ans = 2 * d",
"+d *= 2",
"- ans += 2",
"+ d += 2",
"- ans += 1",
"-print(ans)",
"+ d += 1",
"+print(d)"
] | false | 0.197181 | 0.080616 | 2.445913 | [
"s155579451",
"s426756233"
] |
u879870653 | p03032 | python | s740144851 | s412084739 | 34 | 31 | 3,064 | 3,064 | Accepted | Accepted | 8.82 | import bisect
N,K = list(map(int,input().split()))
V = list(map(int,input().split()))
ans = 0
if N < K :
pp = K
K = N
else :
pp = K
for a in range(1,K+1) :
for i in range(a+1) :
G = []
G.extend(V[:i])
G.extend(V[len(V)-(a-i):])
G.append(0)
G =... | N,K = list(map(int,input().split()))
V = list(map(int,input().split()))
ans = 0
P = min(N,K)
for a in range(1,P+1) :
for i in range(a+1) :
cnt = 0
calc = 0
GET = V[:i] + V[N-(a-i):]
GET = sorted(GET)
for g in GET :
if (g < 0) and (cnt < ... | 37 | 22 | 707 | 446 | import bisect
N, K = list(map(int, input().split()))
V = list(map(int, input().split()))
ans = 0
if N < K:
pp = K
K = N
else:
pp = K
for a in range(1, K + 1):
for i in range(a + 1):
G = []
G.extend(V[:i])
G.extend(V[len(V) - (a - i) :])
G.append(0)
G = sorted(G)
... | N, K = list(map(int, input().split()))
V = list(map(int, input().split()))
ans = 0
P = min(N, K)
for a in range(1, P + 1):
for i in range(a + 1):
cnt = 0
calc = 0
GET = V[:i] + V[N - (a - i) :]
GET = sorted(GET)
for g in GET:
if (g < 0) and (cnt < K - a):
... | false | 40.540541 | [
"-import bisect",
"-",
"-if N < K:",
"- pp = K",
"- K = N",
"-else:",
"- pp = K",
"-for a in range(1, K + 1):",
"+P = min(N, K)",
"+for a in range(1, P + 1):",
"- G = []",
"- G.extend(V[:i])",
"- G.extend(V[len(V) - (a - i) :])",
"- G.append(0)",
"- ... | false | 0.037049 | 0.047964 | 0.772424 | [
"s740144851",
"s412084739"
] |
u759412327 | p03457 | python | s710215779 | s617502557 | 329 | 290 | 3,060 | 27,840 | Accepted | Accepted | 11.85 | for i in range(int(eval(input()))):
t,x,y=list(map(int,input().split()))
if(t+x+y)%2+(t<x+y):
print("No")
exit()
print("Yes") | N = int(eval(input()))
P = [[0,0,0]]+[list(map(int,input().split())) for n in range(N)]
ans = "Yes"
for n in range(N):
dt = P[n+1][0]-P[n][0]
dx = abs(P[n+1][1]-P[n][1])
dy = abs(P[n+1][2]-P[n][2])
if dt<dx+dy or dt%2!=(dx+dy)%2:
ans = "No"
print(ans) | 6 | 12 | 130 | 271 | for i in range(int(eval(input()))):
t, x, y = list(map(int, input().split()))
if (t + x + y) % 2 + (t < x + y):
print("No")
exit()
print("Yes")
| N = int(eval(input()))
P = [[0, 0, 0]] + [list(map(int, input().split())) for n in range(N)]
ans = "Yes"
for n in range(N):
dt = P[n + 1][0] - P[n][0]
dx = abs(P[n + 1][1] - P[n][1])
dy = abs(P[n + 1][2] - P[n][2])
if dt < dx + dy or dt % 2 != (dx + dy) % 2:
ans = "No"
print(ans)
| false | 50 | [
"-for i in range(int(eval(input()))):",
"- t, x, y = list(map(int, input().split()))",
"- if (t + x + y) % 2 + (t < x + y):",
"- print(\"No\")",
"- exit()",
"-print(\"Yes\")",
"+N = int(eval(input()))",
"+P = [[0, 0, 0]] + [list(map(int, input().split())) for n in range(N)]",
"+a... | false | 0.038706 | 0.045688 | 0.847173 | [
"s710215779",
"s617502557"
] |
u780962115 | p03633 | python | s044028423 | s784240671 | 41 | 36 | 5,432 | 5,048 | Accepted | Accepted | 12.2 | #早くmathを導入してほしい
from fractions import gcd
n=int(eval(input()))
glm=1
for i in range(n):
nums=int(eval(input()))
glm=int(glm*nums//gcd(nums,glm))
print(glm) | n=int(eval(input()))
lists=[]
for i in range(n):
a=int(eval(input()))
lists.append(a)
#Nこの連続した数の最大公約数、最小公倍数を求めるアルゴリズム
import math
import fractions
#最小公倍数
def union_lcm(lists):
if len(lists)==1:
return lists[0]
elif len(lists)>1:
num=lists[0]
for i in range(1,len(lists... | 8 | 20 | 158 | 420 | # 早くmathを導入してほしい
from fractions import gcd
n = int(eval(input()))
glm = 1
for i in range(n):
nums = int(eval(input()))
glm = int(glm * nums // gcd(nums, glm))
print(glm)
| n = int(eval(input()))
lists = []
for i in range(n):
a = int(eval(input()))
lists.append(a)
# Nこの連続した数の最大公約数、最小公倍数を求めるアルゴリズム
import math
import fractions
# 最小公倍数
def union_lcm(lists):
if len(lists) == 1:
return lists[0]
elif len(lists) > 1:
num = lists[0]
for i in range(1, len(l... | false | 60 | [
"-# 早くmathを導入してほしい",
"-from fractions import gcd",
"+n = int(eval(input()))",
"+lists = []",
"+for i in range(n):",
"+ a = int(eval(input()))",
"+ lists.append(a)",
"+# Nこの連続した数の最大公約数、最小公倍数を求めるアルゴリズム",
"+import math",
"+import fractions",
"-n = int(eval(input()))",
"-glm = 1",
"-for i ... | false | 0.142566 | 0.052531 | 2.71392 | [
"s044028423",
"s784240671"
] |
u623814058 | p02658 | python | s265907582 | s156910653 | 66 | 57 | 21,476 | 21,624 | Accepted | Accepted | 13.64 | N=int(eval(input()))
X=list(map(int, input().split()))
ans=1
if 0 in X:
print((0))
else:
X.sort()
for i in X:
ans *= i
if 1e18<ans:
print((-1))
break
else:
print(ans) | N=int(eval(input()))
X=list(map(int, input().split()))
ans=1
if 0 in X:
print((0))
else:
for i in X:
ans *= i
if 1e18<ans:
print((-1))
break
else:
print(ans) | 15 | 14 | 239 | 225 | N = int(eval(input()))
X = list(map(int, input().split()))
ans = 1
if 0 in X:
print((0))
else:
X.sort()
for i in X:
ans *= i
if 1e18 < ans:
print((-1))
break
else:
print(ans)
| N = int(eval(input()))
X = list(map(int, input().split()))
ans = 1
if 0 in X:
print((0))
else:
for i in X:
ans *= i
if 1e18 < ans:
print((-1))
break
else:
print(ans)
| false | 6.666667 | [
"- X.sort()"
] | false | 0.045733 | 0.038894 | 1.175854 | [
"s265907582",
"s156910653"
] |
u159994501 | p03338 | python | s820266169 | s526184999 | 22 | 18 | 3,316 | 2,940 | Accepted | Accepted | 18.18 | import collections
N = int(eval(input()))
S = list(eval(input()))
m = 0
for i in range(1, N):
A = S[:i]
B = S[i:]
m = max(m, len(collections.Counter(A))+len(collections.Counter(B)))
print((m - len(collections.Counter(S))))
| N = int(eval(input()))
S = eval(input())
ans = 0
for i in range(1, N):
x = set(S[:i])
t_ans = 0
for j in x:
if j in S[i:]:
t_ans += 1
ans = max(t_ans, ans)
print(ans)
| 9 | 11 | 229 | 201 | import collections
N = int(eval(input()))
S = list(eval(input()))
m = 0
for i in range(1, N):
A = S[:i]
B = S[i:]
m = max(m, len(collections.Counter(A)) + len(collections.Counter(B)))
print((m - len(collections.Counter(S))))
| N = int(eval(input()))
S = eval(input())
ans = 0
for i in range(1, N):
x = set(S[:i])
t_ans = 0
for j in x:
if j in S[i:]:
t_ans += 1
ans = max(t_ans, ans)
print(ans)
| false | 18.181818 | [
"-import collections",
"-",
"-S = list(eval(input()))",
"-m = 0",
"+S = eval(input())",
"+ans = 0",
"- A = S[:i]",
"- B = S[i:]",
"- m = max(m, len(collections.Counter(A)) + len(collections.Counter(B)))",
"-print((m - len(collections.Counter(S))))",
"+ x = set(S[:i])",
"+ t_ans ... | false | 0.044296 | 0.044762 | 0.989591 | [
"s820266169",
"s526184999"
] |
u877415670 | p02691 | python | s284718594 | s220761372 | 462 | 276 | 169,228 | 169,716 | Accepted | Accepted | 40.26 | from collections import defaultdict
n=int(eval(input()))
a=list(map(int,input().split()))
d1=defaultdict(int)
d2=defaultdict(int)
ans=0
for g in range(n):
ans+=d1[a[g]-g]
ans+=d2[a[g]+g]
d1[-a[g]-g]+=1
d2[-a[g]+1]+=1
print(ans) | from collections import defaultdict
n=int(eval(input()))
a=list(map(int,input().split()))
d1=defaultdict(int)
d2=defaultdict(int)
ans=0
for g in range(n):
ans+=d1[a[g]-g]
ans+=d2[a[g]+g]
d1[-a[g]-g]+=1
d2[-a[g]+g]+=1
print(ans) | 13 | 13 | 250 | 250 | from collections import defaultdict
n = int(eval(input()))
a = list(map(int, input().split()))
d1 = defaultdict(int)
d2 = defaultdict(int)
ans = 0
for g in range(n):
ans += d1[a[g] - g]
ans += d2[a[g] + g]
d1[-a[g] - g] += 1
d2[-a[g] + 1] += 1
print(ans)
| from collections import defaultdict
n = int(eval(input()))
a = list(map(int, input().split()))
d1 = defaultdict(int)
d2 = defaultdict(int)
ans = 0
for g in range(n):
ans += d1[a[g] - g]
ans += d2[a[g] + g]
d1[-a[g] - g] += 1
d2[-a[g] + g] += 1
print(ans)
| false | 0 | [
"- d2[-a[g] + 1] += 1",
"+ d2[-a[g] + g] += 1"
] | false | 0.034996 | 0.038797 | 0.902025 | [
"s284718594",
"s220761372"
] |
u821588465 | p03796 | python | s597820905 | s008305906 | 232 | 40 | 4,020 | 2,940 | Accepted | Accepted | 82.76 | import math
print((math.factorial(int(eval(input())))%(10**9+7))) | n = int(eval(input()))
ans = 1
for i in range(1, n +1):
ans*= i
ans = ans % (10**9 + 7)
print(ans) | 2 | 6 | 58 | 105 | import math
print((math.factorial(int(eval(input()))) % (10**9 + 7)))
| n = int(eval(input()))
ans = 1
for i in range(1, n + 1):
ans *= i
ans = ans % (10**9 + 7)
print(ans)
| false | 66.666667 | [
"-import math",
"-",
"-print((math.factorial(int(eval(input()))) % (10**9 + 7)))",
"+n = int(eval(input()))",
"+ans = 1",
"+for i in range(1, n + 1):",
"+ ans *= i",
"+ ans = ans % (10**9 + 7)",
"+print(ans)"
] | false | 0.098406 | 0.044317 | 2.220522 | [
"s597820905",
"s008305906"
] |
u620084012 | p03472 | python | s951817402 | s809258709 | 387 | 293 | 12,124 | 47,408 | Accepted | Accepted | 24.29 | # ABC 085 D
import bisect, math
N, H = list(map(int, input().split()))
a = []
b = []
for k in range(N):
x, y = list(map(int, input().split()))
a.append(x)
b.append(y)
a = sorted(a)
b = sorted(b)
l = N - bisect.bisect_left(b,a[-1])
b = b[::-1]
ans = 0
for k in range(l):
ans += 1
H... | import math, sys
def input():
return sys.stdin.readline()[:-1]
def main():
N, H = list(map(int,input().split()))
A = [0 for k in range(N)]
B = [0 for k in range(N)]
for k in range(N):
a, b = list(map(int,input().split()))
A[k] = a
B[k] = b
A = sorted(A)[::-... | 24 | 29 | 405 | 615 | # ABC 085 D
import bisect, math
N, H = list(map(int, input().split()))
a = []
b = []
for k in range(N):
x, y = list(map(int, input().split()))
a.append(x)
b.append(y)
a = sorted(a)
b = sorted(b)
l = N - bisect.bisect_left(b, a[-1])
b = b[::-1]
ans = 0
for k in range(l):
ans += 1
H -= b[k]
if H ... | import math, sys
def input():
return sys.stdin.readline()[:-1]
def main():
N, H = list(map(int, input().split()))
A = [0 for k in range(N)]
B = [0 for k in range(N)]
for k in range(N):
a, b = list(map(int, input().split()))
A[k] = a
B[k] = b
A = sorted(A)[::-1]
m ... | false | 17.241379 | [
"-# ABC 085 D",
"-import bisect, math",
"+import math, sys",
"-N, H = list(map(int, input().split()))",
"-a = []",
"-b = []",
"-for k in range(N):",
"- x, y = list(map(int, input().split()))",
"- a.append(x)",
"- b.append(y)",
"-a = sorted(a)",
"-b = sorted(b)",
"-l = N - bisect.bis... | false | 0.035501 | 0.054033 | 0.657021 | [
"s951817402",
"s809258709"
] |
u301624971 | p03043 | python | s069336995 | s810436114 | 48 | 30 | 2,940 | 3,064 | Accepted | Accepted | 37.5 | N,K=list(map(int,input().split(" ")))
cnt=0
kaku=0
for i in range(1,N+1):
total=i
while(total < K):
cnt+=1
total*=2
kaku+=1/N * (1/2)**cnt
cnt=0
print(kaku) | def myAnswer(N:int,K:int) -> int:
ans = 0
for n in range(1,N+1):
sub = K - n
counter = 0
total = n
if(total >= K):
ans += 1/N
continue
while True:
total *= 2
counter += 1
if(total >= K):
break
ans += 1/N * (... | 14 | 24 | 202 | 493 | N, K = list(map(int, input().split(" ")))
cnt = 0
kaku = 0
for i in range(1, N + 1):
total = i
while total < K:
cnt += 1
total *= 2
kaku += 1 / N * (1 / 2) ** cnt
cnt = 0
print(kaku)
| def myAnswer(N: int, K: int) -> int:
ans = 0
for n in range(1, N + 1):
sub = K - n
counter = 0
total = n
if total >= K:
ans += 1 / N
continue
while True:
total *= 2
counter += 1
if total >= K:
bre... | false | 41.666667 | [
"-N, K = list(map(int, input().split(\" \")))",
"-cnt = 0",
"-kaku = 0",
"-for i in range(1, N + 1):",
"- total = i",
"- while total < K:",
"- cnt += 1",
"- total *= 2",
"- kaku += 1 / N * (1 / 2) ** cnt",
"- cnt = 0",
"-print(kaku)",
"+def myAnswer(N: int, K: int) ->... | false | 0.055582 | 0.045536 | 1.220614 | [
"s069336995",
"s810436114"
] |
u073852194 | p03805 | python | s415256878 | s151265966 | 34 | 23 | 3,064 | 3,064 | Accepted | Accepted | 32.35 | class Graph(): #non-directed
def __init__(self,n,edge):
self.n = n
self.graph = [[] for _ in range(n)]
self.deg = [0 for _ in range(n)]
for e in edge:
self.graph[e[0] - 1].append(e[1] - 1)
self.graph[e[1] - 1].append(e[0] - 1)
self.deg[e[0]... | N, M = list(map(int, input().split()))
E = [tuple(map(int, input().split())) for _ in range(M)]
graph = [[0 for j in range(N)] for i in range(N)]
for e in E:
graph[e[0] - 1][e[1] - 1] = 1
graph[e[1] - 1][e[0] - 1] = 1
res = 0
dp = [[0 for j in range(N)] for i in range(2**N)]
dp[1][0] = 1
for ... | 29 | 21 | 733 | 504 | class Graph: # non-directed
def __init__(self, n, edge):
self.n = n
self.graph = [[] for _ in range(n)]
self.deg = [0 for _ in range(n)]
for e in edge:
self.graph[e[0] - 1].append(e[1] - 1)
self.graph[e[1] - 1].append(e[0] - 1)
self.deg[e[0] - 1] ... | N, M = list(map(int, input().split()))
E = [tuple(map(int, input().split())) for _ in range(M)]
graph = [[0 for j in range(N)] for i in range(N)]
for e in E:
graph[e[0] - 1][e[1] - 1] = 1
graph[e[1] - 1][e[0] - 1] = 1
res = 0
dp = [[0 for j in range(N)] for i in range(2**N)]
dp[1][0] = 1
for i in range(2**N):
... | false | 27.586207 | [
"-class Graph: # non-directed",
"- def __init__(self, n, edge):",
"- self.n = n",
"- self.graph = [[] for _ in range(n)]",
"- self.deg = [0 for _ in range(n)]",
"- for e in edge:",
"- self.graph[e[0] - 1].append(e[1] - 1)",
"- self.graph[e[1] - 1].... | false | 0.257122 | 0.07262 | 3.540668 | [
"s415256878",
"s151265966"
] |
u711539583 | p03103 | python | s266953671 | s452103750 | 564 | 487 | 27,760 | 27,884 | Accepted | Accepted | 13.65 | n, m = list(map(int, input().split()))
a = []
for _ in range(n):
a.append(list(map(int, input().split())))
a.sort()
pm = s = 0
for item in a:
if pm + item[1] >= m:
print((s + item[0] * (m - pm)))
break
else:
pm += item[1]
s += item[0] * item[1]
| n, m = list(map(int, input().split()))
a = []
for _ in range(n):
a.append(list(map(int, input().split())))
a.sort()
pm = s = 0
m_minus_1 = m - 1
for item in a:
tmp = pm + item[1]
if tmp > m_minus_1:
print((s + item[0] * (m - pm)))
break
else:
pm = tmp
s += i... | 13 | 15 | 293 | 329 | n, m = list(map(int, input().split()))
a = []
for _ in range(n):
a.append(list(map(int, input().split())))
a.sort()
pm = s = 0
for item in a:
if pm + item[1] >= m:
print((s + item[0] * (m - pm)))
break
else:
pm += item[1]
s += item[0] * item[1]
| n, m = list(map(int, input().split()))
a = []
for _ in range(n):
a.append(list(map(int, input().split())))
a.sort()
pm = s = 0
m_minus_1 = m - 1
for item in a:
tmp = pm + item[1]
if tmp > m_minus_1:
print((s + item[0] * (m - pm)))
break
else:
pm = tmp
s += item[0] * item[... | false | 13.333333 | [
"+m_minus_1 = m - 1",
"- if pm + item[1] >= m:",
"+ tmp = pm + item[1]",
"+ if tmp > m_minus_1:",
"- pm += item[1]",
"+ pm = tmp"
] | false | 0.045825 | 0.046878 | 0.977536 | [
"s266953671",
"s452103750"
] |
u983918956 | p03476 | python | s064710810 | s125311921 | 760 | 590 | 32,400 | 32,212 | Accepted | Accepted | 22.37 | import math
import itertools
Q = int(eval(input()))
query = [list(map(int,input().split())) for i in range(Q)]
def is_prime(n):
if n <= 0:return None
if n == 1:return False
sup = math.floor(pow(n,1/2))
for i in range(2,sup+1):
if n % i == 0:
... | import sys,math,itertools
input = sys.stdin.readline
Q = int(eval(input()))
query = [list(map(int,input().split())) for i in range(Q)]
def is_prime(n):
if n <= 0:return None
if n == 1:return False
sup = math.floor(pow(n,1/2))
for i in range(2,sup+1):
if n % i =... | 29 | 28 | 744 | 735 | import math
import itertools
Q = int(eval(input()))
query = [list(map(int, input().split())) for i in range(Q)]
def is_prime(n):
if n <= 0:
return None
if n == 1:
return False
sup = math.floor(pow(n, 1 / 2))
for i in range(2, sup + 1):
if n % i == 0:
return False
... | import sys, math, itertools
input = sys.stdin.readline
Q = int(eval(input()))
query = [list(map(int, input().split())) for i in range(Q)]
def is_prime(n):
if n <= 0:
return None
if n == 1:
return False
sup = math.floor(pow(n, 1 / 2))
for i in range(2, sup + 1):
if n % i == 0:
... | false | 3.448276 | [
"-import math",
"-import itertools",
"+import sys, math, itertools",
"+input = sys.stdin.readline",
"-for p, bit in enumerate(prime[::-1]):",
"- p = len(prime) - 1 - p",
"- if bit and p % 2 == 1 and prime[(p + 1) // 2]:",
"+for i in range(10**5, -1, -1):",
"+ if prime[i] and i % 2 == 1 and ... | false | 0.689818 | 0.528165 | 1.306067 | [
"s064710810",
"s125311921"
] |
u314906167 | p03458 | python | s864769849 | s053564722 | 1,795 | 1,580 | 184,368 | 106,056 | Accepted | Accepted | 11.98 | import numpy as np
# from time import time
# t0 = time()
N, K = list(map(int, input().split()))
B = np.zeros((2 * K, 2 * K), np.int32)
W = np.zeros((2 * K, 2 * K), np.int32)
# t1 = time()
# print(t1 - t0)
for _ in range(N):
x, y, c = input().split()
if c == "B":
B[int(x) % (2 * K)][int(y) %... | import numpy as np
N, K = list(map(int, input().split()))
B = np.zeros((2 * K, 2 * K), np.int32)
for _ in range(N):
x, y, c = input().split()
if c == "B":
B[int(x) % (2 * K)][int(y) % (2 * K)] += 1
else:
B[int(x) % (2 * K)][(int(y) + K) % (2 * K)] += 1
SB = np.zeros((4 * K + 1... | 59 | 34 | 1,624 | 853 | import numpy as np
# from time import time
# t0 = time()
N, K = list(map(int, input().split()))
B = np.zeros((2 * K, 2 * K), np.int32)
W = np.zeros((2 * K, 2 * K), np.int32)
# t1 = time()
# print(t1 - t0)
for _ in range(N):
x, y, c = input().split()
if c == "B":
B[int(x) % (2 * K)][int(y) % (2 * K)] +=... | import numpy as np
N, K = list(map(int, input().split()))
B = np.zeros((2 * K, 2 * K), np.int32)
for _ in range(N):
x, y, c = input().split()
if c == "B":
B[int(x) % (2 * K)][int(y) % (2 * K)] += 1
else:
B[int(x) % (2 * K)][(int(y) + K) % (2 * K)] += 1
SB = np.zeros((4 * K + 1, 4 * K + 1), ... | false | 42.372881 | [
"-# from time import time",
"-# t0 = time()",
"-W = np.zeros((2 * K, 2 * K), np.int32)",
"-# t1 = time()",
"-# print(t1 - t0)",
"- W[int(x) % (2 * K)][int(y) % (2 * K)] += 1",
"-# t2 = time()",
"-# print(t2 - t1)",
"+ B[int(x) % (2 * K)][(int(y) + K) % (2 * K)] += 1",
"-SW = np.zeros... | false | 1.070734 | 1.163709 | 0.920105 | [
"s864769849",
"s053564722"
] |
u759412327 | p03645 | python | s667886748 | s831048751 | 1,728 | 593 | 3,188 | 19,024 | Accepted | Accepted | 65.68 | N,M = list(map(int,input().split()))
x = 1
y = 1
for m in range(M):
a,b = list(map(int,input().split()))
if a==1:
x|=1<<b
if b==N:
y|=1<<a
print(("IM"*(x&y==1)+"POSSIBLE")) | N,M = list(map(int,input().split()))
x = set()
y = set()
for m in range(M):
a,b = list(map(int,input().split()))
if a==1:
x.add(b)
if b==N:
y.add(a)
if x&y:
print("POSSIBLE")
else:
print("IMPOSSIBLE") | 12 | 15 | 207 | 232 | N, M = list(map(int, input().split()))
x = 1
y = 1
for m in range(M):
a, b = list(map(int, input().split()))
if a == 1:
x |= 1 << b
if b == N:
y |= 1 << a
print(("IM" * (x & y == 1) + "POSSIBLE"))
| N, M = list(map(int, input().split()))
x = set()
y = set()
for m in range(M):
a, b = list(map(int, input().split()))
if a == 1:
x.add(b)
if b == N:
y.add(a)
if x & y:
print("POSSIBLE")
else:
print("IMPOSSIBLE")
| false | 20 | [
"-x = 1",
"-y = 1",
"+x = set()",
"+y = set()",
"- x |= 1 << b",
"+ x.add(b)",
"- y |= 1 << a",
"-print((\"IM\" * (x & y == 1) + \"POSSIBLE\"))",
"+ y.add(a)",
"+if x & y:",
"+ print(\"POSSIBLE\")",
"+else:",
"+ print(\"IMPOSSIBLE\")"
] | false | 0.121254 | 0.082017 | 1.478402 | [
"s667886748",
"s831048751"
] |
u134302690 | p03370 | python | s404705973 | s043185003 | 165 | 19 | 38,256 | 2,940 | Accepted | Accepted | 88.48 | n,x = list(map(int,input().split()))
m = []
for i in range(n):
m.append(int(eval(input())))
print((n+int((x-sum(m))/min(m)))) | N,X = list(map(int,input().split()))
m = []
for _ in range(N):
m.append(int(eval(input())))
print(((X-sum(m))//min(m)+N))
| 5 | 5 | 119 | 116 | n, x = list(map(int, input().split()))
m = []
for i in range(n):
m.append(int(eval(input())))
print((n + int((x - sum(m)) / min(m))))
| N, X = list(map(int, input().split()))
m = []
for _ in range(N):
m.append(int(eval(input())))
print(((X - sum(m)) // min(m) + N))
| false | 0 | [
"-n, x = list(map(int, input().split()))",
"+N, X = list(map(int, input().split()))",
"-for i in range(n):",
"+for _ in range(N):",
"-print((n + int((x - sum(m)) / min(m))))",
"+print(((X - sum(m)) // min(m) + N))"
] | false | 0.087836 | 0.086923 | 1.010505 | [
"s404705973",
"s043185003"
] |
u343977188 | p03804 | python | s749422967 | s208193202 | 29 | 26 | 9,040 | 9,184 | Accepted | Accepted | 10.34 | import math
N,M=list(map(int,input().split()))
A=[0]*N
B=[0]*M
for i in range(N):
A[i]=str(eval(input()))
for i in range(M):
B[i]=str(eval(input()))
k=math.ceil(N/M)
def macthing(y,x):
flag=0
for p in range(M):
if A[y+p][x:x+M]!=B[p]:
flag=1
break
if flag==0:
return True
... | N,M=list(map(int,input().split()))
A=[0]*N
B=[0]*M
for i in range(N):
A[i]=str(eval(input()))
for i in range(M):
B[i]=str(eval(input()))
k=N//M + N%M
def macthing(y,x):
flag=0
for p in range(M):
if A[y+p][x:x+M]!=B[p]:
flag=1
break
if flag==0:
return True
else:
ret... | 27 | 26 | 443 | 426 | import math
N, M = list(map(int, input().split()))
A = [0] * N
B = [0] * M
for i in range(N):
A[i] = str(eval(input()))
for i in range(M):
B[i] = str(eval(input()))
k = math.ceil(N / M)
def macthing(y, x):
flag = 0
for p in range(M):
if A[y + p][x : x + M] != B[p]:
flag = 1
... | N, M = list(map(int, input().split()))
A = [0] * N
B = [0] * M
for i in range(N):
A[i] = str(eval(input()))
for i in range(M):
B[i] = str(eval(input()))
k = N // M + N % M
def macthing(y, x):
flag = 0
for p in range(M):
if A[y + p][x : x + M] != B[p]:
flag = 1
break
... | false | 3.703704 | [
"-import math",
"-",
"-k = math.ceil(N / M)",
"+k = N // M + N % M"
] | false | 0.050291 | 0.007953 | 6.32318 | [
"s749422967",
"s208193202"
] |
u893063840 | p03681 | python | s779709877 | s625346789 | 401 | 33 | 4,740 | 3,060 | Accepted | Accepted | 91.77 | # -*- coding: utf-8 -*-
from math import factorial
n, m = list(map(int, input().split()))
def solve(m, n):
if m > n:
m, n = n, m
if n - m > 1:
return 0
fct = factorial(m)
if n - m == 1:
return fct ** 2 * n
else: # n - m == 0
return fct ** 2 * 2
... | # -*- coding: utf-8 -*-
n, m = list(map(int, input().split()))
mod = 10 ** 9 + 7
def factorial(x):
ret = 1
for i in range(1, x + 1):
ret *= i
ret %= mod
return ret
def solve(m, n):
if m > n:
m, n = n, m
if n - m > 1:
return 0
fct = fact... | 22 | 30 | 372 | 473 | # -*- coding: utf-8 -*-
from math import factorial
n, m = list(map(int, input().split()))
def solve(m, n):
if m > n:
m, n = n, m
if n - m > 1:
return 0
fct = factorial(m)
if n - m == 1:
return fct**2 * n
else: # n - m == 0
return fct**2 * 2
mod = 10**9 + 7
ans =... | # -*- coding: utf-8 -*-
n, m = list(map(int, input().split()))
mod = 10**9 + 7
def factorial(x):
ret = 1
for i in range(1, x + 1):
ret *= i
ret %= mod
return ret
def solve(m, n):
if m > n:
m, n = n, m
if n - m > 1:
return 0
fct = factorial(m)
if n - m == 1... | false | 26.666667 | [
"-from math import factorial",
"+n, m = list(map(int, input().split()))",
"+mod = 10**9 + 7",
"-n, m = list(map(int, input().split()))",
"+",
"+def factorial(x):",
"+ ret = 1",
"+ for i in range(1, x + 1):",
"+ ret *= i",
"+ ret %= mod",
"+ return ret",
"- return ... | false | 0.077822 | 0.058878 | 1.321762 | [
"s779709877",
"s625346789"
] |
u623231048 | p02768 | python | s390741944 | s647476468 | 526 | 174 | 40,812 | 38,640 | Accepted | Accepted | 66.92 | n,a,b = list(map(int,input().split()))
mod = 10 ** 9 + 7
# 乗法のmod逆元 (mod-2乗)
def modinv(a, mod=10**9+7):
return pow(a, mod-2, mod)
# nCr mod m
# modinvが必要
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
r = min(r, n-r)
res = 1
for i in range(r):
res = res * (n - i) * modin... | n,a,b = list(map(int,input().split()))
mod = 10 ** 9 + 7
# 乗法のmod逆元 (mod-2乗)
def modinv(a, mod=10**9+7):
return pow(a, mod-2, mod)
# nCr mod m
# modinvが必要
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
r = min(r, n-r)
x = 1
y = 1
for i in range(r):
x *= (n - i)
... | 21 | 25 | 440 | 498 | n, a, b = list(map(int, input().split()))
mod = 10**9 + 7
# 乗法のmod逆元 (mod-2乗)
def modinv(a, mod=10**9 + 7):
return pow(a, mod - 2, mod)
# nCr mod m
# modinvが必要
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9 + 7):
r = min(r, n - r)
res = 1
for i in range(r):
res = res * (n - i) * modinv(i +... | n, a, b = list(map(int, input().split()))
mod = 10**9 + 7
# 乗法のmod逆元 (mod-2乗)
def modinv(a, mod=10**9 + 7):
return pow(a, mod - 2, mod)
# nCr mod m
# modinvが必要
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9 + 7):
r = min(r, n - r)
x = 1
y = 1
for i in range(r):
x *= n - i
y *= ... | false | 16 | [
"- res = 1",
"+ x = 1",
"+ y = 1",
"- res = res * (n - i) * modinv(i + 1, mod) % mod",
"- return res",
"+ x *= n - i",
"+ y *= i + 1",
"+ x %= mod",
"+ y %= mod",
"+ return (x * modinv(y, mod)) % mod"
] | false | 0.846718 | 0.139287 | 6.07894 | [
"s390741944",
"s647476468"
] |
u918276501 | p02269 | python | s716939974 | s645578810 | 1,890 | 880 | 112,472 | 112,316 | Accepted | Accepted | 53.44 | import sys
from collections import ChainMap
eval(input())
rp = sys.stdin.readlines()
cm = ChainMap()
for i in rp:
if i[0] == 'i':
cm[i[7:]] = 0
else:
if i[5:] in cm:
print('yes')
else:
print('no') | import sys
#from collections import ChainMap
eval(input())
rp = sys.stdin.readlines()
cm = {}#ChainMap()
for i in rp:
if i[0] == 'i':
cm[i[7:]] = 0
else:
if i[5:] in cm:
print('yes')
else:
print('no') | 14 | 14 | 260 | 264 | import sys
from collections import ChainMap
eval(input())
rp = sys.stdin.readlines()
cm = ChainMap()
for i in rp:
if i[0] == "i":
cm[i[7:]] = 0
else:
if i[5:] in cm:
print("yes")
else:
print("no")
| import sys
# from collections import ChainMap
eval(input())
rp = sys.stdin.readlines()
cm = {} # ChainMap()
for i in rp:
if i[0] == "i":
cm[i[7:]] = 0
else:
if i[5:] in cm:
print("yes")
else:
print("no")
| false | 0 | [
"-from collections import ChainMap",
"+# from collections import ChainMap",
"-cm = ChainMap()",
"+cm = {} # ChainMap()"
] | false | 0.040227 | 0.044767 | 0.898582 | [
"s716939974",
"s645578810"
] |
u564589929 | p02614 | python | s472549706 | s575329376 | 160 | 142 | 27,148 | 27,300 | Accepted | Accepted | 11.25 | import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline ####
def int1(x): return int(x) - 1
def II(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))
def LI(): return list(map(int, input().split()))
def LI1(): return... | import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline ####
def int1(x): return int(x) - 1
def II(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))
def LI(): return list(map(int, input().split()))
def LI1(): return... | 47 | 47 | 1,504 | 1,480 | import sys
sys.setrecursionlimit(10**9)
# input = sys.stdin.readline ####
def int1(x):
return int(x) - 1
def II():
return int(eval(input()))
def MI():
return list(map(int, input().split()))
def MI1():
return list(map(int1, input().split()))
def LI():
return list(map(int, input().split())... | import sys
sys.setrecursionlimit(10**9)
# input = sys.stdin.readline ####
def int1(x):
return int(x) - 1
def II():
return int(eval(input()))
def MI():
return list(map(int, input().split()))
def MI1():
return list(map(int1, input().split()))
def LI():
return list(map(int, input().split())... | false | 0 | [
"- G = np.array([])",
"- for h in range(H):",
"- l = LS()",
"- for i in range(W):",
"- if l[i] == \"#\":",
"- l[i] = 1",
"- else:",
"- l[i] = 0",
"- G = np.append(G, l)",
"- G = G.reshape((H, W))",
"- ret = 0",
... | false | 0.173989 | 0.193815 | 0.897704 | [
"s472549706",
"s575329376"
] |
u156815136 | p02802 | python | s657912621 | s703053909 | 304 | 211 | 32,932 | 23,160 | Accepted | Accepted | 30.59 | #from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counte... | #from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counte... | 44 | 42 | 1,049 | 958 | # from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations, accumulate # (string,3) 3回
# from collections import deque
from collections import deque, defaultdict, Co... | # from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations, accumulate # (string,3) 3回
# from collections import deque
from collections import deque, defaultdict, Co... | false | 4.545455 | [
"+import re",
"-A = set()",
"+cnt = 0",
"+ans = 0",
"- a, b = input().split()",
"- if dic[\"AC\" + a] != 1:",
"- if b == \"AC\":",
"- dic[\"AC\"] += 1",
"- dic[\"AC\" + a] = 1",
"- else:",
"- dic[\"WA\"] += 1",
"- dic[\"WA\" + a] ... | false | 0.04578 | 0.040325 | 1.135281 | [
"s657912621",
"s703053909"
] |
u964763428 | p02730 | python | s059406875 | s714200236 | 22 | 18 | 3,444 | 2,940 | Accepted | Accepted | 18.18 | import copy
s = eval(input())
mae = s[:len(s) // 2]
ushiro = s[len(s) // 2 + 1:]
ushiro2 = copy.deepcopy(ushiro[::-1])
if mae == ushiro:
print('Yes')
else:
print("No")
| s = eval(input())
mae = s[:len(s) // 2]
ushiro = s[len(s) // 2 + 1:]
ushiro2 = ushiro[::-1]
if mae == ushiro:
print('Yes')
else:
print("No")
| 11 | 8 | 182 | 150 | import copy
s = eval(input())
mae = s[: len(s) // 2]
ushiro = s[len(s) // 2 + 1 :]
ushiro2 = copy.deepcopy(ushiro[::-1])
if mae == ushiro:
print("Yes")
else:
print("No")
| s = eval(input())
mae = s[: len(s) // 2]
ushiro = s[len(s) // 2 + 1 :]
ushiro2 = ushiro[::-1]
if mae == ushiro:
print("Yes")
else:
print("No")
| false | 27.272727 | [
"-import copy",
"-",
"-ushiro2 = copy.deepcopy(ushiro[::-1])",
"+ushiro2 = ushiro[::-1]"
] | false | 0.038294 | 0.037155 | 1.030654 | [
"s059406875",
"s714200236"
] |
u264312747 | p02623 | python | s610153806 | s919532012 | 338 | 284 | 55,980 | 47,336 | Accepted | Accepted | 15.98 | n, m, k = list(map(int, input().split()))
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
new_a_list = [[0, 0]]
a_sum = 0
for i in range(0, n):
a_sum += a_list[i]
if a_sum <= k:
new_a_list.append([i + 1, a_sum])
else:
break
best = len(new_a_list... | N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
a.append(a[i] + A[i])
for i in range(M):
b.append(b[i] + B[i])
ans, j = 0, M
for i in range(N + 1):
if a[i] > K:
break
while b[j] > K - a[i]:
... | 32 | 16 | 788 | 357 | n, m, k = list(map(int, input().split()))
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
new_a_list = [[0, 0]]
a_sum = 0
for i in range(0, n):
a_sum += a_list[i]
if a_sum <= k:
new_a_list.append([i + 1, a_sum])
else:
break
best = len(new_a_list) - 1
b_sum =... | N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
a.append(a[i] + A[i])
for i in range(M):
b.append(b[i] + B[i])
ans, j = 0, M
for i in range(N + 1):
if a[i] > K:
break
while b[j] > K - a[i]:
... | false | 50 | [
"-n, m, k = list(map(int, input().split()))",
"-a_list = list(map(int, input().split()))",
"-b_list = list(map(int, input().split()))",
"-new_a_list = [[0, 0]]",
"-a_sum = 0",
"-for i in range(0, n):",
"- a_sum += a_list[i]",
"- if a_sum <= k:",
"- new_a_list.append([i + 1, a_sum])",
... | false | 0.046418 | 0.047099 | 0.985531 | [
"s610153806",
"s919532012"
] |
u930806831 | p02259 | python | s019554135 | s486199821 | 70 | 20 | 7,736 | 7,744 | Accepted | Accepted | 71.43 |
n = int(eval(input()))
num_list = input().split()
def bubbleSort(num_list, n):
flag = 1
count = 0
while flag:
flag = 0
for j in range(n-1, 0, -1):
if int(num_list[j]) < int(num_list[j-1]):
a = num_list[j]
b = num_list[j-1]
... | n = int(eval(input()))
num_list = input().split()
def bubbleSort(num_list, n):
flag = 1
count = 0
while flag:
flag = 0
for j in range(n-1, 0, -1):
if int(num_list[j]) < int(num_list[j-1]):
num_list[j], num_list[j-1] = num_list[j-1], num_list[j]
... | 23 | 19 | 523 | 458 | n = int(eval(input()))
num_list = input().split()
def bubbleSort(num_list, n):
flag = 1
count = 0
while flag:
flag = 0
for j in range(n - 1, 0, -1):
if int(num_list[j]) < int(num_list[j - 1]):
a = num_list[j]
b = num_list[j - 1]
n... | n = int(eval(input()))
num_list = input().split()
def bubbleSort(num_list, n):
flag = 1
count = 0
while flag:
flag = 0
for j in range(n - 1, 0, -1):
if int(num_list[j]) < int(num_list[j - 1]):
num_list[j], num_list[j - 1] = num_list[j - 1], num_list[j]
... | false | 17.391304 | [
"- a = num_list[j]",
"- b = num_list[j - 1]",
"- num_list[j] = b",
"- num_list[j - 1] = a",
"+ num_list[j], num_list[j - 1] = num_list[j - 1], num_list[j]"
] | false | 0.037552 | 0.038021 | 0.987671 | [
"s019554135",
"s486199821"
] |
u729133443 | p03238 | python | s470933828 | s464713700 | 17 | 10 | 2,940 | 2,568 | Accepted | Accepted | 41.18 | i=lambda:int(eval(input()));print((i()+i()if~-i()else'Hello World')) | print('Hello World'*-~-~-eval(input())or eval(input())+eval(input())) | 1 | 1 | 60 | 49 | i = lambda: int(eval(input()))
print((i() + i() if ~-i() else "Hello World"))
| print("Hello World" * -~-~-eval(input()) or eval(input()) + eval(input()))
| false | 0 | [
"-i = lambda: int(eval(input()))",
"-print((i() + i() if ~-i() else \"Hello World\"))",
"+print(\"Hello World\" * -~-~-eval(input()) or eval(input()) + eval(input()))"
] | false | 0.070138 | 0.042571 | 1.647552 | [
"s470933828",
"s464713700"
] |
u088552457 | p03607 | python | s444056574 | s233332384 | 222 | 202 | 16,612 | 17,112 | Accepted | Accepted | 9.01 | import collections
n = int(eval(input()))
r = []
for i in range(n):
r.append(int(eval(input())))
c = collections.Counter(r)
count = 0
for key, v in list(c.items()):
if v % 2 != 0:
count += 1
print(count) | def main():
n = int(eval(input()))
ans = {}
for i in range(n):
num = int(eval(input()))
if num in ans:
del ans[num]
else:
ans[num] = True
count = len(ans)
print(count)
def input_list():
return list(map(int, input().split()))
def input_list_str():
return list(map... | 13 | 46 | 207 | 822 | import collections
n = int(eval(input()))
r = []
for i in range(n):
r.append(int(eval(input())))
c = collections.Counter(r)
count = 0
for key, v in list(c.items()):
if v % 2 != 0:
count += 1
print(count)
| def main():
n = int(eval(input()))
ans = {}
for i in range(n):
num = int(eval(input()))
if num in ans:
del ans[num]
else:
ans[num] = True
count = len(ans)
print(count)
def input_list():
return list(map(int, input().split()))
def input_list_str(... | false | 71.73913 | [
"-import collections",
"+def main():",
"+ n = int(eval(input()))",
"+ ans = {}",
"+ for i in range(n):",
"+ num = int(eval(input()))",
"+ if num in ans:",
"+ del ans[num]",
"+ else:",
"+ ans[num] = True",
"+ count = len(ans)",
"+ print(... | false | 0.039629 | 0.178318 | 0.222237 | [
"s444056574",
"s233332384"
] |
u392319141 | p03212 | python | s006040864 | s869294039 | 99 | 85 | 3,060 | 3,060 | Accepted | Accepted | 14.14 | N = int(eval(input()))
def search(s) :
if int(s) > N :
return 0
ret = 1 if all(s.count(i) > 0 for i in ['7', '5', '3']) else 0 # 753数
for c in ['7', '5', '3'] :
ret += search(s + c)
return ret
ans = search('0')
print(ans) | N = int(eval(input()))
def dp(now) :
if int(now) > N :
return 0
count = 0
if all(x in now for x in ['7', '5', '3']) :
count += 1
for x in ['7', '5', '3'] :
count += dp(now + x)
return count
ans = dp('0')
print(ans) | 13 | 14 | 263 | 267 | N = int(eval(input()))
def search(s):
if int(s) > N:
return 0
ret = 1 if all(s.count(i) > 0 for i in ["7", "5", "3"]) else 0 # 753数
for c in ["7", "5", "3"]:
ret += search(s + c)
return ret
ans = search("0")
print(ans)
| N = int(eval(input()))
def dp(now):
if int(now) > N:
return 0
count = 0
if all(x in now for x in ["7", "5", "3"]):
count += 1
for x in ["7", "5", "3"]:
count += dp(now + x)
return count
ans = dp("0")
print(ans)
| false | 7.142857 | [
"-def search(s):",
"- if int(s) > N:",
"+def dp(now):",
"+ if int(now) > N:",
"- ret = 1 if all(s.count(i) > 0 for i in [\"7\", \"5\", \"3\"]) else 0 # 753数",
"- for c in [\"7\", \"5\", \"3\"]:",
"- ret += search(s + c)",
"- return ret",
"+ count = 0",
"+ if all(x in n... | false | 0.143187 | 0.059253 | 2.416531 | [
"s006040864",
"s869294039"
] |
u379692329 | p03108 | python | s696285908 | s638040463 | 858 | 695 | 29,020 | 29,232 | Accepted | Accepted | 19 | from collections import deque
class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n)]
self.rank = [0]*n
self.size = [1]*n
def find(self, x):
if self.par[x] == x:
return x
else:
self.par[x] = self.find(self.par[x])... | from collections import deque
import sys
input = sys.stdin.readline
class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n)]
self.rank = [0]*n
self.size = [1]*n
def find(self, x):
if self.par[x] == x:
return x
else:
... | 59 | 61 | 1,493 | 1,533 | from collections import deque
class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n)]
self.rank = [0] * n
self.size = [1] * n
def find(self, x):
if self.par[x] == x:
return x
else:
self.par[x] = self.find(self.par[x])
... | from collections import deque
import sys
input = sys.stdin.readline
class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n)]
self.rank = [0] * n
self.size = [1] * n
def find(self, x):
if self.par[x] == x:
return x
else:
self.par... | false | 3.278689 | [
"+import sys",
"+",
"+input = sys.stdin.readline"
] | false | 0.050478 | 0.007883 | 6.403288 | [
"s696285908",
"s638040463"
] |
u628285938 | p03013 | python | s869948073 | s245323335 | 478 | 157 | 465,860 | 13,656 | Accepted | Accepted | 67.15 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 12:06:59 2020
@author: liang
"""
key = 10**9 + 7
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]
A.sort()
A += [-1]
def solve():
steps = list()
count = 0
index = 0
#段差数え
for i in range(N+1):
... | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 12:37:37 2020
@author: liang
"""
"""
フィボナッチ数列生成
【DP(?)】 : 配列を使用することで計算量が爆発するのを防ぐ
【小さいものから計算する】の原則
【方針】
通常の配列を用いたフィボナッチ数列の生成方法の応用版
壊れた階段のフィボナッチ数列の値を 0 にすることで、実質遷移を止めることが出来る。
"""
key = 10**9 + 7
N, M = list(map(int, input().split()))
A = [int(eval(i... | 57 | 34 | 1,115 | 615 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 12:06:59 2020
@author: liang
"""
key = 10**9 + 7
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]
A.sort()
A += [-1]
def solve():
steps = list()
count = 0
index = 0
# 段差数え
for i in range(N + 1):
if i == A[in... | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 12:37:37 2020
@author: liang
"""
"""
フィボナッチ数列生成
【DP(?)】 : 配列を使用することで計算量が爆発するのを防ぐ
【小さいものから計算する】の原則
【方針】
通常の配列を用いたフィボナッチ数列の生成方法の応用版
壊れた階段のフィボナッチ数列の値を 0 にすることで、実質遷移を止めることが出来る。
"""
key = 10**9 + 7
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in ran... | false | 40.350877 | [
"-Created on Sun Sep 13 12:06:59 2020",
"+Created on Sun Sep 13 12:37:37 2020",
"+\"\"\"",
"+\"\"\"",
"+フィボナッチ数列生成",
"+【DP(?)】 : 配列を使用することで計算量が爆発するのを防ぐ",
"+【小さいものから計算する】の原則",
"+【方針】",
"+ 通常の配列を用いたフィボナッチ数列の生成方法の応用版",
"+ 壊れた階段のフィボナッチ数列の値を 0 にすることで、実質遷移を止めることが出来る。",
"-A = [int(eval(input())) for _ ... | false | 0.041633 | 0.062833 | 0.662592 | [
"s869948073",
"s245323335"
] |
u094191970 | p02726 | python | s099905303 | s667076994 | 1,961 | 1,454 | 133,092 | 203,448 | Accepted | Accepted | 25.85 | from collections import deque, Counter
def BFS(st,c):
dist=[-1 for i in range(n)]
dist[st]=0
que=deque()
que.append(st)
while que:
x=que.popleft()
for i in tree[x]:
if dist[i]==-1:
dist[i]=dist[x]+1
que.append(i)
c+=dist
n,x,y=list(map(int,input().split... | from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra
import numpy as np
from collections import Counter
n,x,y=list(map(int,input().split()))
row,col,w=[],[],[]
for i in range(n-1):
row.append(i)
col.append(i+1)
w.append(1)
row.append(x-1)
col.append(y-1)
w.append(1)
g... | 40 | 26 | 577 | 467 | from collections import deque, Counter
def BFS(st, c):
dist = [-1 for i in range(n)]
dist[st] = 0
que = deque()
que.append(st)
while que:
x = que.popleft()
for i in tree[x]:
if dist[i] == -1:
dist[i] = dist[x] + 1
que.append(i)
c += d... | from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra
import numpy as np
from collections import Counter
n, x, y = list(map(int, input().split()))
row, col, w = [], [], []
for i in range(n - 1):
row.append(i)
col.append(i + 1)
w.append(1)
row.append(x - 1)
col.append(y - 1)
w.append... | false | 35 | [
"-from collections import deque, Counter",
"-",
"-",
"-def BFS(st, c):",
"- dist = [-1 for i in range(n)]",
"- dist[st] = 0",
"- que = deque()",
"- que.append(st)",
"- while que:",
"- x = que.popleft()",
"- for i in tree[x]:",
"- if dist[i] == -1:",
"-... | false | 0.060792 | 0.528522 | 0.115023 | [
"s099905303",
"s667076994"
] |
u548545174 | p03557 | python | s401861674 | s664851714 | 1,517 | 347 | 23,296 | 23,232 | Accepted | Accepted | 77.13 | N = int(eval(input()))
A = [int(a) for a in input().split()]
B = [int(b) for b in input().split()]
C = [int(c) for c in input().split()]
A_sorted = sorted(A)
B_sorted = sorted(B)
C_sorted = sorted(C)
ans = 0
for b in B_sorted:
#Aのうちbより小さいの数
left = -1
right = N
while right - left > 1:
... | import bisect
N = int(eval(input()))
A = [int(a) for a in input().split()]
B = [int(b) for b in input().split()]
C = [int(c) for c in input().split()]
A_sorted = sorted(A)
B_sorted = sorted(B)
C_sorted = sorted(C)
ans = 0
for b in B_sorted:
#Aのうちbより小さいの数
a_count = bisect.bisect_left(A_sorted, b)
... | 35 | 21 | 760 | 440 | N = int(eval(input()))
A = [int(a) for a in input().split()]
B = [int(b) for b in input().split()]
C = [int(c) for c in input().split()]
A_sorted = sorted(A)
B_sorted = sorted(B)
C_sorted = sorted(C)
ans = 0
for b in B_sorted:
# Aのうちbより小さいの数
left = -1
right = N
while right - left > 1:
mid = left... | import bisect
N = int(eval(input()))
A = [int(a) for a in input().split()]
B = [int(b) for b in input().split()]
C = [int(c) for c in input().split()]
A_sorted = sorted(A)
B_sorted = sorted(B)
C_sorted = sorted(C)
ans = 0
for b in B_sorted:
# Aのうちbより小さいの数
a_count = bisect.bisect_left(A_sorted, b)
# Cのうちbより... | false | 40 | [
"+import bisect",
"+",
"- left = -1",
"- right = N",
"- while right - left > 1:",
"- mid = left + (right - left) // 2",
"- if A_sorted[mid] < b:",
"- left = mid",
"- else:",
"- right = mid",
"- a_count = right",
"+ a_count = bisect.bise... | false | 0.064847 | 0.041653 | 1.556848 | [
"s401861674",
"s664851714"
] |
u832152513 | p03730 | python | s532889781 | s499904206 | 110 | 75 | 61,484 | 61,416 | Accepted | Accepted | 31.82 | a, b, c = list(map(int, input().split()))
for i in range(1, 200):
if a*i % b == c:
print("YES")
exit()
print("NO") | a, b, c = list(map(int, input().split()))
for i in range(1, b):
if a*i % b == c:
print("YES")
exit()
print("NO") | 7 | 7 | 135 | 133 | a, b, c = list(map(int, input().split()))
for i in range(1, 200):
if a * i % b == c:
print("YES")
exit()
print("NO")
| a, b, c = list(map(int, input().split()))
for i in range(1, b):
if a * i % b == c:
print("YES")
exit()
print("NO")
| false | 0 | [
"-for i in range(1, 200):",
"+for i in range(1, b):"
] | false | 0.035424 | 0.036617 | 0.967416 | [
"s532889781",
"s499904206"
] |
u839188633 | p03053 | python | s180897121 | s422165380 | 532 | 398 | 40,992 | 30,088 | Accepted | Accepted | 25.19 | import numpy as np
from scipy.ndimage.morphology import distance_transform_cdt
h, w = list(map(int, input().split()))
a = [eval(input()) for _ in range(h)]
a = np.array([[(ai[j] != "#") for j in range(w)] for ai in a])
d = distance_transform_cdt(a, metric="taxicab").max()
print(d)
| import numpy as np
import copy
h, w = list(map(int, input().split()))
a = [eval(input()) for _ in range(h)]
a = np.array([[0 if (ai[j] == "#") else np.inf for j in range(w)] for ai in a])
for i in range(1, h):
a[i] = np.minimum(a[i], a[i - 1] + 1)
for i in range(h - 2, -1, -1):
a[i] = np.minimum(a... | 9 | 18 | 280 | 509 | import numpy as np
from scipy.ndimage.morphology import distance_transform_cdt
h, w = list(map(int, input().split()))
a = [eval(input()) for _ in range(h)]
a = np.array([[(ai[j] != "#") for j in range(w)] for ai in a])
d = distance_transform_cdt(a, metric="taxicab").max()
print(d)
| import numpy as np
import copy
h, w = list(map(int, input().split()))
a = [eval(input()) for _ in range(h)]
a = np.array([[0 if (ai[j] == "#") else np.inf for j in range(w)] for ai in a])
for i in range(1, h):
a[i] = np.minimum(a[i], a[i - 1] + 1)
for i in range(h - 2, -1, -1):
a[i] = np.minimum(a[i], a[i + 1]... | false | 50 | [
"-from scipy.ndimage.morphology import distance_transform_cdt",
"+import copy",
"-a = np.array([[(ai[j] != \"#\") for j in range(w)] for ai in a])",
"-d = distance_transform_cdt(a, metric=\"taxicab\").max()",
"-print(d)",
"+a = np.array([[0 if (ai[j] == \"#\") else np.inf for j in range(w)] for ai in a])"... | false | 0.619426 | 0.380061 | 1.629806 | [
"s180897121",
"s422165380"
] |
u392319141 | p02984 | python | s730997233 | s375560133 | 256 | 167 | 14,092 | 14,028 | Accepted | Accepted | 34.77 | N = int(input())
A = list(map(int,input().split()))
ss = 0
for i in range(N) :
ss += (-1)**i * A[i]
ans = []
for i in range(N) :
ss = -ss + 2*A[i]
ans.append(ss)
print('{} '.format(ans[-1]), end='')
ans.pop()
for a in ans :
print('{} '.format(a), end='')
print('')
| N = int(eval(input()))
A = list(map(int, input().split()))
S = 0
for i, a in enumerate(A):
S += (-1)**i * a
ans = [0] * N
ans[0] = S
for i, a in enumerate(A[:-1], start=1):
S *= -1
S += 2 * a
ans[i] = S
print((*ans)) | 19 | 15 | 303 | 241 | N = int(input())
A = list(map(int, input().split()))
ss = 0
for i in range(N):
ss += (-1) ** i * A[i]
ans = []
for i in range(N):
ss = -ss + 2 * A[i]
ans.append(ss)
print("{} ".format(ans[-1]), end="")
ans.pop()
for a in ans:
print("{} ".format(a), end="")
print("")
| N = int(eval(input()))
A = list(map(int, input().split()))
S = 0
for i, a in enumerate(A):
S += (-1) ** i * a
ans = [0] * N
ans[0] = S
for i, a in enumerate(A[:-1], start=1):
S *= -1
S += 2 * a
ans[i] = S
print((*ans))
| false | 21.052632 | [
"-N = int(input())",
"+N = int(eval(input()))",
"-ss = 0",
"-for i in range(N):",
"- ss += (-1) ** i * A[i]",
"-ans = []",
"-for i in range(N):",
"- ss = -ss + 2 * A[i]",
"- ans.append(ss)",
"-print(\"{} \".format(ans[-1]), end=\"\")",
"-ans.pop()",
"-for a in ans:",
"- print(\"{... | false | 0.035454 | 0.037554 | 0.944082 | [
"s730997233",
"s375560133"
] |
u018679195 | p02789 | python | s378849913 | s383734551 | 30 | 26 | 8,988 | 9,144 | Accepted | Accepted | 13.33 | x,y=input().split()
x=int(x)
y=int(y)
if x==y:
print("Yes")
else:
print("No")
| n, m = list(map(int, input().split()))
if (n == m):
print("Yes")
else:
print("No") | 12 | 5 | 105 | 88 | x, y = input().split()
x = int(x)
y = int(y)
if x == y:
print("Yes")
else:
print("No")
| n, m = list(map(int, input().split()))
if n == m:
print("Yes")
else:
print("No")
| false | 58.333333 | [
"-x, y = input().split()",
"-x = int(x)",
"-y = int(y)",
"-if x == y:",
"+n, m = list(map(int, input().split()))",
"+if n == m:"
] | false | 0.036808 | 0.067998 | 0.541319 | [
"s378849913",
"s383734551"
] |
u808427016 | p03252 | python | s219328290 | s895675810 | 127 | 85 | 3,632 | 3,632 | Accepted | Accepted | 33.07 | S = eval(input())
T = eval(input())
chars = "abcdefghijklmnopqrstuvwxyz"
sp = {}
tp = {}
result = True
for i in range(len(S)):
sc = S[i]
sx = i
tc = T[i]
tx = i
if not sc in sp:
sp[sc] = i
else:
sx = sp[sc]
if not tc in tp:
tp[tc] = i
el... | S = eval(input())
T = eval(input())
def normalize(s):
pos = {}
for i, c in enumerate(s):
if not c in pos:
pos[c] = i
yield pos[c]
if all(x == y for x, y in zip(normalize(S), normalize(T))):
print("Yes")
else:
print("No")
| 32 | 14 | 446 | 268 | S = eval(input())
T = eval(input())
chars = "abcdefghijklmnopqrstuvwxyz"
sp = {}
tp = {}
result = True
for i in range(len(S)):
sc = S[i]
sx = i
tc = T[i]
tx = i
if not sc in sp:
sp[sc] = i
else:
sx = sp[sc]
if not tc in tp:
tp[tc] = i
else:
tx = tp[tc]
... | S = eval(input())
T = eval(input())
def normalize(s):
pos = {}
for i, c in enumerate(s):
if not c in pos:
pos[c] = i
yield pos[c]
if all(x == y for x, y in zip(normalize(S), normalize(T))):
print("Yes")
else:
print("No")
| false | 56.25 | [
"-chars = \"abcdefghijklmnopqrstuvwxyz\"",
"-sp = {}",
"-tp = {}",
"-result = True",
"-for i in range(len(S)):",
"- sc = S[i]",
"- sx = i",
"- tc = T[i]",
"- tx = i",
"- if not sc in sp:",
"- sp[sc] = i",
"- else:",
"- sx = sp[sc]",
"- if not tc in tp:",
... | false | 0.043168 | 0.043414 | 0.994322 | [
"s219328290",
"s895675810"
] |
u523087093 | p03031 | python | s188645226 | s422875134 | 56 | 41 | 9,068 | 9,176 | Accepted | Accepted | 26.79 | import itertools
N, M = list(map(int, input().split()))
target_switches = [list(map(int, input().split())) for _ in range(M)]
p = list(map(int, input().split()))
answer_count = 0
for switches in itertools.product((0, 1), repeat=N):
on_count = 0
for j in range(M):
count = 0
for i i... | N, M = list(map(int, input().split())) # Nはスイッチの数、Mは電球の数
lights = [[0] * N for _ in range(M)]
for i in range(M):
temp = list(map(int, input().split())) # 0番目はスイッチの個数、1番目以降はスイッチを示す
k = temp[0]
switches = temp[1:]
for j in range(k):
lights[i][switches[j]-1] = 1
P = list(map(int, input().s... | 23 | 25 | 582 | 690 | import itertools
N, M = list(map(int, input().split()))
target_switches = [list(map(int, input().split())) for _ in range(M)]
p = list(map(int, input().split()))
answer_count = 0
for switches in itertools.product((0, 1), repeat=N):
on_count = 0
for j in range(M):
count = 0
for i in range(N):
... | N, M = list(map(int, input().split())) # Nはスイッチの数、Mは電球の数
lights = [[0] * N for _ in range(M)]
for i in range(M):
temp = list(map(int, input().split())) # 0番目はスイッチの個数、1番目以降はスイッチを示す
k = temp[0]
switches = temp[1:]
for j in range(k):
lights[i][switches[j] - 1] = 1
P = list(map(int, input().split(... | false | 8 | [
"-import itertools",
"-",
"-N, M = list(map(int, input().split()))",
"-target_switches = [list(map(int, input().split())) for _ in range(M)]",
"-p = list(map(int, input().split()))",
"+N, M = list(map(int, input().split())) # Nはスイッチの数、Mは電球の数",
"+lights = [[0] * N for _ in range(M)]",
"+for i in range... | false | 0.098492 | 0.087152 | 1.130108 | [
"s188645226",
"s422875134"
] |
u719166355 | p02713 | python | s756126635 | s013047024 | 1,479 | 32 | 105,892 | 9,188 | Accepted | Accepted | 97.84 | from functools import reduce
import math
import itertools
def gcd(numbers):
return reduce(lambda x,y: math.gcd(x,y),numbers)
def comb(K):
return itertools.combinations_with_replacement(list(range(1,K+1)),3)
def main():
k = int(eval(input()))
if k == 1:
print((1))
return... | import math
def main():
k = int(eval(input()))
r = list(range(1,k+1))
#because gcd can only appear in this range
count = [0]*201
for i in r:
for j in r:
count[math.gcd(i,j)] += 1
final = 0
for i in range(1,201):
if count[i]... | 33 | 26 | 671 | 424 | from functools import reduce
import math
import itertools
def gcd(numbers):
return reduce(lambda x, y: math.gcd(x, y), numbers)
def comb(K):
return itertools.combinations_with_replacement(list(range(1, K + 1)), 3)
def main():
k = int(eval(input()))
if k == 1:
print((1))
return
... | import math
def main():
k = int(eval(input()))
r = list(range(1, k + 1))
# because gcd can only appear in this range
count = [0] * 201
for i in r:
for j in r:
count[math.gcd(i, j)] += 1
final = 0
for i in range(1, 201):
if count[i] > 0:
for j in r:
... | false | 21.212121 | [
"-from functools import reduce",
"-import itertools",
"-",
"-",
"-def gcd(numbers):",
"- return reduce(lambda x, y: math.gcd(x, y), numbers)",
"-",
"-",
"-def comb(K):",
"- return itertools.combinations_with_replacement(list(range(1, K + 1)), 3)",
"- if k == 1:",
"- print((1))"... | false | 0.04225 | 0.033465 | 1.262527 | [
"s756126635",
"s013047024"
] |
u062147869 | p03289 | python | s111892912 | s791648837 | 192 | 173 | 38,384 | 38,384 | Accepted | Accepted | 9.9 | import sys
S=eval(input())
N=len(S)
L=['B','D','E','F','G','H','I','J','K','L','N','M','O','P','Q','R','S','T','U','V','W','X','Y','Z']
if S[0]!='A':
print('WA')
sys.exit()
ans=0
for i in range(2,N-1) :
if S[i]=='C':
ans+=1
if ans!=1:
print('WA')
sys.exit()
for i in range(N) :
... | import sys
S=eval(input())
N=len(S)
#L=['B','D','E','F','G','H','I','J','K','L','N','M','O','P','Q','R','S','T','U','V','W','X','Y','Z']
if S[0]!='A':
print('WA')
sys.exit()
ans=0
for i in range(2,N-1) :
if S[i]=='C':
ans+=1
if ans!=1:
print('WA')
sys.exit()
for i in range(N) :... | 19 | 21 | 386 | 432 | import sys
S = eval(input())
N = len(S)
L = [
"B",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"N",
"M",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
]
if S[0] != "A":
print("WA")
sys.exit()
ans = 0
... | import sys
S = eval(input())
N = len(S)
# L=['B','D','E','F','G','H','I','J','K','L','N','M','O','P','Q','R','S','T','U','V','W','X','Y','Z']
if S[0] != "A":
print("WA")
sys.exit()
ans = 0
for i in range(2, N - 1):
if S[i] == "C":
ans += 1
if ans != 1:
print("WA")
sys.exit()
for i in range(... | false | 9.52381 | [
"-L = [",
"- \"B\",",
"- \"D\",",
"- \"E\",",
"- \"F\",",
"- \"G\",",
"- \"H\",",
"- \"I\",",
"- \"J\",",
"- \"K\",",
"- \"L\",",
"- \"N\",",
"- \"M\",",
"- \"O\",",
"- \"P\",",
"- \"Q\",",
"- \"R\",",
"- \"S\",",
"- \"T\",",
... | false | 0.035278 | 0.040433 | 0.872511 | [
"s111892912",
"s791648837"
] |
u774411119 | p03493 | python | s598119720 | s432339992 | 21 | 17 | 3,316 | 2,940 | Accepted | Accepted | 19.05 | I=eval(input())
I2=list(map(int, I))
X=sum(I2)
print(X) | a=input().count("1")
print(a)
| 4 | 2 | 46 | 31 | I = eval(input())
I2 = list(map(int, I))
X = sum(I2)
print(X)
| a = input().count("1")
print(a)
| false | 50 | [
"-I = eval(input())",
"-I2 = list(map(int, I))",
"-X = sum(I2)",
"-print(X)",
"+a = input().count(\"1\")",
"+print(a)"
] | false | 0.0491 | 0.04851 | 1.012157 | [
"s598119720",
"s432339992"
] |
u780475861 | p04015 | python | s084862077 | s792854299 | 24 | 22 | 3,436 | 3,444 | Accepted | Accepted | 8.33 | import sys
from collections import defaultdict
def main():
N, A, *xlst = list(map(int, sys.stdin.read().split()))
x_p = []
x_n = []
x_z = 0
xlst.sort()
for i in xlst:
if A < i:
x_p.append(i - A)
elif i < A:
x_n.append(A - i)
else:
... | import sys
from collections import defaultdict
def main():
N, A, *xlst = list(map(int, sys.stdin.read().split()))
x_p = []
x_n = []
x_z = 0
for i in xlst:
if A < i:
x_p.append(i - A)
elif i < A:
x_n.append(A - i)
else:
x_z ... | 39 | 39 | 872 | 884 | import sys
from collections import defaultdict
def main():
N, A, *xlst = list(map(int, sys.stdin.read().split()))
x_p = []
x_n = []
x_z = 0
xlst.sort()
for i in xlst:
if A < i:
x_p.append(i - A)
elif i < A:
x_n.append(A - i)
else:
x_z... | import sys
from collections import defaultdict
def main():
N, A, *xlst = list(map(int, sys.stdin.read().split()))
x_p = []
x_n = []
x_z = 0
for i in xlst:
if A < i:
x_p.append(i - A)
elif i < A:
x_n.append(A - i)
else:
x_z += 1
x_p.so... | false | 0 | [
"- xlst.sort()",
"+ x_p.sort(), x_n.sort()",
"- for i in x_n_sum:",
"- if i in x_p_sum:",
"+ for i in x_p_sum:",
"+ if i in x_n_sum:"
] | false | 0.048319 | 0.047045 | 1.027076 | [
"s084862077",
"s792854299"
] |
u937642029 | p03821 | python | s855982811 | s532857472 | 620 | 190 | 47,280 | 12,144 | Accepted | Accepted | 69.35 | n=int(eval(input()))
a=[0 for _ in range(n)]
b=[0 for _ in range(n)]
for i in range(n):
a[i],b[i] = list(map(int,input().split()))
cnt=0
for i in range(n):
i=n-1-i
if (a[i]+cnt)%b[i]!=0:
cnt+=b[i]-(a[i]+cnt)%b[i]
print(cnt) | import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): re... | 11 | 36 | 242 | 1,138 | n = int(eval(input()))
a = [0 for _ in range(n)]
b = [0 for _ in range(n)]
for i in range(n):
a[i], b[i] = list(map(int, input().split()))
cnt = 0
for i in range(n):
i = n - 1 - i
if (a[i] + cnt) % b[i] != 0:
cnt += b[i] - (a[i] + cnt) % b[i]
print(cnt)
| import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter, defaultdict, deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
def inp():
... | false | 69.444444 | [
"-n = int(eval(input()))",
"-a = [0 for _ in range(n)]",
"-b = [0 for _ in range(n)]",
"-for i in range(n):",
"- a[i], b[i] = list(map(int, input().split()))",
"-cnt = 0",
"-for i in range(n):",
"- i = n - 1 - i",
"- if (a[i] + cnt) % b[i] != 0:",
"- cnt += b[i] - (a[i] + cnt) % b[... | false | 0.04104 | 0.064414 | 0.637127 | [
"s855982811",
"s532857472"
] |
u638282348 | p03283 | python | s786984129 | s986219329 | 2,942 | 2,362 | 18,276 | 21,568 | Accepted | Accepted | 19.71 | import numpy as np
N, M, Q = list(map(int, input().split()))
table = np.zeros((N, N), np.int64)
for _ in range(M):
L, R = [int(n) - 1 for n in input().split()]
table[L][R] += 1
table = np.rot90(np.rot90(table, k=-1).cumsum(axis=0).cumsum(axis=1), k=1)
for _ in range(Q):
p, q = [int(n) - 1 for n in i... | import numpy as np
N, M, Q = list(map(int, input().split()))
table = np.zeros((N, N), np.int64)
for _ in range(M):
L, R = [int(n) - 1 for n in input().split()]
table[L][R] += 1
table = np.rot90(np.rot90(table, k=-1).cumsum(axis=0).cumsum(axis=1), k=1).tolist()
for _ in range(Q):
p, q = [int(n) - 1 f... | 10 | 10 | 363 | 372 | import numpy as np
N, M, Q = list(map(int, input().split()))
table = np.zeros((N, N), np.int64)
for _ in range(M):
L, R = [int(n) - 1 for n in input().split()]
table[L][R] += 1
table = np.rot90(np.rot90(table, k=-1).cumsum(axis=0).cumsum(axis=1), k=1)
for _ in range(Q):
p, q = [int(n) - 1 for n in input().... | import numpy as np
N, M, Q = list(map(int, input().split()))
table = np.zeros((N, N), np.int64)
for _ in range(M):
L, R = [int(n) - 1 for n in input().split()]
table[L][R] += 1
table = np.rot90(np.rot90(table, k=-1).cumsum(axis=0).cumsum(axis=1), k=1).tolist()
for _ in range(Q):
p, q = [int(n) - 1 for n in... | false | 0 | [
"-table = np.rot90(np.rot90(table, k=-1).cumsum(axis=0).cumsum(axis=1), k=1)",
"+table = np.rot90(np.rot90(table, k=-1).cumsum(axis=0).cumsum(axis=1), k=1).tolist()"
] | false | 0.324093 | 0.256257 | 1.26472 | [
"s786984129",
"s986219329"
] |
u807028974 | p02755 | python | s634994548 | s645217928 | 168 | 17 | 38,384 | 3,060 | Accepted | Accepted | 89.88 | import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# from fractions import Fraction
mod = int(1e9+7)
INF = 1<<29
def main():
a,b = list(map(int,input().split()))
ans = []
x = int(min(a//0.08,b//0.1))
y = int(max((a+... | import sys
a,b = list(map(int,input().split()))
low = int(min(a//0.08,b//0.1))
high = int(max((a+1)//0.08,(b+1)//0.1))
for i in range(low,high+1):
if int(i*0.08)==a and int(i*0.1)==b:
print(i)
sys.exit()
print((-1)) | 29 | 10 | 562 | 227 | import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# from fractions import Fraction
mod = int(1e9 + 7)
INF = 1 << 29
def main():
a, b = list(map(int, input().split()))
ans = []
x = int(min(a // 0.08, b // 0.1))
y = int(max((a + 1) ... | import sys
a, b = list(map(int, input().split()))
low = int(min(a // 0.08, b // 0.1))
high = int(max((a + 1) // 0.08, (b + 1) // 0.1))
for i in range(low, high + 1):
if int(i * 0.08) == a and int(i * 0.1) == b:
print(i)
sys.exit()
print((-1))
| false | 65.517241 | [
"-# import math",
"-# import decimal",
"-# import queue",
"-# import bisect",
"-# import heapq",
"-# import time",
"-# import itertools",
"-# from fractions import Fraction",
"-mod = int(1e9 + 7)",
"-INF = 1 << 29",
"-",
"-",
"-def main():",
"- a, b = list(map(int, input().split()))",
... | false | 0.037167 | 0.038924 | 0.954874 | [
"s634994548",
"s645217928"
] |
u811733736 | p00483 | python | s616464319 | s823196277 | 1,750 | 1,430 | 126,288 | 87,136 | Accepted | Accepted | 18.29 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0560
"""
import sys
from sys import stdin
input = stdin.readline
def solve(M, N, K, field):
dp_J = [[0] * (N+1) for _ in range(M+1)]
dp_O = [[0] * (N+1) for _ in range(M+1)]
dp_I = [[0] * (N+1) for _ in rang... | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0560
"""
import sys
from sys import stdin
input = stdin.readline
def solve(M, N, K, field):
dp_J = [[0] * (N+1) for _ in range(M+1)]
dp_O = [[0] * (N+1) for _ in range(M+1)]
dp_I = [[0] * (N+1) for _ in rang... | 57 | 89 | 1,706 | 2,798 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0560
"""
import sys
from sys import stdin
input = stdin.readline
def solve(M, N, K, field):
dp_J = [[0] * (N + 1) for _ in range(M + 1)]
dp_O = [[0] * (N + 1) for _ in range(M + 1)]
dp_I = [[0] * (N + 1) for _ in range(M... | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0560
"""
import sys
from sys import stdin
input = stdin.readline
def solve(M, N, K, field):
dp_J = [[0] * (N + 1) for _ in range(M + 1)]
dp_O = [[0] * (N + 1) for _ in range(M + 1)]
dp_I = [[0] * (N + 1) for _ in range(M... | false | 35.955056 | [
"+def solve2(M, N, K, field):",
"+ dp_J = [[0] * (N + 1) for _ in range(M + 1)]",
"+ dp_O = [[0] * (N + 1) for _ in range(M + 1)]",
"+ for y in range(M):",
"+ t_J = [0] * (N + 1)",
"+ t_O = [0] * (N + 1)",
"+ for x in range(N):",
"+ land = field[y][x]",
"+ ... | false | 0.038137 | 0.063371 | 0.601807 | [
"s616464319",
"s823196277"
] |
u156815136 | p03435 | python | s554274598 | s107447178 | 170 | 17 | 38,256 | 3,064 | Accepted | Accepted | 90 | #import collections
#aa = collections.Counter(a) # list to list
#mod = 10**9 + 7
def readInts():
return list(map(int,input().split()))
def main():
C = [readInts() for _ in range(3)]
a = [0] * 3
b = [0] * 3
# a[0] = 0としとく
# 1つ適当に決めることでほかのものが決まる
# それでちょいちょいやればよーい!
for i in range(... | c = [list(map(int,input().split())) for _ in range(3)]
#print(LIST)
# a1 = 0 とする
a,b= [0,0,0],[0,0,0]
for i in range(3):
b[i] = c[0][i] - a[0]
for j in range(1,3):
a[j] = c[j][0] - b[0]
for i in range(1,3):
for j in range(1,3):
#print(a,b)
if c[j][i] == a[j] + b[i]:
p... | 26 | 17 | 654 | 398 | # import collections
# aa = collections.Counter(a) # list to list
# mod = 10**9 + 7
def readInts():
return list(map(int, input().split()))
def main():
C = [readInts() for _ in range(3)]
a = [0] * 3
b = [0] * 3
# a[0] = 0としとく
# 1つ適当に決めることでほかのものが決まる
# それでちょいちょいやればよーい!
for i in range(3):
... | c = [list(map(int, input().split())) for _ in range(3)]
# print(LIST)
# a1 = 0 とする
a, b = [0, 0, 0], [0, 0, 0]
for i in range(3):
b[i] = c[0][i] - a[0]
for j in range(1, 3):
a[j] = c[j][0] - b[0]
for i in range(1, 3):
for j in range(1, 3):
# print(a,b)
if c[j][i] == a[j] + b[i]:
... | false | 34.615385 | [
"-# import collections",
"-# aa = collections.Counter(a) # list to list",
"-# mod = 10**9 + 7",
"-def readInts():",
"- return list(map(int, input().split()))",
"-",
"-",
"-def main():",
"- C = [readInts() for _ in range(3)]",
"- a = [0] * 3",
"- b = [0] * 3",
"- # a[0] = 0としとく",... | false | 0.044888 | 0.044152 | 1.016663 | [
"s554274598",
"s107447178"
] |
u853185302 | p03377 | python | s657015233 | s041386258 | 19 | 17 | 3,316 | 2,940 | Accepted | Accepted | 10.53 | A,B,X = list(map(int,input().split()))
if A <= X and A+B >= X:
print('YES')
else:
print('NO') | a,b,x = list(map(int,input().split()))
print(("YES" if x >= a and a+b >= x else "NO")) | 5 | 2 | 95 | 79 | A, B, X = list(map(int, input().split()))
if A <= X and A + B >= X:
print("YES")
else:
print("NO")
| a, b, x = list(map(int, input().split()))
print(("YES" if x >= a and a + b >= x else "NO"))
| false | 60 | [
"-A, B, X = list(map(int, input().split()))",
"-if A <= X and A + B >= X:",
"- print(\"YES\")",
"-else:",
"- print(\"NO\")",
"+a, b, x = list(map(int, input().split()))",
"+print((\"YES\" if x >= a and a + b >= x else \"NO\"))"
] | false | 0.059896 | 0.063949 | 0.936619 | [
"s657015233",
"s041386258"
] |
u731436822 | p03495 | python | s533712499 | s585237009 | 240 | 153 | 52,600 | 45,748 | Accepted | Accepted | 36.25 | N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
Ad = {x:0 for x in set(A)}
if len(set(A)) <= K:
print((0))
else:
count = 0
for a in A:
Ad[a] += 1
Ad = sorted(list(Ad.items()), key=lambda x:x[1])
for i in range(len(set(A))-K):
count += Ad[i][1]
... | n,k = list(map(int,input().split()))
A = list(map(int,input().split()))
if len(set(A))<=k:
print((0))
else:
d = {i:0 for i in set(A)}
for a in A:
d[a] += 1
ans = list(d.values())
ans.sort(reverse = True)
print((sum(ans[k:]))) | 14 | 12 | 320 | 259 | N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
Ad = {x: 0 for x in set(A)}
if len(set(A)) <= K:
print((0))
else:
count = 0
for a in A:
Ad[a] += 1
Ad = sorted(list(Ad.items()), key=lambda x: x[1])
for i in range(len(set(A)) - K):
count += Ad[i][1]
print... | n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
if len(set(A)) <= k:
print((0))
else:
d = {i: 0 for i in set(A)}
for a in A:
d[a] += 1
ans = list(d.values())
ans.sort(reverse=True)
print((sum(ans[k:])))
| false | 14.285714 | [
"-N, K = list(map(int, input().split()))",
"+n, k = list(map(int, input().split()))",
"-Ad = {x: 0 for x in set(A)}",
"-if len(set(A)) <= K:",
"+if len(set(A)) <= k:",
"- count = 0",
"+ d = {i: 0 for i in set(A)}",
"- Ad[a] += 1",
"- Ad = sorted(list(Ad.items()), key=lambda x: x[1])"... | false | 0.044222 | 0.042466 | 1.041352 | [
"s533712499",
"s585237009"
] |
u906501980 | p02725 | python | s207974760 | s728556742 | 180 | 145 | 25,840 | 26,436 | Accepted | Accepted | 19.44 | k, n = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = a[-1] - a[0]
for i in range(1, n):
start = a[i]
end = a[i-1]+k
ans = min(ans, end-start)
print(ans) | def main():
k, n = list(map(int, input().split()))
a = list(map(int, input().split()))
cost = 10**10
for i in range(n-1):
cost = min(cost, k - abs(a[i]-a[i+1]))
print((min(cost, k-abs(a[0]+k-a[n-1]))))
if __name__ == "__main__":
main() | 8 | 10 | 193 | 269 | k, n = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = a[-1] - a[0]
for i in range(1, n):
start = a[i]
end = a[i - 1] + k
ans = min(ans, end - start)
print(ans)
| def main():
k, n = list(map(int, input().split()))
a = list(map(int, input().split()))
cost = 10**10
for i in range(n - 1):
cost = min(cost, k - abs(a[i] - a[i + 1]))
print((min(cost, k - abs(a[0] + k - a[n - 1]))))
if __name__ == "__main__":
main()
| false | 20 | [
"-k, n = list(map(int, input().split()))",
"-a = list(map(int, input().split()))",
"-ans = a[-1] - a[0]",
"-for i in range(1, n):",
"- start = a[i]",
"- end = a[i - 1] + k",
"- ans = min(ans, end - start)",
"-print(ans)",
"+def main():",
"+ k, n = list(map(int, input().split()))",
"+... | false | 0.037893 | 0.035147 | 1.078145 | [
"s207974760",
"s728556742"
] |
u197300260 | p03835 | python | s587068000 | s482386538 | 1,499 | 763 | 3,064 | 3,064 | Accepted | Accepted | 49.1 | # Problem:
# Python Try
import sys
# from collections import defaultdict
# import heapq,copy
# from collections import deque
intm1 = lambda x: int(x) - 1
intp1 = lambda x: int(x) + 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline(... | # Problem: https://atcoder.jp/contests/abc051/tasks/abc051_b
# Python 3rd Try
import sys
# from collections import defaultdict
# import heapq,copy
# from collections import deque
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(i... | 31 | 29 | 946 | 879 | # Problem:
# Python Try
import sys
# from collections import defaultdict
# import heapq,copy
# from collections import deque
intm1 = lambda x: int(x) - 1
intp1 = lambda x: int(x) + 1
p2D = lambda x: print(*x, sep="\n")
def II():
return int(sys.stdin.readline())
def MI():
return map(int, sys.stdin.readline... | # Problem: https://atcoder.jp/contests/abc051/tasks/abc051_b
# Python 3rd Try
import sys
# from collections import defaultdict
# import heapq,copy
# from collections import deque
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II():
return int(sys.stdin.readline())
def MI():
return map... | false | 6.451613 | [
"-# Problem:",
"-# Python Try",
"+# Problem: https://atcoder.jp/contests/abc051/tasks/abc051_b",
"+# Python 3rd Try",
"-intm1 = lambda x: int(x) - 1",
"-intp1 = lambda x: int(x) + 1",
"+int1 = lambda x: int(x) - 1",
"- return map(intm1, sys.stdin.readline().split())",
"+ return map(int1, sys... | false | 0.047537 | 0.047771 | 0.995106 | [
"s587068000",
"s482386538"
] |
u102461423 | p02710 | python | s698670703 | s639845535 | 1,541 | 824 | 192,728 | 157,400 | Accepted | Accepted | 46.53 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
from numba import njit
def EulerTour(graph, root=1):
N = len(graph) - 1
parent = [0] * (N + 1)
stack = [-root, root]
tour = []
ind_L = [0] * (N + 1)
... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
from numba import njit
@njit('(i4[:],i4[:],i4[:],i4)', cache=True)
def EulerTour(head, nxt, to, root):
N = len(head) - 1
parent = np.zeros_like(head)
ind_L = np.... | 70 | 93 | 1,931 | 2,629 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
from numba import njit
def EulerTour(graph, root=1):
N = len(graph) - 1
parent = [0] * (N + 1)
stack = [-root, root]
tour = []
ind_L = [0] * (N + 1)
ind_R = [... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
from numba import njit
@njit("(i4[:],i4[:],i4[:],i4)", cache=True)
def EulerTour(head, nxt, to, root):
N = len(head) - 1
parent = np.zeros_like(head)
ind_L = np.empty_lik... | false | 24.731183 | [
"-def EulerTour(graph, root=1):",
"- N = len(graph) - 1",
"- parent = [0] * (N + 1)",
"- stack = [-root, root]",
"- tour = []",
"- ind_L = [0] * (N + 1)",
"- ind_R = [0] * (N + 1)",
"- i = -1",
"- while stack:",
"- v = stack.pop()",
"- tour.append(v)",
"- ... | false | 0.269477 | 0.250359 | 1.076363 | [
"s698670703",
"s639845535"
] |
u844646164 | p02834 | python | s418589088 | s226005902 | 837 | 765 | 101,028 | 67,104 | Accepted | Accepted | 8.6 | import sys
sys.setrecursionlimit(1000000)
def make_adlist(n):
adlist = [[] for _ in range(n)]
for _ in range(n-1):
a, b = [int(x)-1 for x in input().split()]
adlist[a] += [b]
adlist[b] += [a]
return adlist
def dfs(adlist, s, dist, d):
for nxt in adlist[s]:
if dist[nxt] == -1:
... | from collections import deque
N, u, v = list(map(int, input().split()))
u -= 1
v -= 1
graph = [[] for _ in range(N)]
for _ in range(N-1):
a, b = [int(x)-1 for x in input().split()]
graph[a] += [b]
graph[b] += [a]
def bfs(s):
dist = [-1]*N
q = deque([s])
dist[s] = 0
while q:
u = q.pop... | 36 | 33 | 761 | 566 | import sys
sys.setrecursionlimit(1000000)
def make_adlist(n):
adlist = [[] for _ in range(n)]
for _ in range(n - 1):
a, b = [int(x) - 1 for x in input().split()]
adlist[a] += [b]
adlist[b] += [a]
return adlist
def dfs(adlist, s, dist, d):
for nxt in adlist[s]:
if dis... | from collections import deque
N, u, v = list(map(int, input().split()))
u -= 1
v -= 1
graph = [[] for _ in range(N)]
for _ in range(N - 1):
a, b = [int(x) - 1 for x in input().split()]
graph[a] += [b]
graph[b] += [a]
def bfs(s):
dist = [-1] * N
q = deque([s])
dist[s] = 0
while q:
... | false | 8.333333 | [
"-import sys",
"+from collections import deque",
"-sys.setrecursionlimit(1000000)",
"+N, u, v = list(map(int, input().split()))",
"+u -= 1",
"+v -= 1",
"+graph = [[] for _ in range(N)]",
"+for _ in range(N - 1):",
"+ a, b = [int(x) - 1 for x in input().split()]",
"+ graph[a] += [b]",
"+ ... | false | 0.046114 | 0.049236 | 0.9366 | [
"s418589088",
"s226005902"
] |
u960171798 | p02971 | python | s667280794 | s490228047 | 748 | 636 | 15,676 | 14,096 | Accepted | Accepted | 14.97 | n = int(eval(input()))
a = [0]*n
for i in range(n):
a[i] = int(eval(input()))
b = [0]*n
c = [0]*n
b[0] = a[0]
c[n-1] = a[n-1]
for i in range(1,n):
b[i]=max(b[i-1],a[i])
c[n-1-i]=max(c[n-i],a[n-1-i])
for i in range(n):
if i==0:
print((c[1]))
elif i==n-1:
print((b[n-... | n = int(eval(input()))
a = [0]*n
for i in range(n):
a[i] = int(eval(input()))
b = a[:]
b.sort()
for i in range(n):
if a[i]==b[n-1]:
print((b[n-2]))
else:
print((b[n-1]))
| 20 | 11 | 355 | 192 | n = int(eval(input()))
a = [0] * n
for i in range(n):
a[i] = int(eval(input()))
b = [0] * n
c = [0] * n
b[0] = a[0]
c[n - 1] = a[n - 1]
for i in range(1, n):
b[i] = max(b[i - 1], a[i])
c[n - 1 - i] = max(c[n - i], a[n - 1 - i])
for i in range(n):
if i == 0:
print((c[1]))
elif i == n - 1:
... | n = int(eval(input()))
a = [0] * n
for i in range(n):
a[i] = int(eval(input()))
b = a[:]
b.sort()
for i in range(n):
if a[i] == b[n - 1]:
print((b[n - 2]))
else:
print((b[n - 1]))
| false | 45 | [
"-b = [0] * n",
"-c = [0] * n",
"-b[0] = a[0]",
"-c[n - 1] = a[n - 1]",
"-for i in range(1, n):",
"- b[i] = max(b[i - 1], a[i])",
"- c[n - 1 - i] = max(c[n - i], a[n - 1 - i])",
"+b = a[:]",
"+b.sort()",
"- if i == 0:",
"- print((c[1]))",
"- elif i == n - 1:",
"+ if a[i... | false | 0.042832 | 0.042832 | 1.000008 | [
"s667280794",
"s490228047"
] |
u189479417 | p02707 | python | s170132783 | s187215282 | 227 | 159 | 37,520 | 32,272 | Accepted | Accepted | 29.96 | from collections import defaultdict
N = int(eval(input()))
A = list(map(int,input().split()))
d = defaultdict(int)
for i in A:
d[i] += 1
for i in range(1,N+1):
print((d[i])) | N = int(eval(input()))
A = list(map(int,input().split()))
ans = [0] * N
for i in range(N-1):
ans[A[i] - 1] += 1
for i in range(N):
print((ans[i])) | 8 | 7 | 180 | 152 | from collections import defaultdict
N = int(eval(input()))
A = list(map(int, input().split()))
d = defaultdict(int)
for i in A:
d[i] += 1
for i in range(1, N + 1):
print((d[i]))
| N = int(eval(input()))
A = list(map(int, input().split()))
ans = [0] * N
for i in range(N - 1):
ans[A[i] - 1] += 1
for i in range(N):
print((ans[i]))
| false | 12.5 | [
"-from collections import defaultdict",
"-",
"-d = defaultdict(int)",
"-for i in A:",
"- d[i] += 1",
"-for i in range(1, N + 1):",
"- print((d[i]))",
"+ans = [0] * N",
"+for i in range(N - 1):",
"+ ans[A[i] - 1] += 1",
"+for i in range(N):",
"+ print((ans[i]))"
] | false | 0.046735 | 0.045216 | 1.033586 | [
"s170132783",
"s187215282"
] |
u225388820 | p02756 | python | s390932935 | s558659372 | 608 | 532 | 13,492 | 13,412 | Accepted | Accepted | 12.5 | '''
∧_,,∧ 究極奥義「WAがACになーれ!!」
(`・ω・)つ━☆・*。
⊂ ノ ・゜+.
し’´J *・
'''
s=input()
a=[]
b=[]
now=1
q=int(input())
for i in range(q):
x=list(input().split())
if x[0]=="1":
now*=-1
else:
if now==1 and x[1]=="2" or now==-1 and x[1]=="1":
b.append(x[2])
... | s=input()
a=[]
b=[]
now=True
q=int(input())
for i in range(q):
x=list(input().split())
if x[0]=="1":
now=not now
else:
if now and x[1]=="2" or not now and x[1]=="1":
b.append(x[2])
else:
a.append(x[2])
if now:
ans=a[::-1]+list(s)+b
else:
... | 26 | 19 | 483 | 370 | """
∧_,,∧ 究極奥義「WAがACになーれ!!」
(`・ω・)つ━☆・*。
⊂ ノ ・゜+.
し’´J *・
"""
s = input()
a = []
b = []
now = 1
q = int(input())
for i in range(q):
x = list(input().split())
if x[0] == "1":
now *= -1
else:
if now == 1 and x[1] == "2" or now == -1 and x[1] == "1":
b.append(x[2])
... | s = input()
a = []
b = []
now = True
q = int(input())
for i in range(q):
x = list(input().split())
if x[0] == "1":
now = not now
else:
if now and x[1] == "2" or not now and x[1] == "1":
b.append(x[2])
else:
a.append(x[2])
if now:
ans = a[::-1] + list(s) + ... | false | 26.923077 | [
"-\"\"\"",
"- ∧_,,∧ 究極奥義「WAがACになーれ!!」",
"- (`・ω・)つ━☆・*。",
"- ⊂ ノ ・゜+.",
"- し’´J *・",
"-\"\"\"",
"-now = 1",
"+now = True",
"- now *= -1",
"+ now = not now",
"- if now == 1 and x[1] == \"2\" or now == -1 and x[1] == \"1\":",
"+ if now and x[1] == \"2\" or ... | false | 0.035242 | 0.05872 | 0.600171 | [
"s390932935",
"s558659372"
] |
u562935282 | p02861 | python | s751931998 | s846359795 | 217 | 23 | 39,792 | 3,444 | Accepted | Accepted | 89.4 | from itertools import permutations
from math import factorial
n = int(eval(input()))
xys = [tuple(map(int, input().split())) for _ in range(n)]
k = factorial(n)
ret = 0
for perm in permutations(xys):
a, b = perm[0]
for x, y in perm:
ret += (((x - a) ** 2 + (y - b) ** 2) ** 0.5)
a... | from collections import namedtuple
from math import sqrt
Coordinates = namedtuple('Coordinates', 'idx x y')
def calc_dist(a: Coordinates, b: Coordinates) -> float:
return sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2))
n = int(eval(input()))
Coods = []
for idx in range(n):
x, y = list(map(int, i... | 15 | 33 | 341 | 744 | from itertools import permutations
from math import factorial
n = int(eval(input()))
xys = [tuple(map(int, input().split())) for _ in range(n)]
k = factorial(n)
ret = 0
for perm in permutations(xys):
a, b = perm[0]
for x, y in perm:
ret += ((x - a) ** 2 + (y - b) ** 2) ** 0.5
a, b = x, y
print(... | from collections import namedtuple
from math import sqrt
Coordinates = namedtuple("Coordinates", "idx x y")
def calc_dist(a: Coordinates, b: Coordinates) -> float:
return sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2))
n = int(eval(input()))
Coods = []
for idx in range(n):
x, y = list(map(int, input().split())... | false | 54.545455 | [
"-from itertools import permutations",
"-from math import factorial",
"+from collections import namedtuple",
"+from math import sqrt",
"+",
"+Coordinates = namedtuple(\"Coordinates\", \"idx x y\")",
"+",
"+",
"+def calc_dist(a: Coordinates, b: Coordinates) -> float:",
"+ return sqrt(pow(a.x - b... | false | 0.04952 | 0.049569 | 0.999011 | [
"s751931998",
"s846359795"
] |
u009348313 | p02679 | python | s320402901 | s723858425 | 1,276 | 570 | 142,252 | 139,308 | Accepted | Accepted | 55.33 | import math
n = int(eval(input()))
ab = []
for i in range(n):
ab.append(tuple(map(int,input().split())))
MOD = 1000000007
d = {}
zero = 0
for a,b in ab:
if a == 0 and b == 0:
zero += 1
continue
g = math.gcd(a,b)
a //= g
b //= g
if b < 0:
a,b = -a,-b
elif a < 0 and b == 0:
... | import math
n = int(eval(input()))
ab = []
for i in range(n):
ab.append(tuple(map(int,input().split())))
MOD = 1000000007
d = {}
zero = 0
for a,b in ab:
if a == 0 and b == 0:
zero += 1
continue
g = math.gcd(a,b)
a //= g
b //= g
if b < 0:
a,b = -a,-b
elif a < 0 and b == 0:
... | 45 | 46 | 729 | 743 | import math
n = int(eval(input()))
ab = []
for i in range(n):
ab.append(tuple(map(int, input().split())))
MOD = 1000000007
d = {}
zero = 0
for a, b in ab:
if a == 0 and b == 0:
zero += 1
continue
g = math.gcd(a, b)
a //= g
b //= g
if b < 0:
a, b = -a, -b
elif a < 0 a... | import math
n = int(eval(input()))
ab = []
for i in range(n):
ab.append(tuple(map(int, input().split())))
MOD = 1000000007
d = {}
zero = 0
for a, b in ab:
if a == 0 and b == 0:
zero += 1
continue
g = math.gcd(a, b)
a //= g
b //= g
if b < 0:
a, b = -a, -b
elif a < 0 a... | false | 2.173913 | [
"+ ans %= MOD"
] | false | 0.041565 | 0.041959 | 0.990616 | [
"s320402901",
"s723858425"
] |
u411858517 | p02725 | python | s209445699 | s666495695 | 139 | 122 | 26,060 | 25,840 | Accepted | Accepted | 12.23 | K, N = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
tmp = 0
for i in range(N-1):
tmp = max(tmp, A[i+1]-A[i])
tmp = max(tmp, K + A[0] - A[-1])
print((K - tmp))
| K, N = list(map(int, input().split()))
A = list(map(int, input().split()))
tmp = [0 for _ in range(N)]
for i in range(N-1):
tmp[i] = A[i+1] - A[i]
tmp[-1] = K - A[-1] + A[0]
print((K - max(tmp))) | 12 | 10 | 202 | 203 | K, N = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
tmp = 0
for i in range(N - 1):
tmp = max(tmp, A[i + 1] - A[i])
tmp = max(tmp, K + A[0] - A[-1])
print((K - tmp))
| K, N = list(map(int, input().split()))
A = list(map(int, input().split()))
tmp = [0 for _ in range(N)]
for i in range(N - 1):
tmp[i] = A[i + 1] - A[i]
tmp[-1] = K - A[-1] + A[0]
print((K - max(tmp)))
| false | 16.666667 | [
"-A.sort()",
"-tmp = 0",
"+tmp = [0 for _ in range(N)]",
"- tmp = max(tmp, A[i + 1] - A[i])",
"-tmp = max(tmp, K + A[0] - A[-1])",
"-print((K - tmp))",
"+ tmp[i] = A[i + 1] - A[i]",
"+tmp[-1] = K - A[-1] + A[0]",
"+print((K - max(tmp)))"
] | false | 0.043783 | 0.041463 | 1.055951 | [
"s209445699",
"s666495695"
] |
u644907318 | p02928 | python | s452025757 | s176847660 | 1,316 | 130 | 9,236 | 68,200 | Accepted | Accepted | 90.12 | p = 10**9+7
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
inner=0
for i in range(N-1):
for j in range(i+1,N):
if A[i]>A[j]:
inner += 1
B = A+A
outer = 0
for i in range(2*N-1):
for j in range(i+1,2*N):
if B[i]>B[j]:
outer += 1
outer ... | p = 10**9+7
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
cnt_in = 0
for i in range(N-1):
for j in range(i+1,N):
if A[i]>A[j]:
cnt_in += 1
A = A+A
cnt_out=0
for i in range(2*N-1):
for j in range(i+1,2*N):
if A[i]>A[j]:
cnt_out += 1
... | 19 | 18 | 400 | 404 | p = 10**9 + 7
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
inner = 0
for i in range(N - 1):
for j in range(i + 1, N):
if A[i] > A[j]:
inner += 1
B = A + A
outer = 0
for i in range(2 * N - 1):
for j in range(i + 1, 2 * N):
if B[i] > B[j]:
oute... | p = 10**9 + 7
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
cnt_in = 0
for i in range(N - 1):
for j in range(i + 1, N):
if A[i] > A[j]:
cnt_in += 1
A = A + A
cnt_out = 0
for i in range(2 * N - 1):
for j in range(i + 1, 2 * N):
if A[i] > A[j]:
... | false | 5.263158 | [
"-inner = 0",
"+cnt_in = 0",
"- inner += 1",
"-B = A + A",
"-outer = 0",
"+ cnt_in += 1",
"+A = A + A",
"+cnt_out = 0",
"- if B[i] > B[j]:",
"- outer += 1",
"-outer -= 2 * inner",
"-cnt = (inner * K) % p",
"-a = ((K * (K - 1)) // 2) % p",
"-cnt = (cn... | false | 0.100667 | 0.037513 | 2.683557 | [
"s452025757",
"s176847660"
] |
u654470292 | p02772 | python | s705754122 | s432938710 | 291 | 173 | 63,980 | 38,384 | Accepted | Accepted | 40.55 | import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
return sys.stdin.readline()[:-1]
mod=pow(10,9)+7
n=int(eval(input()))
a=list(map(int,input().split()))
for i in range(n)... | n=int(eval(input()))
a=list(map(int,input().split()))
s=1
for i in range(n):
s=s*a[i]
# sが奇数なら
if s%2==1:
print("APPROVED")
exit()
p=[]
for i in range(n):
p.append(1)
z=0
for i in range(n):
if a[i]%2==1:
p[i]=0
else:
if a[i]%6==0:
p[i]=0
... | 22 | 31 | 481 | 432 | import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations, accumulate, combinations, product
from fractions import gcd
def input():
return sys.stdin.readline()[:-1]
mod = pow(10, 9) + 7
n = int(eval(input()))
a = list(map(int, input().split()))
for i in range... | n = int(eval(input()))
a = list(map(int, input().split()))
s = 1
for i in range(n):
s = s * a[i]
# sが奇数なら
if s % 2 == 1:
print("APPROVED")
exit()
p = []
for i in range(n):
p.append(1)
z = 0
for i in range(n):
if a[i] % 2 == 1:
p[i] = 0
else:
if a[i] % 6 == 0:
p[i] = 0... | false | 29.032258 | [
"-import sys",
"-from collections import *",
"-import heapq",
"-import math",
"-import bisect",
"-from itertools import permutations, accumulate, combinations, product",
"-from fractions import gcd",
"-",
"-",
"-def input():",
"- return sys.stdin.readline()[:-1]",
"-",
"-",
"-mod = pow(... | false | 0.103459 | 0.038195 | 2.708705 | [
"s705754122",
"s432938710"
] |
u181668771 | p03001 | python | s705551943 | s862421945 | 19 | 17 | 3,060 | 2,940 | Accepted | Accepted | 10.53 | W,H,x,y = list(map(int,input().split()))
w = W/2
h = H/2
ansA = 0
ansB = 0
xR = W-x
yR = H-y
ansA = W*H/2
if w == x and h == y:
ansB = 1
print((ansA,ansB))
| W,H,x,y = list(map(int,input().split()))
w = W/2
h = H/2
ansA = 0
ansB = 0
ansA = W*H/2
if w == x and h == y:
ansB = 1
print((ansA,ansB))
| 16 | 9 | 172 | 142 | W, H, x, y = list(map(int, input().split()))
w = W / 2
h = H / 2
ansA = 0
ansB = 0
xR = W - x
yR = H - y
ansA = W * H / 2
if w == x and h == y:
ansB = 1
print((ansA, ansB))
| W, H, x, y = list(map(int, input().split()))
w = W / 2
h = H / 2
ansA = 0
ansB = 0
ansA = W * H / 2
if w == x and h == y:
ansB = 1
print((ansA, ansB))
| false | 43.75 | [
"-xR = W - x",
"-yR = H - y"
] | false | 0.045467 | 0.067991 | 0.668721 | [
"s705551943",
"s862421945"
] |
u384124931 | p02629 | python | s819460677 | s426019755 | 62 | 29 | 61,836 | 9,112 | Accepted | Accepted | 53.23 | def num2alpha(num):
if num<=26:
return chr(64+num)
elif num%26==0:
return num2alpha(num//26-1)+chr(90)
else:
return num2alpha(num//26)+chr(64+num%26)
n = int(eval(input()))
print((num2alpha(n).lower())) | def num2alpha(num):
if num<=26:
return chr(64+num)
elif num%26==0:#例 26*12 = 26^1 * 11 + 26^0 * 26に変換する
return num2alpha(num//26-1)+chr(90)
else:
return num2alpha(num//26)+chr(64+num%26)
n = int(eval(input()))
print((num2alpha(n).lower()))
| 9 | 9 | 238 | 276 | def num2alpha(num):
if num <= 26:
return chr(64 + num)
elif num % 26 == 0:
return num2alpha(num // 26 - 1) + chr(90)
else:
return num2alpha(num // 26) + chr(64 + num % 26)
n = int(eval(input()))
print((num2alpha(n).lower()))
| def num2alpha(num):
if num <= 26:
return chr(64 + num)
elif num % 26 == 0: # 例 26*12 = 26^1 * 11 + 26^0 * 26に変換する
return num2alpha(num // 26 - 1) + chr(90)
else:
return num2alpha(num // 26) + chr(64 + num % 26)
n = int(eval(input()))
print((num2alpha(n).lower()))
| false | 0 | [
"- elif num % 26 == 0:",
"+ elif num % 26 == 0: # 例 26*12 = 26^1 * 11 + 26^0 * 26に変換する"
] | false | 0.080241 | 0.089758 | 0.893978 | [
"s819460677",
"s426019755"
] |
u562935282 | p03148 | python | s310479145 | s365550375 | 350 | 244 | 19,392 | 18,396 | Accepted | Accepted | 30.29 | def solve():
from collections import deque, namedtuple
from operator import attrgetter
import sys
input = sys.stdin.readline
Sushi = namedtuple('Sushi', 'taste kind')
n, k = list(map(int, input().split()))
e = []
for _ in range(n):
t, d = list(map(int, input().spli... | def main():
from heapq import heappush, heappop
from operator import itemgetter
import sys
input = sys.stdin.readline
N, K = list(map(int, input().split()))
dd = []
for _ in range(N):
t, d = list(map(int, input().split()))
t -= 1
dd.append((d, t))
d... | 53 | 48 | 1,223 | 1,061 | def solve():
from collections import deque, namedtuple
from operator import attrgetter
import sys
input = sys.stdin.readline
Sushi = namedtuple("Sushi", "taste kind")
n, k = list(map(int, input().split()))
e = []
for _ in range(n):
t, d = list(map(int, input().split()))
... | def main():
from heapq import heappush, heappop
from operator import itemgetter
import sys
input = sys.stdin.readline
N, K = list(map(int, input().split()))
dd = []
for _ in range(N):
t, d = list(map(int, input().split()))
t -= 1
dd.append((d, t))
dd.sort(key=ite... | false | 9.433962 | [
"-def solve():",
"- from collections import deque, namedtuple",
"- from operator import attrgetter",
"+def main():",
"+ from heapq import heappush, heappop",
"+ from operator import itemgetter",
"- Sushi = namedtuple(\"Sushi\", \"taste kind\")",
"- n, k = list(map(int, input().split(... | false | 0.037855 | 0.046743 | 0.809846 | [
"s310479145",
"s365550375"
] |
u747709646 | p02410 | python | s821153490 | s147968688 | 50 | 20 | 7,964 | 8,184 | Accepted | Accepted | 60 | n,m = list(map(int, input().split()))
A = []
for i in range(n):
A.append(list(map(int, input().split())))
b = [0] * m
for i in range(m):
b[i] = int(eval(input()))
c = [0] * n
for i in range(n):
for j in range(m):
c[i] += A[i][j] * b[j]
print((c[i])) | n,m = list(map(int, input().split()))
A = []
for i in range(n):
A.append(list(map(int, input().split())))
b = [0] * m
for i in range(m):
b[i] = int(eval(input()))
from operator import mul
for i in range(n):
print((sum(map(mul, A[i], b)))) | 15 | 13 | 276 | 251 | n, m = list(map(int, input().split()))
A = []
for i in range(n):
A.append(list(map(int, input().split())))
b = [0] * m
for i in range(m):
b[i] = int(eval(input()))
c = [0] * n
for i in range(n):
for j in range(m):
c[i] += A[i][j] * b[j]
print((c[i]))
| n, m = list(map(int, input().split()))
A = []
for i in range(n):
A.append(list(map(int, input().split())))
b = [0] * m
for i in range(m):
b[i] = int(eval(input()))
from operator import mul
for i in range(n):
print((sum(map(mul, A[i], b))))
| false | 13.333333 | [
"-c = [0] * n",
"+from operator import mul",
"+",
"- for j in range(m):",
"- c[i] += A[i][j] * b[j]",
"- print((c[i]))",
"+ print((sum(map(mul, A[i], b))))"
] | false | 0.065109 | 0.085167 | 0.76449 | [
"s821153490",
"s147968688"
] |
u868701750 | p03486 | python | s864106371 | s309078411 | 20 | 17 | 3,060 | 2,940 | Accepted | Accepted | 15 | s = list(eval(input()))
t = list(eval(input()))
s.sort()
t.sort(reverse=True)
if ''.join(s) < ''.join(t):
print('Yes')
else:
print('No')
| def main():
s = list(eval(input()))
t = list(eval(input()))
s.sort()
t.sort(reverse=True)
if ''.join(s) < ''.join(t):
print('Yes')
else:
print('No')
if __name__ == '__main__':
main() | 10 | 14 | 144 | 238 | s = list(eval(input()))
t = list(eval(input()))
s.sort()
t.sort(reverse=True)
if "".join(s) < "".join(t):
print("Yes")
else:
print("No")
| def main():
s = list(eval(input()))
t = list(eval(input()))
s.sort()
t.sort(reverse=True)
if "".join(s) < "".join(t):
print("Yes")
else:
print("No")
if __name__ == "__main__":
main()
| false | 28.571429 | [
"-s = list(eval(input()))",
"-t = list(eval(input()))",
"-s.sort()",
"-t.sort(reverse=True)",
"-if \"\".join(s) < \"\".join(t):",
"- print(\"Yes\")",
"-else:",
"- print(\"No\")",
"+def main():",
"+ s = list(eval(input()))",
"+ t = list(eval(input()))",
"+ s.sort()",
"+ t.so... | false | 0.058554 | 0.054194 | 1.080455 | [
"s864106371",
"s309078411"
] |
u729133443 | p02760 | python | s158887712 | s434736143 | 165 | 17 | 38,296 | 3,060 | Accepted | Accepted | 89.7 | *a,=list(map(int,open(0).read().split()));print(('NYoe s'[any(t<=set(a.index(b)for b in a[10:])for t in({0,1,2},{0,3,6},{0,4,8},{1,4,7},{2,4,6},{2,5,8},{3,4,5},{6,7,8}))::2])) | *a,=list(map(int,open(0).read().split()));print(('YNeos'[all(t-set(a.index(b)for b in a[10:])for t in({0,1,2},{0,3,6},{0,4,8},{1,4,7},{2,4,6},{2,5,8},{3,4,5},{6,7,8}))::2])) | 1 | 1 | 167 | 165 | (*a,) = list(map(int, open(0).read().split()))
print(
(
"NYoe s"[
any(
t <= set(a.index(b) for b in a[10:])
for t in (
{0, 1, 2},
{0, 3, 6},
{0, 4, 8},
{1, 4, 7},
{... | (*a,) = list(map(int, open(0).read().split()))
print(
(
"YNeos"[
all(
t - set(a.index(b) for b in a[10:])
for t in (
{0, 1, 2},
{0, 3, 6},
{0, 4, 8},
{1, 4, 7},
{2,... | false | 0 | [
"- \"NYoe s\"[",
"- any(",
"- t <= set(a.index(b) for b in a[10:])",
"+ \"YNeos\"[",
"+ all(",
"+ t - set(a.index(b) for b in a[10:])"
] | false | 0.132886 | 0.03782 | 3.513598 | [
"s158887712",
"s434736143"
] |
u790710233 | p03476 | python | s330107617 | s017114998 | 1,363 | 887 | 13,472 | 8,284 | Accepted | Accepted | 34.92 | q = int(input())
def is_prime(x):
if x == 1:
return False
d = 2
while d**2 <= x:
if x % d == 0:
return False
d += 1
else:
return True
primes = []
for x in range(2, 10**5+1):
if is_prime(x):
primes.append(x)
A = [0]*(1... | U = 10**5
is_prime = [1]*(U+1)
is_prime[0] = 0
is_prime[1] = 0
for p in range(2, int(U**.5)+1):
if is_prime[p]:
for q in range(2*p, U+1, p):
is_prime[q] = 0
primes = [p for p, tf in enumerate(is_prime) if tf]
A = [0]*(10**5+1)
for prime in primes:
if is_prime[(prime+1)//2]:
... | 37 | 28 | 620 | 536 | q = int(input())
def is_prime(x):
if x == 1:
return False
d = 2
while d**2 <= x:
if x % d == 0:
return False
d += 1
else:
return True
primes = []
for x in range(2, 10**5 + 1):
if is_prime(x):
primes.append(x)
A = [0] * (10**5 + 1)
for prime in ... | U = 10**5
is_prime = [1] * (U + 1)
is_prime[0] = 0
is_prime[1] = 0
for p in range(2, int(U**0.5) + 1):
if is_prime[p]:
for q in range(2 * p, U + 1, p):
is_prime[q] = 0
primes = [p for p, tf in enumerate(is_prime) if tf]
A = [0] * (10**5 + 1)
for prime in primes:
if is_prime[(prime + 1) // 2]... | false | 24.324324 | [
"-q = int(input())",
"-",
"-",
"-def is_prime(x):",
"- if x == 1:",
"- return False",
"- d = 2",
"- while d**2 <= x:",
"- if x % d == 0:",
"- return False",
"- d += 1",
"- else:",
"- return True",
"-",
"-",
"-primes = []",
"-for x in... | false | 2.331882 | 0.14092 | 16.547536 | [
"s330107617",
"s017114998"
] |
u707808519 | p02596 | python | s633709690 | s544275568 | 215 | 176 | 9,156 | 9,060 | Accepted | Accepted | 18.14 | K = int(eval(input()))
if K%2 == 0:
print((-1))
elif K%5 == 0:
print((-1))
else:
res = 7
for i in range(K):
if res % K == 0:
break
res = (res * 10 + 7) % K
print((i + 1)) | K = int(eval(input()))
res = 7 % K
for i in range(K):
if res == 0:
ans = i+1
break
res = (res * 10 + 7) % K
if res != 0:
ans = -1
print(ans) | 12 | 10 | 217 | 171 | K = int(eval(input()))
if K % 2 == 0:
print((-1))
elif K % 5 == 0:
print((-1))
else:
res = 7
for i in range(K):
if res % K == 0:
break
res = (res * 10 + 7) % K
print((i + 1))
| K = int(eval(input()))
res = 7 % K
for i in range(K):
if res == 0:
ans = i + 1
break
res = (res * 10 + 7) % K
if res != 0:
ans = -1
print(ans)
| false | 16.666667 | [
"-if K % 2 == 0:",
"- print((-1))",
"-elif K % 5 == 0:",
"- print((-1))",
"-else:",
"- res = 7",
"- for i in range(K):",
"- if res % K == 0:",
"- break",
"- res = (res * 10 + 7) % K",
"- print((i + 1))",
"+res = 7 % K",
"+for i in range(K):",
"+ i... | false | 0.071108 | 0.068637 | 1.035991 | [
"s633709690",
"s544275568"
] |
u219197917 | p03014 | python | s259169437 | s795152037 | 744 | 664 | 222,892 | 228,840 | Accepted | Accepted | 10.75 | import sys
import numpy as np
def read():
return sys.stdin.readline().rstrip()
def main():
h, w = list(map(int, read().split()))
s = np.array([[i == "." for i in read()] for _ in range(h)], dtype=int)
left = np.zeros((h, w), dtype=int)
right = np.zeros((h, w), dtype=int)
up = np... | import sys
import numpy as np
def read():
return sys.stdin.readline().rstrip()
def main():
h, w = list(map(int, read().split()))
s = np.array([[i == "." for i in read()] for _ in range(h)], dtype=int)
left = s.copy()
right = s.copy()
up = s.copy()
down = s.copy()
for i... | 30 | 26 | 846 | 675 | import sys
import numpy as np
def read():
return sys.stdin.readline().rstrip()
def main():
h, w = list(map(int, read().split()))
s = np.array([[i == "." for i in read()] for _ in range(h)], dtype=int)
left = np.zeros((h, w), dtype=int)
right = np.zeros((h, w), dtype=int)
up = np.zeros((h, w)... | import sys
import numpy as np
def read():
return sys.stdin.readline().rstrip()
def main():
h, w = list(map(int, read().split()))
s = np.array([[i == "." for i in read()] for _ in range(h)], dtype=int)
left = s.copy()
right = s.copy()
up = s.copy()
down = s.copy()
for i in range(w - 1... | false | 13.333333 | [
"- left = np.zeros((h, w), dtype=int)",
"- right = np.zeros((h, w), dtype=int)",
"- up = np.zeros((h, w), dtype=int)",
"- down = np.zeros((h, w), dtype=int)",
"- left[:, 0] = s[:, 0]",
"- right[:, -1] = s[:, -1]",
"+ left = s.copy()",
"+ right = s.copy()",
"+ up = s.copy()... | false | 0.212146 | 0.245128 | 0.865451 | [
"s259169437",
"s795152037"
] |
u562935282 | p02821 | python | s773607604 | s651194938 | 1,133 | 851 | 14,260 | 14,268 | Accepted | Accepted | 24.89 | def binary_search(*, ok, ng, is_ok):
while abs(ok - ng) > 1:
mid = (ng + ok) // 2
if is_ok(mid):
ok = mid
else:
ng = mid
return ok
def main():
from itertools import accumulate
N, M = list(map(int, input().split()))
*A, = sorted(map(int... | # 過去の提出を見ながら解いた
def main():
N, M = list(map(int, input().split()))
*a, = list(map(int, input().split()))
a.sort()
def count(mid) -> int:
cnt = 0 # (i,j)>=mid の個数
j = N # j: iと組んでペア和>=midを満たすjの下限, 初期値は範囲外=条件を満たすjはない
for i in range(N):
while j > 0 and a[i... | 48 | 55 | 1,013 | 1,486 | def binary_search(*, ok, ng, is_ok):
while abs(ok - ng) > 1:
mid = (ng + ok) // 2
if is_ok(mid):
ok = mid
else:
ng = mid
return ok
def main():
from itertools import accumulate
N, M = list(map(int, input().split()))
(*A,) = sorted(map(int, input().sp... | # 過去の提出を見ながら解いた
def main():
N, M = list(map(int, input().split()))
(*a,) = list(map(int, input().split()))
a.sort()
def count(mid) -> int:
cnt = 0 # (i,j)>=mid の個数
j = N # j: iと組んでペア和>=midを満たすjの下限, 初期値は範囲外=条件を満たすjはない
for i in range(N):
while j > 0 and a[i] + a[j - ... | false | 12.727273 | [
"-def binary_search(*, ok, ng, is_ok):",
"- while abs(ok - ng) > 1:",
"- mid = (ng + ok) // 2",
"- if is_ok(mid):",
"- ok = mid",
"- else:",
"- ng = mid",
"- return ok",
"+# 過去の提出を見ながら解いた",
"+def main():",
"+ N, M = list(map(int, input().split(... | false | 0.040679 | 0.120634 | 0.337209 | [
"s773607604",
"s651194938"
] |
u845333844 | p03633 | python | s748364393 | s411254606 | 49 | 41 | 5,432 | 5,332 | Accepted | Accepted | 16.33 | from fractions import gcd
n=int(eval(input()))
l=[int(eval(input())) for i in range(n)]
if n==1:
print((l[0]))
elif n==2:
x=gcd(l[0],l[1])
print((l[0]*l[1]//x))
else:
g=gcd(l[0],l[1])
lcm=l[0]*l[1]//g
for i in range(2,n):
g=gcd(lcm,l[i])
lcm=lcm*l[i]//g
print(lc... | from fractions import gcd
from functools import reduce
n=int(eval(input()))
l=[int(eval(input())) for i in range(n)]
def lcm(x,y):
return (x*y)//gcd(x,y)
def lcm_list(numbers):
return reduce(lcm,numbers,1)
if n==1:
print((l[0]))
else:
print((lcm_list(l))) | 15 | 13 | 306 | 268 | from fractions import gcd
n = int(eval(input()))
l = [int(eval(input())) for i in range(n)]
if n == 1:
print((l[0]))
elif n == 2:
x = gcd(l[0], l[1])
print((l[0] * l[1] // x))
else:
g = gcd(l[0], l[1])
lcm = l[0] * l[1] // g
for i in range(2, n):
g = gcd(lcm, l[i])
lcm = lcm * l... | from fractions import gcd
from functools import reduce
n = int(eval(input()))
l = [int(eval(input())) for i in range(n)]
def lcm(x, y):
return (x * y) // gcd(x, y)
def lcm_list(numbers):
return reduce(lcm, numbers, 1)
if n == 1:
print((l[0]))
else:
print((lcm_list(l)))
| false | 13.333333 | [
"+from functools import reduce",
"+",
"+",
"+def lcm(x, y):",
"+ return (x * y) // gcd(x, y)",
"+",
"+",
"+def lcm_list(numbers):",
"+ return reduce(lcm, numbers, 1)",
"+",
"+",
"-elif n == 2:",
"- x = gcd(l[0], l[1])",
"- print((l[0] * l[1] // x))",
"- g = gcd(l[0], l[1])... | false | 0.096183 | 0.09605 | 1.001387 | [
"s748364393",
"s411254606"
] |
u062691227 | p03723 | python | s349991182 | s605887582 | 61 | 31 | 61,688 | 9,096 | Accepted | Accepted | 49.18 | a,b,c=list(map(int,input().split()))
e=a-b|b-c
print(((e!=b%2)*len(f'{(e&-e):b}')-1)) | a,b,c=list(map(int,input().split()))
e=a-b|b-c
print(((e!=b%2)*len(f'{e&-e:b}')-1))
| 3 | 3 | 79 | 78 | a, b, c = list(map(int, input().split()))
e = a - b | b - c
print(((e != b % 2) * len(f"{(e&-e):b}") - 1))
| a, b, c = list(map(int, input().split()))
e = a - b | b - c
print(((e != b % 2) * len(f"{e&-e:b}") - 1))
| false | 0 | [
"-print(((e != b % 2) * len(f\"{(e&-e):b}\") - 1))",
"+print(((e != b % 2) * len(f\"{e&-e:b}\") - 1))"
] | false | 0.036492 | 0.035731 | 1.021285 | [
"s349991182",
"s605887582"
] |
u294385082 | p02726 | python | s012227475 | s733426381 | 1,900 | 1,258 | 3,444 | 3,444 | Accepted | Accepted | 33.79 | n,x,y = list(map(int,input().split()))
k = [0]*(n)
for i in range(1,n):
for j in range(i+1,n+1):
if i < x and j <= x:
k[j-i] += 1
elif i >= y and j > y:
k[j-i] += 1
elif x <= i < y and x< j <= y:
ind = min(j-i,i-x+y-j+1)
k[ind] += 1
elif i < x and x < j <= y:
... | n,x,y = list(map(int,input().split()))
k = [0]*(n)
for i in range(1,n):
for j in range(i+1,n+1):
ind = min(j-i,abs(x-i) + abs(j-y) + 1)
k[ind] += 1
for i in range(1,n):
print((k[i])) | 24 | 10 | 563 | 204 | n, x, y = list(map(int, input().split()))
k = [0] * (n)
for i in range(1, n):
for j in range(i + 1, n + 1):
if i < x and j <= x:
k[j - i] += 1
elif i >= y and j > y:
k[j - i] += 1
elif x <= i < y and x < j <= y:
ind = min(j - i, i - x + y - j + 1)
... | n, x, y = list(map(int, input().split()))
k = [0] * (n)
for i in range(1, n):
for j in range(i + 1, n + 1):
ind = min(j - i, abs(x - i) + abs(j - y) + 1)
k[ind] += 1
for i in range(1, n):
print((k[i]))
| false | 58.333333 | [
"- if i < x and j <= x:",
"- k[j - i] += 1",
"- elif i >= y and j > y:",
"- k[j - i] += 1",
"- elif x <= i < y and x < j <= y:",
"- ind = min(j - i, i - x + y - j + 1)",
"- k[ind] += 1",
"- elif i < x and x < j <= y:",
"- ... | false | 0.041009 | 0.041598 | 0.985842 | [
"s012227475",
"s733426381"
] |
u340781749 | p02579 | python | s598822774 | s533110954 | 985 | 838 | 30,016 | 30,532 | Accepted | Accepted | 14.92 | import os
import sys
import numpy as np
from heapq import heappop, heappush
def solve(h, w, s, t, field):
WARP = (-(w * 2 + 10), -(w * 2 + 9), -(w * 2 + 8), -(w * 2 + 7), -(w * 2 + 6),
-(w + 6), -(w + 5), -(w + 3), -(w + 2),
-2, 2,
w + 2, w + 3, w + 5, w + 6,
... | import os
import sys
import numpy as np
from heapq import heappop, heappush
def solve(h, w, s, t, field):
WARP = (-(w * 2 + 10), -(w * 2 + 9), -(w * 2 + 8), -(w * 2 + 7), -(w * 2 + 6),
-(w + 6), -(w + 5), -(w + 3), -(w + 2),
-2, 2,
w + 2, w + 3, w + 5, w + 6,
... | 64 | 69 | 1,831 | 1,976 | import os
import sys
import numpy as np
from heapq import heappop, heappush
def solve(h, w, s, t, field):
WARP = (
-(w * 2 + 10),
-(w * 2 + 9),
-(w * 2 + 8),
-(w * 2 + 7),
-(w * 2 + 6),
-(w + 6),
-(w + 5),
-(w + 3),
-(w + 2),
-2,
... | import os
import sys
import numpy as np
from heapq import heappop, heappush
def solve(h, w, s, t, field):
WARP = (
-(w * 2 + 10),
-(w * 2 + 9),
-(w * 2 + 8),
-(w * 2 + 7),
-(w * 2 + 6),
-(w + 6),
-(w + 5),
-(w + 3),
-(w + 2),
-2,
... | false | 7.246377 | [
"+ queued = np.zeros((h + 4) * (w + 4), np.int8)",
"+ queued[s] = 1",
"- if field[v + d] or visited[v + d]:",
"+ u = v + d",
"+ if field[u] or visited[u] or queued[u]:",
"- heappush(q, (cost, d + v))",
"+ queued[u] = 1",
"+ heappu... | false | 0.306937 | 0.199516 | 1.538404 | [
"s598822774",
"s533110954"
] |
u681917640 | p03246 | python | s546380465 | s772762188 | 138 | 62 | 25,088 | 14,268 | Accepted | Accepted | 55.07 | n = int(eval(input()))
nums = list(map(int, input().split()))
nums1 = nums[0::2]
nums2 = nums[1::2]
bug1 = [0] * 1000000
bug2 = [0] * 1000000
for num in nums1:
bug1[num] += 1
for num in nums2:
bug2[num] += 1
max_v_1 = max(bug1)
max_i_1 = bug1.index(max_v_1)
max_v_2 = max(bug2)
max_i_2 = b... | n = int(eval(input()))
nums = list(map(int, input().split()))
nums1 = nums[0::2]
nums2 = nums[1::2]
bug1 = [0] * 100001
bug2 = [0] * 100001
for num in nums1:
bug1[num] += 1
for num in nums2:
bug2[num] += 1
max_v_1 = max(bug1)
max_i_1 = bug1.index(max_v_1)
max_v_2 = max(bug2)
max_i_2 = bug... | 28 | 28 | 573 | 571 | n = int(eval(input()))
nums = list(map(int, input().split()))
nums1 = nums[0::2]
nums2 = nums[1::2]
bug1 = [0] * 1000000
bug2 = [0] * 1000000
for num in nums1:
bug1[num] += 1
for num in nums2:
bug2[num] += 1
max_v_1 = max(bug1)
max_i_1 = bug1.index(max_v_1)
max_v_2 = max(bug2)
max_i_2 = bug2.index(max_v_2)
if m... | n = int(eval(input()))
nums = list(map(int, input().split()))
nums1 = nums[0::2]
nums2 = nums[1::2]
bug1 = [0] * 100001
bug2 = [0] * 100001
for num in nums1:
bug1[num] += 1
for num in nums2:
bug2[num] += 1
max_v_1 = max(bug1)
max_i_1 = bug1.index(max_v_1)
max_v_2 = max(bug2)
max_i_2 = bug2.index(max_v_2)
if max... | false | 0 | [
"-bug1 = [0] * 1000000",
"-bug2 = [0] * 1000000",
"+bug1 = [0] * 100001",
"+bug2 = [0] * 100001"
] | false | 0.120795 | 0.060106 | 2.009692 | [
"s546380465",
"s772762188"
] |
u813286880 | p02848 | python | s673612245 | s598056786 | 22 | 20 | 3,060 | 3,060 | Accepted | Accepted | 9.09 | N = int(eval(input()))
S = eval(input())
ans = ''
for word in S:
tmp = ord(word) # 文字列 → ASCIIコード
tmp += N
if tmp > 90: tmp -= 26
ans += chr(tmp) # ASCIIコード → 文字列
print(('{}'.format(ans)))
| def main():
N = int(eval(input()))
S = eval(input())
ans = ''
for word in S:
tmp = ord(word) # 文字列 → ASCIIコード
tmp += N
if tmp > 90: tmp -= 26
ans += chr(tmp) # ASCIIコード → 文字列
print(('{}'.format(ans)))
if __name__ == '__main__':
main() | 11 | 16 | 203 | 295 | N = int(eval(input()))
S = eval(input())
ans = ""
for word in S:
tmp = ord(word) # 文字列 → ASCIIコード
tmp += N
if tmp > 90:
tmp -= 26
ans += chr(tmp) # ASCIIコード → 文字列
print(("{}".format(ans)))
| def main():
N = int(eval(input()))
S = eval(input())
ans = ""
for word in S:
tmp = ord(word) # 文字列 → ASCIIコード
tmp += N
if tmp > 90:
tmp -= 26
ans += chr(tmp) # ASCIIコード → 文字列
print(("{}".format(ans)))
if __name__ == "__main__":
main()
| false | 31.25 | [
"-N = int(eval(input()))",
"-S = eval(input())",
"-ans = \"\"",
"-for word in S:",
"- tmp = ord(word) # 文字列 → ASCIIコード",
"- tmp += N",
"- if tmp > 90:",
"- tmp -= 26",
"- ans += chr(tmp) # ASCIIコード → 文字列",
"-print((\"{}\".format(ans)))",
"+def main():",
"+ N = int(eval(... | false | 0.033874 | 0.047751 | 0.709374 | [
"s673612245",
"s598056786"
] |
u747602774 | p02727 | python | s273437684 | s408245571 | 399 | 244 | 23,328 | 23,328 | Accepted | Accepted | 38.85 | x,y,a,b,c = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
r.sort()
ans = 0
cnt = 0
while x+y-cnt > 0:
if x > 0:
p1 = p[-1]
else:
p1 = 0
if y > 0:
p2 = q[... | x,y,a,b,c = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
r.sort()
ans = p[a-x:]+q[b-y:]+r
ans.sort()
print((sum(ans[c:])))
| 38 | 10 | 640 | 233 | x, y, a, b, c = list(map(int, input().split()))
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
ans = 0
cnt = 0
while x + y - cnt > 0:
if x > 0:
p1 = p[-1]
else:
p1 = 0
if y > 0:
p2 = q[-1]
els... | x, y, a, b, c = list(map(int, input().split()))
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
ans = p[a - x :] + q[b - y :] + r
ans.sort()
print((sum(ans[c:])))
| false | 73.684211 | [
"-ans = 0",
"-cnt = 0",
"-while x + y - cnt > 0:",
"- if x > 0:",
"- p1 = p[-1]",
"- else:",
"- p1 = 0",
"- if y > 0:",
"- p2 = q[-1]",
"- else:",
"- p2 = 0",
"- if cnt < c:",
"- p3 = r[-1]",
"- else:",
"- p3 = 0",
"- eat =... | false | 0.049789 | 0.0464 | 1.073049 | [
"s273437684",
"s408245571"
] |
u231136358 | p02256 | python | s338373859 | s228733924 | 30 | 20 | 7,780 | 7,656 | Accepted | Accepted | 33.33 | import sys
import math
(a, b) = tuple([int(s) for s in input().split()])
if a==b:
print(a)
sys.exit(0)
min = a if a < b else b
divisor = 1
i = 2
while i < math.sqrt(min):
if a % i == 0 and b % i == 0:
a = a / i
b = b / i
divisor = divisor * i
else:
... | # 1_1_B
def gcd(x, y):
while x%y != 0:
x, y = y, x%y
return y
x, y = list(map(int, input().split()))
print((gcd(x, y))) | 22 | 9 | 347 | 137 | import sys
import math
(a, b) = tuple([int(s) for s in input().split()])
if a == b:
print(a)
sys.exit(0)
min = a if a < b else b
divisor = 1
i = 2
while i < math.sqrt(min):
if a % i == 0 and b % i == 0:
a = a / i
b = b / i
divisor = divisor * i
else:
i = i + 1
print(divi... | # 1_1_B
def gcd(x, y):
while x % y != 0:
x, y = y, x % y
return y
x, y = list(map(int, input().split()))
print((gcd(x, y)))
| false | 59.090909 | [
"-import sys",
"-import math",
"+# 1_1_B",
"+def gcd(x, y):",
"+ while x % y != 0:",
"+ x, y = y, x % y",
"+ return y",
"-(a, b) = tuple([int(s) for s in input().split()])",
"-if a == b:",
"- print(a)",
"- sys.exit(0)",
"-min = a if a < b else b",
"-divisor = 1",
"-i = 2... | false | 0.043499 | 0.042313 | 1.028023 | [
"s338373859",
"s228733924"
] |
u968166680 | p03295 | python | s568182667 | s805343013 | 131 | 111 | 32,324 | 29,300 | Accepted | Accepted | 15.27 | import sys
from operator import itemgetter
read = sys.stdin.buffer.read
INF = 1 << 60
def main():
N, M, *AB = list(map(int, read().split()))
Q = [0] * M
for i, (a, b) in enumerate(zip(*[iter(AB)] * 2)):
Q[i] = (a - 1, b - 1)
Q.sort(key=itemgetter(1))
ans = 0
last =... | import sys
from operator import itemgetter
read = sys.stdin.buffer.read
INF = 1 << 60
def main():
N, M, *AB = list(map(int, read().split()))
Q = list(zip(*[iter(AB)] * 2))
Q.sort(key=itemgetter(1))
ans = 0
last = 0
for a, b in Q:
if last < a:
last = b - ... | 29 | 26 | 482 | 412 | import sys
from operator import itemgetter
read = sys.stdin.buffer.read
INF = 1 << 60
def main():
N, M, *AB = list(map(int, read().split()))
Q = [0] * M
for i, (a, b) in enumerate(zip(*[iter(AB)] * 2)):
Q[i] = (a - 1, b - 1)
Q.sort(key=itemgetter(1))
ans = 0
last = -1
for a, b in ... | import sys
from operator import itemgetter
read = sys.stdin.buffer.read
INF = 1 << 60
def main():
N, M, *AB = list(map(int, read().split()))
Q = list(zip(*[iter(AB)] * 2))
Q.sort(key=itemgetter(1))
ans = 0
last = 0
for a, b in Q:
if last < a:
last = b - 1
ans +... | false | 10.344828 | [
"- Q = [0] * M",
"- for i, (a, b) in enumerate(zip(*[iter(AB)] * 2)):",
"- Q[i] = (a - 1, b - 1)",
"+ Q = list(zip(*[iter(AB)] * 2))",
"- last = -1",
"+ last = 0"
] | false | 0.048804 | 0.047696 | 1.023223 | [
"s568182667",
"s805343013"
] |
u997648604 | p02582 | python | s771098075 | s486296231 | 86 | 69 | 61,748 | 61,824 | Accepted | Accepted | 19.77 | import sys
sys.setrecursionlimit(10**9)
def mi(): return list(map(int,input().split()))
def ii(): return int(eval(input()))
def isp(): return input().split()
def deb(text): print(("-------\n{}\n-------".format(text)))
INF=10**20
def main():
S = eval(input())
if S == "RRR":
print((3))
... | #! /usr/bin/env python3
import sys
sys.setrecursionlimit(10**9)
INF=10**20
def solve(S: str):
if S == "RRR":
print((3))
elif S[1:3] == "RR" or S[0:2] == "RR":
print((2))
else:
ans = 0
for s in S:
if s == "R":
ans = 1
pri... | 30 | 33 | 528 | 606 | import sys
sys.setrecursionlimit(10**9)
def mi():
return list(map(int, input().split()))
def ii():
return int(eval(input()))
def isp():
return input().split()
def deb(text):
print(("-------\n{}\n-------".format(text)))
INF = 10**20
def main():
S = eval(input())
if S == "RRR":
... | #! /usr/bin/env python3
import sys
sys.setrecursionlimit(10**9)
INF = 10**20
def solve(S: str):
if S == "RRR":
print((3))
elif S[1:3] == "RR" or S[0:2] == "RR":
print((2))
else:
ans = 0
for s in S:
if s == "R":
ans = 1
print(ans)
ret... | false | 9.090909 | [
"+#! /usr/bin/env python3",
"-",
"-",
"-def mi():",
"- return list(map(int, input().split()))",
"-",
"-",
"-def ii():",
"- return int(eval(input()))",
"-",
"-",
"-def isp():",
"- return input().split()",
"-",
"-",
"-def deb(text):",
"-",
"-",
"-def main():",
"- S = ... | false | 0.036094 | 0.044319 | 0.814409 | [
"s771098075",
"s486296231"
] |
u979823197 | p03309 | python | s034243760 | s739049528 | 244 | 221 | 26,180 | 26,180 | Accepted | Accepted | 9.43 | N=int(eval(input()))
A=list(map(int,input().split()))
B=[]
for i in range(N):
B.append(A[i]-i-1)
B.sort()
if N%2==0:
b=(B[N//2]+B[N//2-1])//2
else:
b=B[N//2]
sad=0
for j in range(N):
sad=sad+abs(B[j]-b)
print(sad) | N=int(eval(input()))
A=list(map(int,input().split()))
B=A
for i in range(N):
B[i]-=i+1
C=sorted(B)
if N%2==0:
b=(C[int(N/2-1)]+C[int(N/2)])//2
else:
b=C[int((N-1)/2)]
ans=0
for i in range(N):
ans+=abs(C[i]-b)
print(ans) | 14 | 14 | 228 | 234 | N = int(eval(input()))
A = list(map(int, input().split()))
B = []
for i in range(N):
B.append(A[i] - i - 1)
B.sort()
if N % 2 == 0:
b = (B[N // 2] + B[N // 2 - 1]) // 2
else:
b = B[N // 2]
sad = 0
for j in range(N):
sad = sad + abs(B[j] - b)
print(sad)
| N = int(eval(input()))
A = list(map(int, input().split()))
B = A
for i in range(N):
B[i] -= i + 1
C = sorted(B)
if N % 2 == 0:
b = (C[int(N / 2 - 1)] + C[int(N / 2)]) // 2
else:
b = C[int((N - 1) / 2)]
ans = 0
for i in range(N):
ans += abs(C[i] - b)
print(ans)
| false | 0 | [
"-B = []",
"+B = A",
"- B.append(A[i] - i - 1)",
"-B.sort()",
"+ B[i] -= i + 1",
"+C = sorted(B)",
"- b = (B[N // 2] + B[N // 2 - 1]) // 2",
"+ b = (C[int(N / 2 - 1)] + C[int(N / 2)]) // 2",
"- b = B[N // 2]",
"-sad = 0",
"-for j in range(N):",
"- sad = sad + abs(B[j] - b)",
... | false | 0.047396 | 0.048668 | 0.973864 | [
"s034243760",
"s739049528"
] |
u388497015 | p02622 | python | s874176506 | s812722735 | 70 | 56 | 9,304 | 9,396 | Accepted | Accepted | 20 | s = eval(input())
t = eval(input())
ans = 0
n = len(s)
for i in range(n):
if s[i] != t[i]:
ans += 1
print(ans) | s = eval(input())
t = eval(input())
ans = 0
for i, j in zip(s, t):
ans += i != j
print(ans) | 9 | 8 | 113 | 92 | s = eval(input())
t = eval(input())
ans = 0
n = len(s)
for i in range(n):
if s[i] != t[i]:
ans += 1
print(ans)
| s = eval(input())
t = eval(input())
ans = 0
for i, j in zip(s, t):
ans += i != j
print(ans)
| false | 11.111111 | [
"-n = len(s)",
"-for i in range(n):",
"- if s[i] != t[i]:",
"- ans += 1",
"+for i, j in zip(s, t):",
"+ ans += i != j"
] | false | 0.096649 | 0.041269 | 2.341945 | [
"s874176506",
"s812722735"
] |
u936985471 | p02901 | python | s098827684 | s761991478 | 1,200 | 796 | 3,312 | 3,188 | Accepted | Accepted | 33.67 | import sys
readline = sys.stdin.readline
N,M = list(map(int,readline().split()))
keys = [None] * M
for i in range(M):
cost,b = list(map(int,readline().split()))
bit = 0
target = list(map(int,readline().split()))
for t in target:
bit += (1 << (t - 1))
keys[i] = (cost, bit)
# 全ての鍵の組み合わせでD... | import sys
readline = sys.stdin.readline
N,M = list(map(int,readline().split()))
keys = [None] * M
for i in range(M):
cost,b = list(map(int,readline().split()))
bit = 0
target = list(map(int,readline().split()))
for t in target:
bit += (1 << (t - 1))
keys[i] = (cost, bit)
# 全ての鍵の組み合わせでD... | 29 | 29 | 616 | 617 | import sys
readline = sys.stdin.readline
N, M = list(map(int, readline().split()))
keys = [None] * M
for i in range(M):
cost, b = list(map(int, readline().split()))
bit = 0
target = list(map(int, readline().split()))
for t in target:
bit += 1 << (t - 1)
keys[i] = (cost, bit)
# 全ての鍵の組み合わせでDP... | import sys
readline = sys.stdin.readline
N, M = list(map(int, readline().split()))
keys = [None] * M
for i in range(M):
cost, b = list(map(int, readline().split()))
bit = 0
target = list(map(int, readline().split()))
for t in target:
bit += 1 << (t - 1)
keys[i] = (cost, bit)
# 全ての鍵の組み合わせでDP... | false | 0 | [
"- if dp[j] == -1:",
"+ if dp[j] == INF:"
] | false | 0.08334 | 0.039049 | 2.134266 | [
"s098827684",
"s761991478"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.