Datasets:

problem_id
stringlengths
6
6
buggy_code
stringlengths
8
526k
fixed_code
stringlengths
12
526k
labels
listlengths
0
15
buggy_submission_id
int64
1
1.54M
fixed_submission_id
int64
2
1.54M
user_id
stringlengths
10
10
language
stringclasses
8 values
p02793
n = int(input()) a = list(map(int,input().split())) mod = 10**9 + 7 from math import gcd from functools import reduce def lcm_base(x, y): return (x * y) // gcd(x, y) def lcm(*numbers): return reduce(lcm_base, numbers, 1) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) x = lcm_list(a) # print(x) ans = 0 for i in range(n): ans += x/a[i] print(int(ans)%mod)
n = int(input()) a = list(map(int,input().split())) mod = 10**9 + 7 from math import gcd from functools import reduce def lcm_base(x, y): return (x * y) // gcd(x, y) def lcm(*numbers): return reduce(lcm_base, numbers, 1) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) x = lcm_list(a) # print(x) ans = 0 for i in range(n): ans += int(x//a[i]) print(int(ans)%mod)
[ "call.add", "expression.operator.arithmetic.change", "expression.operation.binary.change", "call.arguments.change" ]
603,074
603,073
u255673886
python
p02793
n = int(input()) arr = list(map(int, input().split())) #arr:最小公倍数の対象とする配列 MOD = 10**9 + 7 def lcm(arr): primes = {} for val in arr: p = 2 while p * p <= val: if val % p == 0: cnt = 0 while val % p == 0: cnt += 1 val //= p if p not in primes: primes[p] = cnt else: primes[p] = max(cnt, primes[p]) p += 1 if val != 1: if val not in primes: primes[val] = 1 lcma = 1 for p in primes: lcma = lcma * pow(p, primes[p], MOD) % MOD return lcma b = lcm(arr) ans=0 for i in range(n): ans+=(b//arr[i])%MOD print(ans%MOD)
n = int(input()) arr = list(map(int, input().split())) #arr:最小公倍数の対象とする配列 MOD = 10**9 + 7 def lcm(arr): primes = {} for val in arr: p = 2 while p * p <= val: if val % p == 0: cnt = 0 while val % p == 0: cnt += 1 val //= p if p not in primes: primes[p] = cnt else: primes[p] = max(cnt, primes[p]) p += 1 if val != 1: if val not in primes: primes[val] = 1 lcma = 1 for p in primes: lcma = lcma * pow(p, primes[p], MOD) return lcma b = lcm(arr) ans=0 for i in range(n): ans+=(b//arr[i]) print(ans%MOD)
[ "expression.operation.binary.remove" ]
603,075
603,076
u404290207
python
p02793
n = int(input()) arr = list(map(int, input().split())) #arr:最小公倍数の対象とする配列 MOD = 10**9 + 7 def lcm(arr): primes = {} for val in arr: p = 2 while p * p <= val: if val % p == 0: cnt = 0 while val % p == 0: cnt += 1 val //= p if p not in primes: primes[p] = cnt else: primes[p] = max(cnt, primes[p]) p += 1 if val != 1: if val not in primes: primes[val] = 1 lcma = 1 for p in primes: lcma = lcma * pow(p, primes[p], MOD) % MOD return lcma b = lcm(arr) ans=0 for i in range(n): ans+=(b//arr[i])%MOD print(ans)
n = int(input()) arr = list(map(int, input().split())) #arr:最小公倍数の対象とする配列 MOD = 10**9 + 7 def lcm(arr): primes = {} for val in arr: p = 2 while p * p <= val: if val % p == 0: cnt = 0 while val % p == 0: cnt += 1 val //= p if p not in primes: primes[p] = cnt else: primes[p] = max(cnt, primes[p]) p += 1 if val != 1: if val not in primes: primes[val] = 1 lcma = 1 for p in primes: lcma = lcma * pow(p, primes[p], MOD) return lcma b = lcm(arr) ans=0 for i in range(n): ans+=(b//arr[i]) print(ans%MOD)
[ "expression.operation.binary.remove" ]
603,077
603,076
u404290207
python
p02793
n=int(input()) A=[int(i) for i in input().split()] mod=10**9+7 def gcd(a,b): while b: a,b=b,a%b return a lcm=A[0] chk=True for i in range(1,n): if lcm%A[i]!=0: lcm=lcm*A[i]//gcd(lcm,A[i]) if lcm>10**100: chk=False break if chk: ans=0 for i in range(n): ans=(ans+lcm//A[i])%mod print(ans) else: ans=0 mult=1 for a in A: mult=(mult*a)%mod for a in A: ans=(ans+mult*pow(a,mod-2,mod))%mod print(ans)
n=int(input()) A=[int(i) for i in input().split()] mod=10**9+7 def gcd(a,b): while b: a,b=b,a%b return a lcm=A[0] chk=True for i in range(1,n): if lcm%A[i]!=0: lcm=lcm*A[i]//gcd(lcm,A[i]) if lcm>10**50000: chk=False break if chk: ans=0 for i in range(n): ans=(ans+lcm//A[i])%mod print(ans) else: ans=0 mult=1 for a in A: mult=(mult*a)%mod for a in A: ans=(ans+mult*pow(a,mod-2,mod))%mod print(ans)
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
603,100
603,098
u969190727
python
p02793
# -*- coding: utf-8 -*- import math import itertools import sys import copy # 入力 #A, B, C, D = map(int, input().split()) #L = list(map(int, input().split())) #S = list(str(input())) #a, b = map(int, input().split()) N = int(input()) A = list(map(int, input().split())) mod = (10 ** 9) + 7 def lcm(a): from math import gcd x = a[0] for i in range(1, len(a)): x = (x * a[i]) // gcd(x, a[i]) return x p = lcm(A) sum = 0 for i in range(N) : sum += p/A[i] print (int(sum%mod))
# -*- coding: utf-8 -*- import math import itertools import sys import copy # 入力 #A, B, C, D = map(int, input().split()) #L = list(map(int, input().split())) #S = list(str(input())) #a, b = map(int, input().split()) N = int(input()) A = list(map(int, input().split())) mod = (10 ** 9) + 7 def lcm(a): from math import gcd x = a[0] for i in range(1, len(a)): x = (x * a[i]) // gcd(x, a[i]) return x p = lcm(A) #print (p) sum = 0 for i in range(N) : sum += p//A[i] print (int(sum%mod))
[ "expression.operator.arithmetic.change", "expression.operation.binary.change" ]
603,113
603,114
u545666277
python
p02793
def gcd(a, b): if a == 0: return b return gcd(b%a, a) def lcm(a,b): return a*b/gcd(a,b) if __name__ == '__main__': n = int(input()) a = list(map(int, input().split())) l = int(1) for e in a: l = lcm(l,e) s = int(0) for e in a: s += l//e mod = int(1000000007) print(int(s % mod))
def gcd(a, b): if a == 0: return b return gcd(b%a, a) def lcm(a,b): return a*b//gcd(a,b) if __name__ == '__main__': n = int(input()) a = list(map(int, input().split())) l = int(1) for e in a: l = lcm(l,e) s = int(0) for e in a: s += l//e mod = int(1000000007) print(int(s % mod))
[ "expression.operator.arithmetic.change", "function.return_value.change", "expression.operation.binary.change" ]
603,121
603,122
u310752653
python
p02793
def gcd(a, b): if a == 0: return b return gcd(b%a, a) def lcm(a,b): return a*b/gcd(a,b) if __name__ == '__main__': n = int(input()) a = list(map(int, input().split())) l = int(1) for e in a: l = lcm(l,e) s = int(0) for e in a: s += l/e mod = int(1000000007) print(int(s % mod))
def gcd(a, b): if a == 0: return b return gcd(b%a, a) def lcm(a,b): return a*b//gcd(a,b) if __name__ == '__main__': n = int(input()) a = list(map(int, input().split())) l = int(1) for e in a: l = lcm(l,e) s = int(0) for e in a: s += l//e mod = int(1000000007) print(int(s % mod))
[ "expression.operator.arithmetic.change", "function.return_value.change", "expression.operation.binary.change" ]
603,123
603,122
u310752653
python
p02793
# 最小公倍数 from math import gcd def lcm (x, y): return (x * y) // gcd(x, y) # 最小公倍数(リスト) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) mod = 10 ** 9 + 7 N = int(input()) A = list(map(int, input().split())) lcm_A = lcm_list(A) ans = 0 for i in range(N): ans += lcm_A // A[i] print(ans % mod)
# 最小公倍数 from math import gcd from functools import reduce def lcm (x, y): return (x * y) // gcd(x, y) # 最小公倍数(リスト) def lcm_list(numbers): return reduce(lcm, numbers, 1) mod = 10 ** 9 + 7 N = int(input()) A = list(map(int, input().split())) lcm_A = lcm_list(A) ans = 0 for i in range(N): ans += lcm_A // A[i] print(ans % mod)
[ "identifier.change", "call.arguments.change", "function.return_value.change" ]
603,124
603,125
u379959788
python
p02793
n = int(input()) s = list(map(int,input().split())) ans = 0 mod = int(1e9+7) def gcd(a,b): while b != 0: a, b = b, a % b return a def lcm(a,b): return a // gcd(a,b) g = 1 for i in range(n): g = lcm(g, s[i]) for i in range(n): ans += g // s[i] print(ans%mod)
n = int(input()) s = list(map(int,input().split())) ans = 0 mod = int(1e9+7) def gcd(a,b): while b != 0: a, b = b, a % b return a def lcm(a,b): return a // gcd(a,b) * b g = 1 for i in range(n): g = lcm(g, s[i]) for i in range(n): ans += g // s[i] print(ans%mod)
[ "expression.operation.binary.add" ]
603,143
603,144
u599114793
python
p02793
def GCD(x,y): if y==0: return x return GCD(y,x%y) def func(x): if x <= 1: return [] for i in range(2,int(x**0.5)+1): if x%i == 0: count = 0 while x%i==0: x //= i count += 1 return [[i,count]]+func(x) return [[x,1]] MOD = 10**9+7 N = int(input()) A = list(map(int,input().split())) lcm = [0]*(10**6) for i in A: for a,b in func(i): lcm[a] = max(lcm[a],b) L = 1 for i in range(2,10**6): L *= pow(i,lcm[i],MOD) L %= MOD ans = 1 for i in A: ans += L*pow(i,MOD-2,MOD) ans %= MOD print(ans)
def GCD(x,y): if y==0: return x return GCD(y,x%y) def func(x): if x <= 1: return [] for i in range(2,int(x**0.5)+1): if x%i == 0: count = 0 while x%i==0: x //= i count += 1 return [[i,count]]+func(x) return [[x,1]] MOD = 10**9+7 N = int(input()) A = list(map(int,input().split())) lcm = [0]*(10**6) for i in A: for a,b in func(i): lcm[a] = max(lcm[a],b) L = 1 for i in range(2,10**6): L *= pow(i,lcm[i],MOD) L %= MOD ans = 0 for i in A: ans += L*pow(i,MOD-2,MOD) ans %= MOD print(ans)
[ "literal.number.integer.change", "assignment.value.change" ]
603,161
603,162
u211160392
python
p02793
import math n = int(input()) a = list(map(int, input().split())) MOD = 10**9 + 7 ans = 0 lcm = a[0] for i in range(1, n): lcm = lcm * a[i] // math.gcd(lcm, a[i]) #lcm = lcm * a[i] // math.gcd(lcm, a[i])\ lcm %= MOD for i in range(n): ans += lcm * pow(a[i] , MOD-2, MOD) # ans %= MOD print(ans)
import math n = int(input()) a = list(map(int, input().split())) MOD = 10**9 + 7 ans = 0 lcm = a[0] for i in range(1, n): lcm = lcm * a[i] // math.gcd(lcm, a[i]) #lcm = lcm * a[i] // math.gcd(lcm, a[i]) lcm %= MOD for i in range(n): ans += lcm * pow(a[i] , MOD-2, MOD) ans %= MOD print(ans)
[]
603,167
603,166
u701199820
python
p02793
MOD = 1000000007 def gcd(a, b): if b == 0: return a else: return gcd(b, a%b) def lcm(a, b): return a//gcd(a,b)*a n = int(input()) a = list(map(int,input().split())) all_lcm = 1 for i in range(n): all_lcm = lcm(all_lcm, a[i]) ans = 0 for i in range(n): ans += all_lcm//a[i] print(ans%MOD)
MOD = 1000000007 def gcd(a, b): if b == 0: return a else: return gcd(b, a%b) def lcm(a, b): return a//gcd(a,b)*b n = int(input()) a = list(map(int,input().split())) all_lcm = 1 for i in range(n): all_lcm = lcm(all_lcm, a[i]) ans = 0 for i in range(n): ans += all_lcm//a[i] print(ans%MOD)
[ "identifier.change", "function.return_value.change", "expression.operation.binary.change" ]
603,168
603,169
u083190434
python
p02793
#a,bの最大公約数 def gcd(a, b): while b: a, b = b, a % b return a #a,bの最小公倍数 def lcm(a, b): return a * b // gcd (a, b) N=int(input()) A=list(map(int, input().split())) L = 1 for a in A: L = lcm(L, a) ans = 0 for a in A: ans = ans + L/a MOD = 1000000007 print(int(ans)%MOD)
#a,bの最大公約数 def gcd(a, b): while b: a, b = b, a % b return a #a,bの最小公倍数 def lcm(a, b): return a * b // gcd (a, b) N=int(input()) A=list(map(int, input().split())) L = 1 for a in A: L = lcm(L, a) ans = 0 for a in A: ans = ans + L//a MOD = 1000000007 print(int(ans)%MOD)
[ "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change" ]
603,182
603,183
u424103788
python
p02793
N = int(input()) A = list(map(int,input().split())) def gcd(a,b): if b == 0: return a return gcd(b,a%b) def lcm(a,b): return a*b/gcd(a,b) L = 1 D = 1000000007 for i in range(N): L = lcm(L,A[i]) L = L % D res = 0 for i in range(N): res = (res + L * pow(A[i],D-2,D)) % D print(int(res))
N = int(input()) A = list(map(int,input().split())) def gcd(a,b): if b == 0: return a return gcd(b,a%b) def lcm(a,b): return a*b//gcd(a,b) L = 1 D = 1000000007 for i in range(N): L = lcm(L,A[i]) L = L % D res = 0 for i in range(N): res = (res + L * pow(A[i],D-2,D)) % D print(int(res))
[ "expression.operator.arithmetic.change", "function.return_value.change", "expression.operation.binary.change" ]
603,192
603,193
u026537738
python
p02793
import math N = int(input()) A = list(map(int, input().split())) AB = 1 for i in A: AB = AB*i//math.gcd(AB,i) sumB = 0 for i in A: sumB += AB/i print(int(sumB%(10**9+7)))
import math N = int(input()) A = list(map(int, input().split())) AB = 1 for i in A: AB = AB*i//math.gcd(AB,i) sumB = 0 for i in A: sumB += AB//i print(int(sumB%(10**9+7)))
[ "expression.operator.arithmetic.change", "expression.operation.binary.change" ]
603,209
603,210
u290279680
python
p02793
from math import gcd s=int(input()) t=list(map(int, input().split())) ans=t[0] for i in t: ans=(ans*i)//gcd(ans,i) mod=10**9+7 ans%=mod a=0 for j in t: a+=ans//j print(int(a)%mod)
from math import gcd s=int(input()) t=list(map(int, input().split())) ans=t[0] for i in t: ans=(ans*i)//gcd(ans,i) mod=10**9+7 a=0 for j in t: a+=ans//j print(int(a)%mod)
[]
603,214
603,215
u917558625
python
p02793
def gcd(n,m): if n>m: return gcd(m,n); if n==0: return m; return gcd(m-n*(m//n),n) def lcm(x, y): return (x * y) // gcd(x, y) n=int(input()) a=list(map(int,input().split())) s=1 for i in a: s=lcm(s,i) ans=0 for i in a: ans+=s//i ans % 1000000007 print(ans)
def gcd(n,m): if n>m: return gcd(m,n); if n==0: return m; return gcd(m-n*(m//n),n) def lcm(x, y): return (x * y) // gcd(x, y) n=int(input()) a=list(map(int,input().split())) s=1 for i in a: s=lcm(s,i) ans=0 for i in a: ans+=s//i print(ans % 1000000007)
[ "expression.operation.binary.remove" ]
603,217
603,218
u204842730
python
p02793
import math N = int(input()) A = list(map(int, input().split())) a = A[0] for i in range(1, N): g = a * A[i] // math.gcd(a, A[i]) a = g b = 0 for i in range(N): b = b + g // A[i] c = b % (1000000007) print(c)
import math N = int(input()) A = list(map(int, input().split())) a = 1 for i in range(N): g = a * A[i] // math.gcd(a, A[i]) a = g b = 0 for i in range(N): b = b + g // A[i] c = b % (1000000007) print(c)
[ "assignment.value.change", "identifier.replace.remove", "literal.replace.add", "call.arguments.change" ]
603,238
603,239
u886832246
python
p02793
mod = 10**9+7 def fctr(n): res=[] c=0 r=int(n**0.5) for i in range(2,r+2): while n%i==0: c+=1 n=n//i if c!=0: res.append([i,c]) c=0 if n!=1: res.append([n,1]) return res N = int(input()) A = list(map(int, input().split())) A_inv = [pow(a, mod-2, mod) for a in A] primes = [0]*(10**4+1) for a in A: res = fctr(a) for i, c in res: primes[i] = max(primes[i], c) m = 1 for i in range(1, 10**4+1): c = primes[i] m*=pow(i, c, mod) m%=mod ans = 0 for a in A_inv: ans+=m*a ans%=mod print(ans)
mod = 10**9+7 def fctr(n): res=[] c=0 r=int(n**0.5) for i in range(2,r+2): while n%i==0: c+=1 n=n//i if c!=0: res.append([i,c]) c=0 if n!=1: res.append([n,1]) return res N = int(input()) A = list(map(int, input().split())) A_inv = [pow(a, mod-2, mod) for a in A] primes = [0]*(10**6+1) for a in A: res = fctr(a) for i, c in res: primes[i] = max(primes[i], c) m = 1 for i in range(1, 10**6+1): c = primes[i] m*=pow(i, c, mod) m%=mod ans = 0 for a in A_inv: ans+=m*a ans%=mod print(ans)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
603,245
603,246
u310678820
python
p02793
import sys n = int(input()) a_ls = [int(i) for i in sys.stdin.readline().split()] MOD = 10**9+7 def gcd(a, b): while a and b: if a > b: a %= b else: b %= a return max(a, b) def lcm(a, b): _gcd = gcd(a, b) return a * b // _gcd _a = a_ls[0] for a in a_ls: _a = lcm(_a, a) ls = [_a % MOD // a % MOD for a in a_ls] print(sum(ls) % MOD)
import sys n = int(input()) a_ls = [int(i) for i in sys.stdin.readline().split()] MOD = 10**9+7 def gcd(a, b): while a and b: if a > b: a %= b else: b %= a return max(a, b) def lcm(a, b): _gcd = gcd(a, b) return a * b // _gcd _a = a_ls[0] for a in a_ls: _a = lcm(_a, a) ls = [_a // a for a in a_ls] print(sum(ls) % MOD)
[ "expression.operation.binary.remove" ]
603,247
603,248
u190406011
python
p02793
import sys n = int(input()) a_ls = [int(i) for i in sys.stdin.readline().split()] MOD = 10**9+7 def gcd(a, b): while a and b: if a > b: a %= b else: b %= a return max(a, b) def lcm(a, b): _gcd = gcd(a, b) return a * b // _gcd % MOD _a = a_ls[0] for a in a_ls: _a = lcm(_a, a) ls = [_a // a for a in a_ls] print(sum(ls) % MOD)
import sys n = int(input()) a_ls = [int(i) for i in sys.stdin.readline().split()] MOD = 10**9+7 def gcd(a, b): while a and b: if a > b: a %= b else: b %= a return max(a, b) def lcm(a, b): _gcd = gcd(a, b) return a * b // _gcd _a = a_ls[0] for a in a_ls: _a = lcm(_a, a) ls = [_a // a for a in a_ls] print(sum(ls) % MOD)
[ "expression.operation.binary.remove" ]
603,250
603,248
u190406011
python
p02793
import sys sys.setrecursionlimit(2000000) from math import gcd def lcm(a): x = a[0] for i in range(1, len(a)): x = (x * a[i]) // gcd(x, a[i]) return x mod = 1000000007 def mul(a, b): return ((a % mod) * (b % mod)) % mod def power(x, y): if y == 0 : return 1 elif y == 1 : return x % mod elif y % 2 == 0 : return power(x, y/2)**2 % mod else : return power(x, y/2)**2 * x % mod def div(a, b): return mul(a, power(b, mod-2)) n=int(input()) aa=[] aa=list(map(int,input().split())) # for i in range(n): # aa.append(randint(1,10**6)) bb=lcm(aa) mod=10**9+7 ans=0 for i in range(n): ccc=div(bb,aa[i]) ans=int((ccc%mod+ans%mod)%mod) print(int(ans))
import sys sys.setrecursionlimit(2000000) from math import gcd def lcm(a): x = a[0] for i in range(1, len(a)): x = (x * a[i]) // gcd(x, a[i]) return x mod = 1000000007 def mul(a, b): return ((a % mod) * (b % mod)) % mod def power(x, y): if y == 0 : return 1 elif y == 1 : return x % mod elif y % 2 == 0 : return power(x, y/2)**2 % mod else : return power(x, y//2)**2 * x % mod def div(a, b): return mul(a, power(b, mod-2)) n=int(input()) aa=[] aa=list(map(int,input().split())) # for i in range(n): # aa.append(randint(1,10**6)) bb=lcm(aa) mod=10**9+7 ans=0 for i in range(n): ccc=div(bb,aa[i]) ans=int((ccc%mod+ans%mod)%mod) print(int(ans))
[ "expression.operator.arithmetic.change", "call.arguments.change", "function.return_value.change", "expression.operation.binary.change" ]
603,253
603,254
u177388368
python
p02793
from math import gcd N = int(input()) A = [int(i) for i in input().split()] lcm = A[0] MOD = 10**9 + 7 for a in A: lcm = (lcm // gcd(lcm,a) * a) res = 0 for a in A: res += lcm /a print(res % MOD)
from math import gcd N = int(input()) A = [int(i) for i in input().split()] lcm = A[0] MOD = 10**9 + 7 for a in A: lcm = (lcm // gcd(lcm,a) * a) res = 0 for a in A: res += lcm //a print(res % MOD)
[ "expression.operator.arithmetic.change", "expression.operation.binary.change" ]
603,255
603,256
u974620347
python
p02793
import math from functools import reduce a = list(map(int,input().split())) def lcm_base(x, y): return (x * y) // math.gcd(x, y) def lcm(*numbers): return reduce(lcm_base, numbers, 1) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) x = lcm_list(a) ans = 0 for i in a: ans += (x//i) ans %= 1000000007 print(ans)
import math from functools import reduce b = input() a = list(map(int,input().split())) def lcm_base(x, y): return (x * y) // math.gcd(x, y) def lcm(*numbers): return reduce(lcm_base, numbers, 1) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) x = lcm_list(a) ans = 0 for i in a: ans += (x//i) ans %= 1000000007 print(ans)
[ "assignment.add" ]
603,268
603,269
u102602414
python
p02793
# import itertools # import math import math MOD = 10 ** 9 + 7 def solve(N, A): lcm_ans = A[0] for i in range(1, N): lcm_ans = lcm_ans * A[i] // math.gcd(lcm_ans, A[i]) ans = 0 for AA in A: ans += lcm_ans // AA return ans // MOD N = int(input()) # S = input() # A, B = map(int, input().split()) A = list(map(int, input().split())) # P = [] # S = [] # for i in range(N): # pp, ss = map(int, input().split()) # P.append(pp) # S.append(ss) print(solve(N, A))
# import itertools # import math import math MOD = 10 ** 9 + 7 def solve(N, A): lcm_ans = A[0] for i in range(1, N): lcm_ans = lcm_ans * A[i] // math.gcd(lcm_ans, A[i]) ans = 0 for AA in A: ans += lcm_ans // AA return ans % MOD N = int(input()) # S = input() # A, B = map(int, input().split()) A = list(map(int, input().split())) # P = [] # S = [] # for i in range(N): # pp, ss = map(int, input().split()) # P.append(pp) # S.append(ss) print(solve(N, A))
[ "expression.operator.arithmetic.change", "function.return_value.change", "expression.operation.binary.change" ]
603,270
603,271
u586662847
python
p02793
# import itertools # import math import math MOD = 10 ** 9 + 7 def solve(N, A): lcm_ans = A[0] for i in range(1, N): lcm_ans = lcm_ans * A[i] // math.gcd(lcm_ans, A[i]) ans = 0 for AA in A: ans += lcm_ans // AA return ans N = int(input()) # S = input() # A, B = map(int, input().split()) A = list(map(int, input().split())) # P = [] # S = [] # for i in range(N): # pp, ss = map(int, input().split()) # P.append(pp) # S.append(ss) print(solve(N, A))
# import itertools # import math import math MOD = 10 ** 9 + 7 def solve(N, A): lcm_ans = A[0] for i in range(1, N): lcm_ans = lcm_ans * A[i] // math.gcd(lcm_ans, A[i]) ans = 0 for AA in A: ans += lcm_ans // AA return ans % MOD N = int(input()) # S = input() # A, B = map(int, input().split()) A = list(map(int, input().split())) # P = [] # S = [] # for i in range(N): # pp, ss = map(int, input().split()) # P.append(pp) # S.append(ss) print(solve(N, A))
[ "expression.operation.binary.add" ]
603,272
603,271
u586662847
python
p02793
MOD=10**9+7 import math N=int(input()) if N==1: A=int(input()) print(1) exit() A=list(map(int, input().split())) def f(a, b): return a*b//math.gcd(a, b) if N>10: A1=A[:N//2] A2=A[N//2:] tmp1=f(A1[0], A1[1]) n1=len(A1) for i in range(2, n1): tmp1=f(tmp1, A1[i]) tmp2=f(A2[0], A2[1]) n2=len(A2) for i in range(2, n2): tmp2=f(tmp2, A2[i]) tmp=math.gcd(tmp1, tmp2) out1=sum([(tmp1//A1[i]) for i in range(n1)]) out2=sum([(tmp2//A2[i]) for i in range(n2)]) out1*=(tmp//tmp1) out2*=(tmp//tmp2) print((out1+out2)%MOD) exit() tmp=f(A[0], A[1]) for i in range(2, N): tmp=f(tmp, A[i]) out=0 print(sum([(tmp//A[i])%MOD for i in range(N)])%MOD)
MOD=10**9+7 import math N=int(input()) if N==1: A=int(input()) print(1) exit() A=list(map(int, input().split())) def f(a, b): return a*b//math.gcd(a, b) if N>10: A1=A[:N//2] A2=A[N//2:] tmp1=f(A1[0], A1[1]) n1=len(A1) for i in range(2, n1): tmp1=f(tmp1, A1[i]) tmp2=f(A2[0], A2[1]) n2=len(A2) for i in range(2, n2): tmp2=f(tmp2, A2[i]) tmp=f(tmp1, tmp2) out1=sum([(tmp1//A1[i]) for i in range(n1)]) out2=sum([(tmp2//A2[i]) for i in range(n2)]) out1*=(tmp//tmp1) out2*=(tmp//tmp2) print((out1+out2)%MOD) exit() tmp=f(A[0], A[1]) for i in range(2, N): tmp=f(tmp, A[i]) out=0 print(sum([(tmp//A[i])%MOD for i in range(N)])%MOD)
[ "assignment.value.change" ]
603,277
603,278
u095021077
python
p02796
import math import fractions def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) # divisors.sort() return divisors def bitlist(x,digit): res = [0 for i in range(digit)] now = x for i in range(digit): res[i]=now%2 now = now >> 1 return res #a = list(map(int, input().split())) robos = [] n = int(input()) for i in range(n): robos.append(list(map(int, input().split()))) robos.sort(key=lambda x:x[0]) ans=0 prev=-999999999999 for i in range(n): if(prev<=robos[i][0]-robos[i][1]): ans+=1 prev = robos[i][0]+robos[i][1] print(ans)
import math import fractions def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) # divisors.sort() return divisors def bitlist(x,digit): res = [0 for i in range(digit)] now = x for i in range(digit): res[i]=now%2 now = now >> 1 return res #a = list(map(int, input().split())) robos = [] n = int(input()) for i in range(n): robos.append(list(map(int, input().split()))) robos.sort(key=lambda x:x[0]+x[1]) ans=0 prev=-999999999999 for i in range(n): if(prev<=robos[i][0]-robos[i][1]): ans+=1 prev = robos[i][0]+robos[i][1] print(ans)
[ "expression.operation.binary.add" ]
603,304
603,305
u366541443
python
p02796
def main(sample_file = ''): """ convenient functions # for i, a in enumerate(iterable) # q, mod = divmod(a, b) # divmod(x, y) returns the tuple (x//y, x%y) # Higher-order function: reduce(operator.mul, xyz_count, 1) # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f """ """convenient decorator # @functools.lru_cache(): # to facilitate use of recursive function # ex: # from functools import lru_cache # import sys # sys.setrecursionlimit(10**9) # @lru_cache(maxsize=None) # def fib(n): # if n < 2: # return n # return fib(n-1) + fib(n-2) # print(fib(1000)) """ # import numpy as np import sys sys.setrecursionlimit(10**7) from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html # accumulate() returns iterator! to get list: list(accumulate()) from math import factorial, ceil, floor, sqrt def factorize(n): """return the factors of the Arg and count of each factor Args: n (long): number to be resolved into factors Returns: list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)] """ fct = [] # prime factor b, e = 2, 0 # base, exponent while b * b <= n: while n % b == 0: n = n // b e = e + 1 if e > 0: fct.append((b, e)) b, e = b + 1, 0 if n > 1: fct.append((n, 1)) return fct def combinations_count(n, r): """Return the number of selecting r pieces of items from n kinds of items. Args: n (long): number r (long): number Raises: Exception: not defined when n or r is negative Returns: long: number """ # TODO: How should I do when n - r is negative? if n < 0 or r < 0: raise Exception('combinations_count(n, r) not defined when n or r is negative') if n - r < r: r = n - r if r < 0: return 0 if r == 0: return 1 if r == 1: return n numerator = [n - r + k + 1 for k in range(r)] denominator = [k + 1 for k in range(r)] for p in range(2,r+1): pivot = denominator[p - 1] if pivot > 1: offset = (n - r) % p for k in range(p-1,r,p): numerator[k - offset] /= pivot denominator[k] /= pivot result = 1 for k in range(r): if numerator[k] > 1: result *= int(numerator[k]) return result def combinations_with_replacement_count(n, r): """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once. Args: n (long): number r (long): number Raises: Exception: not defined when n or r is negative Returns: long: number """ if n < 0 or r < 0: raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative') elif n == 0: return 1 else: return combinations_count(n + r - 1, r) from bisect import bisect_left, bisect_right from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html import operator from operator import itemgetter #sort # ex1: List.sort(key=itemgetter(1)) # ex2: sorted(tuples, key=itemgetter(1,2)) from functools import reduce, lru_cache def chmin(x, y): """change minimum if x > y, x = y and return (x, True). convenient when solving problems of dp[i] Args: x (long): current minimum value y (long): potential minimum value Returns: (x, bool): (x, True) when updated, else (x, False) """ if x > y: x = y return (x, True) else: return (x, False) def chmax(x, y): """change maximum if x < y, x = y and return (x, True). convenient when solving problems of dp[i] Args: x (long): current maximum value y (long): potential maximum value Returns: (x, bool): (x, True) when updated, else (x, False) """ if x < y: x = y return (x, True) else: return (x, False) from math import gcd # Deprecated since version 3.5: Use math.gcd() instead. def gcds(numbers): return reduce(gcd, numbers) def lcm(x, y): return (x * y) // gcd(x, y) def lcms(numbers): return reduce(lcm, numbers, 1) def make_divisors(n, reversed=False): """create list of divisors Args: number (int): number from which list of divisors is created reversed (bool, optional): ascending order if False. Defaults to False. Returns: list: list of divisors """ divisors = set() for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.add(i) divisors.add(n//i) return sorted(list(divisors),reverse=reversed) # first create factorial_list # fac_list = mod_factorial_list(n) INF = 10 ** 18 MOD = 10 ** 9 + 7 modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow! def modinv(a, p = MOD): # evaluate reciprocal using Fermat's little theorem: # a**(p-1) is identical to 1 (mod p) when a and p is coprime return modpow(a, p-2, p) def modinv_list(n, p = MOD): if n <= 1: return [0,1][:n+1] else: inv_t = [0,1] for i in range(2, n+1): inv_t += [inv_t[p % i] * (p - int(p / i)) % p] return inv_t def modfactorial_list(n, p = MOD): if n == 0: return [1] else: l = [0] * (n+1) tmp = 1 for i in range(1, n+1): tmp = tmp * i % p l[i] = tmp return l def modcomb(n, k, fac_list = [], p = MOD): # fac_list = modfactorial_list(100) # print(modcomb(100, 5, modfactorial_list(100))) from math import factorial if n < 0 or k < 0 or n < k: return 0 if n == 0 or k == 0: return 1 if len(fac_list) <= n: a = factorial(n) % p b = factorial(k) % p c = factorial(n-k) % p else: a = fac_list[n] b = fac_list[k] c = fac_list[n-k] return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p def modadd(a, b, p = MOD): return (a + b) % MOD def modsub(a, b, p = MOD): return (a - b) % p def modmul(a, b, p = MOD): return ((a % p) * (b % p)) % p def moddiv(a, b, p = MOD): return modmul(a, modpow(b, p-2, p)) class UnionFindTree: """union find tree class TODO: fix this description... how to use (example): >> uf = UnionFindTree(N) >> if uf.find_root(a) == uf.find_root(b): >> do something >> else: >> do something >> uf.unite(a, b) """ def __init__(self, N): self.root = [-1] * (N+1) self.rank = [0] * (N+1) self.connected_num = [1] * (N+1) def find_root(self,x): root = self.root while root[x] != -1: x = root[x] return x def unite(self,x,y): root = self.root rank = self.rank connected_num = self.connected_num find_root = self.find_root rx = find_root(x) ry = find_root(y) if rx != ry: if rank[rx] < rank[ry]: root[rx] = ry rx,ry = ry,rx else: if rank[rx] == rank[ry]: rank[rx] += 1 root[ry] = rx connected_num[rx] += connected_num[ry] # Graph: https://en.wikipedia.org/wiki/Directed_graph # Bellman-Ford: O(|V||E|). Use this if there exists an edge with negative length in the graph # After N steps, the shortest path has converded if there doesn't exist an cycle of edges with negative # Watch out: d[N] == d[2*N] doesn't necessarily mean the graph doesn't have negative cycle # ref: https://www.youtube.com/watch?v=1Z6ofKN03_Y def BellmanFord(N, M, ABC, vertex_start, vertex_end, value_if_inf = -1, find_shortest = False): """to calculate furthest or shortest length between vertex_start and vertex_end using BellmanFord algorithm Args: N (int): number of vertices M (int): number of edges ABC (list): [(ai, bi, ci) for _ in range(N)] where i-th edge is directed from vertex ai to vertex bi and the length is ci vertex_start (int): start vertex. usually use 0. vertex_end (int): end vertex. usually use N-1. value_if_inf (int or string as you like, optional): value you want when the furthest (or shortest) distance is infinite (or -infinite). Defaults to -1. find_shortest (bool, optional): choose False to find furthest path. Defaults to False. Returns: int or string: normally int (but can be str if you set value_if_inf to str) Example: N, M, P = R() ABC = [R() for _ in range(M)] ABC = [(a-1, b-1, c-P) for a, b, c in ABC] print(BellmanFord(N, M, ABC, 0, N-1, value_if_inf = 'inf')) """ def make_reachable_list(N, M, ABC, vertex_start, vertex_end): reachable_to_direct = defaultdict(list) reachable_from_direct = defaultdict(list) reachable_from_start = [False] * N reachable_to_end = [False] * N reachable_from_start[vertex_start] = True reachable_to_end[vertex_end] = True reachable_from_both_sides = [False] * N dfs_from_start = [] dfs_to_end = [] for a, b, c in ABC: reachable_to_direct[a].append(b) reachable_from_direct[b].append(a) if a == vertex_start: dfs_from_start.append(b) reachable_from_start[b] = True if b == vertex_end: dfs_to_end.append(a) reachable_to_end[a] = True while dfs_from_start: v = dfs_from_start.pop() for i in reachable_to_direct[v]: if not reachable_from_start[i]: reachable_from_start[i] = True dfs_from_start.append(i) while dfs_to_end: v = dfs_to_end.pop() for i in reachable_from_direct[v]: if not reachable_to_end[i]: reachable_to_end[i] = True dfs_to_end.append(i) for i in range(N): reachable_from_both_sides[i] = reachable_from_start[i] and reachable_to_end[i] return reachable_from_both_sides reachable_from_both_sides = make_reachable_list(N, M, ABC, vertex_start, vertex_end) if find_shortest: dist = [INF for i in range(N)] else: dist = [-INF for i in range(N)] dist[vertex_start] = 0 for i in range(N): updated = False for a, b, c in ABC: if not reachable_from_both_sides[a]: continue elif find_shortest: update_condition = dist[a] + c < dist[b] else: update_condition = dist[a] + c > dist[b] if dist[a] != INF and update_condition: dist[b] = dist[a] + c updated = True if i == N-1: return value_if_inf if not updated: break return dist[vertex_end] """ initialize variables and set inputs # initialize variables # to initialize list, use [0] * n # to initialize two dimentional array: # ex) [[0] * N for _ in range(N)] # ex2) dp = [[0] * (N+1) for _ in range(W*2)] # set inputs # put inputs between specific values (almost as quickly) # ex) S = [-INF] + [int(r()) for _ in range(A)] + [INF] # open(0).read() is sometimes useful: # ex) n, m, *x = map(int, open(0).read().split()) # min(x[::2]) - max(x[1::2]) # ex2) *x, = map(int, open(0).read().split()) # don't forget to add comma after *x if only one variable is used # preprocessing # transpose = [x for x in zip(*data)] # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)] # flat = [flatten for inner in data for flatten in inner] # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9] # calculate and output # output pattern # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6 """ # functions to read input r = lambda: sys.stdin.readline().strip() r_int = lambda: int(r()) r_float = lambda: float(r()) R = lambda: list(map(int, r().split())) R_str = lambda: r().split() R_map = lambda: map(int, r().split()) R_float = lambda: list(map(float, r().split())) R_tuple = lambda: tuple(map(int, r().split())) """ how to treat input # single int: int(r()) # single string: r() # single float: float(r()) # line int: R() # line string: r().split() # line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())] # lines int: [R() for _ in range(n)] """ # for test if sample_file: sys.stdin = open(sample_file) # ---------------------------------- # main # H = r_int() # W = r_int() # N = r_int() # u = max(H, W) # t = N//u # if N%u != 0: # t += 1 # print(t) N = r_int() XL = [R() for _ in range(N)] XL.sort() tmp = -INF ans = N for x, l in XL: if x - (l-1) < tmp: ans -= 1 tmp = min(tmp, x+(l-1)) else: tmp = x+(l-1) print(ans) # to finish code, use return instead of exit() # end of main # ---------------------------------- """memo: how to use defaultdict of list # initialize Dic = defaultdict(list) # append / extend Dic[x].append(y) # three methods for loop: keys(), values(), items() for k, v in Dic.items(): """ """memo: how to solve binary problems # to make binary digits text >>> a = 5 >>> bin_str_a = format(a, '#06b') >>> print(bin_str_a) 0b0101 # first 2 strings (='0b') indicates it is binary """ """memo: how to solve the problem creating simple test/answer greed simple dp graph """ if __name__ == '__main__': main()
def main(sample_file = ''): """ convenient functions # for i, a in enumerate(iterable) # q, mod = divmod(a, b) # divmod(x, y) returns the tuple (x//y, x%y) # Higher-order function: reduce(operator.mul, xyz_count, 1) # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f """ """convenient decorator # @functools.lru_cache(): # to facilitate use of recursive function # ex: # from functools import lru_cache # import sys # sys.setrecursionlimit(10**9) # @lru_cache(maxsize=None) # def fib(n): # if n < 2: # return n # return fib(n-1) + fib(n-2) # print(fib(1000)) """ # import numpy as np import sys sys.setrecursionlimit(10**7) from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html # accumulate() returns iterator! to get list: list(accumulate()) from math import factorial, ceil, floor, sqrt def factorize(n): """return the factors of the Arg and count of each factor Args: n (long): number to be resolved into factors Returns: list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)] """ fct = [] # prime factor b, e = 2, 0 # base, exponent while b * b <= n: while n % b == 0: n = n // b e = e + 1 if e > 0: fct.append((b, e)) b, e = b + 1, 0 if n > 1: fct.append((n, 1)) return fct def combinations_count(n, r): """Return the number of selecting r pieces of items from n kinds of items. Args: n (long): number r (long): number Raises: Exception: not defined when n or r is negative Returns: long: number """ # TODO: How should I do when n - r is negative? if n < 0 or r < 0: raise Exception('combinations_count(n, r) not defined when n or r is negative') if n - r < r: r = n - r if r < 0: return 0 if r == 0: return 1 if r == 1: return n numerator = [n - r + k + 1 for k in range(r)] denominator = [k + 1 for k in range(r)] for p in range(2,r+1): pivot = denominator[p - 1] if pivot > 1: offset = (n - r) % p for k in range(p-1,r,p): numerator[k - offset] /= pivot denominator[k] /= pivot result = 1 for k in range(r): if numerator[k] > 1: result *= int(numerator[k]) return result def combinations_with_replacement_count(n, r): """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once. Args: n (long): number r (long): number Raises: Exception: not defined when n or r is negative Returns: long: number """ if n < 0 or r < 0: raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative') elif n == 0: return 1 else: return combinations_count(n + r - 1, r) from bisect import bisect_left, bisect_right from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html import operator from operator import itemgetter #sort # ex1: List.sort(key=itemgetter(1)) # ex2: sorted(tuples, key=itemgetter(1,2)) from functools import reduce, lru_cache def chmin(x, y): """change minimum if x > y, x = y and return (x, True). convenient when solving problems of dp[i] Args: x (long): current minimum value y (long): potential minimum value Returns: (x, bool): (x, True) when updated, else (x, False) """ if x > y: x = y return (x, True) else: return (x, False) def chmax(x, y): """change maximum if x < y, x = y and return (x, True). convenient when solving problems of dp[i] Args: x (long): current maximum value y (long): potential maximum value Returns: (x, bool): (x, True) when updated, else (x, False) """ if x < y: x = y return (x, True) else: return (x, False) from math import gcd # Deprecated since version 3.5: Use math.gcd() instead. def gcds(numbers): return reduce(gcd, numbers) def lcm(x, y): return (x * y) // gcd(x, y) def lcms(numbers): return reduce(lcm, numbers, 1) def make_divisors(n, reversed=False): """create list of divisors Args: number (int): number from which list of divisors is created reversed (bool, optional): ascending order if False. Defaults to False. Returns: list: list of divisors """ divisors = set() for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.add(i) divisors.add(n//i) return sorted(list(divisors),reverse=reversed) # first create factorial_list # fac_list = mod_factorial_list(n) INF = 10 ** 18 MOD = 10 ** 9 + 7 modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow! def modinv(a, p = MOD): # evaluate reciprocal using Fermat's little theorem: # a**(p-1) is identical to 1 (mod p) when a and p is coprime return modpow(a, p-2, p) def modinv_list(n, p = MOD): if n <= 1: return [0,1][:n+1] else: inv_t = [0,1] for i in range(2, n+1): inv_t += [inv_t[p % i] * (p - int(p / i)) % p] return inv_t def modfactorial_list(n, p = MOD): if n == 0: return [1] else: l = [0] * (n+1) tmp = 1 for i in range(1, n+1): tmp = tmp * i % p l[i] = tmp return l def modcomb(n, k, fac_list = [], p = MOD): # fac_list = modfactorial_list(100) # print(modcomb(100, 5, modfactorial_list(100))) from math import factorial if n < 0 or k < 0 or n < k: return 0 if n == 0 or k == 0: return 1 if len(fac_list) <= n: a = factorial(n) % p b = factorial(k) % p c = factorial(n-k) % p else: a = fac_list[n] b = fac_list[k] c = fac_list[n-k] return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p def modadd(a, b, p = MOD): return (a + b) % MOD def modsub(a, b, p = MOD): return (a - b) % p def modmul(a, b, p = MOD): return ((a % p) * (b % p)) % p def moddiv(a, b, p = MOD): return modmul(a, modpow(b, p-2, p)) class UnionFindTree: """union find tree class TODO: fix this description... how to use (example): >> uf = UnionFindTree(N) >> if uf.find_root(a) == uf.find_root(b): >> do something >> else: >> do something >> uf.unite(a, b) """ def __init__(self, N): self.root = [-1] * (N+1) self.rank = [0] * (N+1) self.connected_num = [1] * (N+1) def find_root(self,x): root = self.root while root[x] != -1: x = root[x] return x def unite(self,x,y): root = self.root rank = self.rank connected_num = self.connected_num find_root = self.find_root rx = find_root(x) ry = find_root(y) if rx != ry: if rank[rx] < rank[ry]: root[rx] = ry rx,ry = ry,rx else: if rank[rx] == rank[ry]: rank[rx] += 1 root[ry] = rx connected_num[rx] += connected_num[ry] # Graph: https://en.wikipedia.org/wiki/Directed_graph # Bellman-Ford: O(|V||E|). Use this if there exists an edge with negative length in the graph # After N steps, the shortest path has converded if there doesn't exist an cycle of edges with negative # Watch out: d[N] == d[2*N] doesn't necessarily mean the graph doesn't have negative cycle # ref: https://www.youtube.com/watch?v=1Z6ofKN03_Y def BellmanFord(N, M, ABC, vertex_start, vertex_end, value_if_inf = -1, find_shortest = False): """to calculate furthest or shortest length between vertex_start and vertex_end using BellmanFord algorithm Args: N (int): number of vertices M (int): number of edges ABC (list): [(ai, bi, ci) for _ in range(N)] where i-th edge is directed from vertex ai to vertex bi and the length is ci vertex_start (int): start vertex. usually use 0. vertex_end (int): end vertex. usually use N-1. value_if_inf (int or string as you like, optional): value you want when the furthest (or shortest) distance is infinite (or -infinite). Defaults to -1. find_shortest (bool, optional): choose False to find furthest path. Defaults to False. Returns: int or string: normally int (but can be str if you set value_if_inf to str) Example: N, M, P = R() ABC = [R() for _ in range(M)] ABC = [(a-1, b-1, c-P) for a, b, c in ABC] print(BellmanFord(N, M, ABC, 0, N-1, value_if_inf = 'inf')) """ def make_reachable_list(N, M, ABC, vertex_start, vertex_end): reachable_to_direct = defaultdict(list) reachable_from_direct = defaultdict(list) reachable_from_start = [False] * N reachable_to_end = [False] * N reachable_from_start[vertex_start] = True reachable_to_end[vertex_end] = True reachable_from_both_sides = [False] * N dfs_from_start = [] dfs_to_end = [] for a, b, c in ABC: reachable_to_direct[a].append(b) reachable_from_direct[b].append(a) if a == vertex_start: dfs_from_start.append(b) reachable_from_start[b] = True if b == vertex_end: dfs_to_end.append(a) reachable_to_end[a] = True while dfs_from_start: v = dfs_from_start.pop() for i in reachable_to_direct[v]: if not reachable_from_start[i]: reachable_from_start[i] = True dfs_from_start.append(i) while dfs_to_end: v = dfs_to_end.pop() for i in reachable_from_direct[v]: if not reachable_to_end[i]: reachable_to_end[i] = True dfs_to_end.append(i) for i in range(N): reachable_from_both_sides[i] = reachable_from_start[i] and reachable_to_end[i] return reachable_from_both_sides reachable_from_both_sides = make_reachable_list(N, M, ABC, vertex_start, vertex_end) if find_shortest: dist = [INF for i in range(N)] else: dist = [-INF for i in range(N)] dist[vertex_start] = 0 for i in range(N): updated = False for a, b, c in ABC: if not reachable_from_both_sides[a]: continue elif find_shortest: update_condition = dist[a] + c < dist[b] else: update_condition = dist[a] + c > dist[b] if dist[a] != INF and update_condition: dist[b] = dist[a] + c updated = True if i == N-1: return value_if_inf if not updated: break return dist[vertex_end] """ initialize variables and set inputs # initialize variables # to initialize list, use [0] * n # to initialize two dimentional array: # ex) [[0] * N for _ in range(N)] # ex2) dp = [[0] * (N+1) for _ in range(W*2)] # set inputs # put inputs between specific values (almost as quickly) # ex) S = [-INF] + [int(r()) for _ in range(A)] + [INF] # open(0).read() is sometimes useful: # ex) n, m, *x = map(int, open(0).read().split()) # min(x[::2]) - max(x[1::2]) # ex2) *x, = map(int, open(0).read().split()) # don't forget to add comma after *x if only one variable is used # preprocessing # transpose = [x for x in zip(*data)] # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)] # flat = [flatten for inner in data for flatten in inner] # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9] # calculate and output # output pattern # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6 """ # functions to read input r = lambda: sys.stdin.readline().strip() r_int = lambda: int(r()) r_float = lambda: float(r()) R = lambda: list(map(int, r().split())) R_str = lambda: r().split() R_map = lambda: map(int, r().split()) R_float = lambda: list(map(float, r().split())) R_tuple = lambda: tuple(map(int, r().split())) """ how to treat input # single int: int(r()) # single string: r() # single float: float(r()) # line int: R() # line string: r().split() # line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())] # lines int: [R() for _ in range(n)] """ # for test if sample_file: sys.stdin = open(sample_file) # ---------------------------------- # main # H = r_int() # W = r_int() # N = r_int() # u = max(H, W) # t = N//u # if N%u != 0: # t += 1 # print(t) N = r_int() XL = [R() for _ in range(N)] XL.sort() tmp = -INF ans = N for x, l in XL: if x - (l-0.1) < tmp: ans -= 1 tmp = min(tmp, x+(l-0.1)) else: tmp = x+(l-0.1) print(ans) # to finish code, use return instead of exit() # end of main # ---------------------------------- """memo: how to use defaultdict of list # initialize Dic = defaultdict(list) # append / extend Dic[x].append(y) # three methods for loop: keys(), values(), items() for k, v in Dic.items(): """ """memo: how to solve binary problems # to make binary digits text >>> a = 5 >>> bin_str_a = format(a, '#06b') >>> print(bin_str_a) 0b0101 # first 2 strings (='0b') indicates it is binary """ """memo: how to solve the problem creating simple test/answer greed simple dp graph """ if __name__ == '__main__': main()
[ "control_flow.branch.if.condition.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
603,323
603,324
u988402778
python
p02796
N = int(input()) # X, L = [], [] A = [] for i in range(N): x, l = map(int, input().split()) # X.append(x) # L.append(l) A.append((x - l, x + l)) A.sort(key=lambda x: x[1]) ans = 0 x = -10e50 for i in range(N): l, r = A[i] if x <= l: ans += 1 x = r-1 print(ans) # 選べるロボットの中で最もX+Lが小さいもの
N = int(input()) # X, L = [], [] A = [] for i in range(N): x, l = map(int, input().split()) # X.append(x) # L.append(l) A.append((x - l, x + l)) A.sort(key=lambda x: x[1]) ans = 0 x = -10e50 for i in range(N): l, r = A[i] if x <= l: ans += 1 x = r print(ans) # 選べるロボットの中で最もX+Lが小さいもの
[ "expression.operation.binary.remove" ]
603,325
603,326
u731368968
python
p02796
N = int(input()) robos = [] for i in range(N): x, l = map(int, input().split()) robos.append((x - l, x + l)) robos.sort() kosuu = 0 maenomigi = -100000000000000000000000 for hidari, migi in robos: # ok if maenomigi <= hidari: maenomigi = migi kosuu += 1 print(kosuu)
N = int(input()) robos = [] for i in range(N): x, l = map(int, input().split()) robos.append((x + l, x - l)) robos.sort() kosuu = 0 maenomigi = -100000000000000000000000 for migi, hidari in robos: # ok if maenomigi <= hidari: maenomigi = migi kosuu += 1 print(kosuu)
[ "misc.opposites", "expression.operator.arithmetic.change", "call.arguments.change", "expression.operation.binary.change" ]
603,362
603,363
u328099989
python
p02796
n = int(input()) a = [list(map(int,input().split())) for i in range(n)] a = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)] a.sort(key = lambda x:x[1]) ans = 1 g = a[0][1] for i in range(1,n): x = a[i][0] if g>=x: ans += 1 g = a[i][1] print(ans)
n = int(input()) a = [list(map(int,input().split())) for i in range(n)] a = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)] a.sort(key = lambda x:x[1]) ans = 1 g = a[0][1] for i in range(1,n): x = a[i][0] if g<=x: ans += 1 g = a[i][1] print(ans)
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
603,364
603,365
u905582793
python
p02796
N = int(input()) A = [] for i in range(N): x,l = map(int,input().split()) A.append([x-l+1,x+l-1]) B=sorted(A,key=lambda x: x[1]) s = B[0][1] n = 1 for i in range(1,N): a = B[i][0] b = B[i][1] if a >= s: n += 1 s = b print(n)
N = int(input()) A = [] for i in range(N): x,l = map(int,input().split()) A.append([x-l,x+l]) B=sorted(A,key=lambda x: x[1]) s = B[0][1] n = 1 for i in range(1,N): a = B[i][0] b = B[i][1] if a >= s: n += 1 s = b print(n)
[ "expression.operation.binary.remove" ]
603,368
603,369
u328858746
python
p02796
import sys input = sys.stdin.readline N = int(input()) l = [] for _ in range(N): Xi, Li = map(int, input().split()) l.append((Xi-Li+1, Xi+Li-1)) l.sort(key=lambda k: k[1]) now = -10**18 ans = 0 i = 0 while i<N: if now<l[i][0]: now = l[i][1] ans += 1 i += 1 print(ans)
import sys input = sys.stdin.readline N = int(input()) l = [] for _ in range(N): Xi, Li = map(int, input().split()) l.append((Xi-Li, Xi+Li)) l.sort(key=lambda k: k[1]) now = -10**18 ans = 0 i = 0 while i<N: if now<=l[i][0]: now = l[i][1] ans += 1 i += 1 print(ans)
[ "expression.operation.binary.remove", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
603,372
603,373
u047796752
python
p02801
C = input() chars = "abcdefghijklmnopqrstuvwxyz" ls = list(chars) + list(chars) dic = {chars[i]:chars[i+1] for i in range(26)} print(dic[C])
C = input() chars = "abcdefghijklmnopqrstuvwxyz" ls = list(chars) + list(chars) dic = {ls[i]:ls[i+1] for i in range(26)} print(dic[C])
[ "assignment.value.change", "identifier.change" ]
603,759
603,760
u006880673
python
p02801
c = input() l = [chi(i) for i in range(65, 91)] print(l[l.index(c) + 1])
c = input() l = [chr(i) for i in range(97, 123)] print(l[l.index(c) + 1])
[ "assignment.value.change", "identifier.change", "call.function.change", "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.lower.change", "control_flow.loop.range.bounds.upper.change" ]
603,769
603,770
u581403769
python
p02801
s=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] a=input() for i in range(23): if a==s[i]: print(s[i+1])
s=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] a=input() for i in range(25): if a==s[i]: print(s[i+1])
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
603,771
603,772
u754511616
python
p02801
print(char(ord(input())+1))
print(chr(ord(input())+1))
[ "identifier.change", "call.function.change", "call.arguments.change", "io.output.change" ]
603,773
603,774
u658288444
python
p02801
print(input()+1)
print(chr(ord(input())+1))
[ "call.arguments.add", "call.arguments.change" ]
603,775
603,774
u658288444
python
p02801
x=input() arr="abcdefghijklmnopqrstuvwxyz" arr[arr.index(x)+1]
x=input() arr="abcdefghijklmnopqrstuvwxyz" print(arr[arr.index(x)+1])
[ "call.add", "call.arguments.change" ]
603,783
603,784
u487288850
python
p02801
from strings import ascii_lowercase as lc given = input() print(lc[lc.index(given) + 1])
from string import ascii_lowercase as lc given = input() print(lc[lc.index(given) + 1])
[ "identifier.change" ]
603,785
603,786
u674190122
python
p02801
N = str(input()) chr(ord(N)+1)
N = str(input()) print(chr(ord(N)+1))
[ "call.add", "call.arguments.change" ]
603,791
603,792
u591143370
python
p02801
# !/use/bin/python3 """ https://atcoder.jp/contests/abc151/tasks/abc151_a Next Alphabate """ def solve(c): print(c) ans = ord(c) return chr(ans+1) if __name__ == "__main__": c = input() print(solve(c))
# !/use/bin/python3 """ https://atcoder.jp/contests/abc151/tasks/abc151_a Next Alphabate """ def solve(c): ans = ord(c) return chr(ans+1) if __name__ == "__main__": c = input() print(solve(c))
[ "call.remove" ]
603,793
603,794
u862417957
python
p02801
C = input() print(char(ord(C)+1))
C = input() print(chr(ord(C)+1))
[ "identifier.change", "call.function.change", "call.arguments.change", "io.output.change" ]
603,795
603,796
u068862866
python
p02801
C = input() next = ord('C') + 1 print(chr(next))
C = input() next = ord(C) + 1 #ord()は一文字の文字列を数値に変換する print(chr(next))
[ "call.arguments.change" ]
603,809
603,810
u197833153
python
p02801
c=input() alp="abcdefghijklmnopqrstuvwxyz" for i in range(25): if c==alp[i]: print(alh[i+1]) break
c=input() alp="abcdefghijklmnopqrstuvwxyz" for i in range(25): if c==alp[i]: print(alp[i+1]) break
[ "identifier.change", "call.arguments.change", "io.output.change" ]
603,811
603,812
u088488125
python
p02801
alpha="abcdefghijklmnomqrstuvwxyz" inp=input() def split(w): return [all for all in w] alpha=split(alpha) x=alpha.index(inp) try: print(alpha[x+1]) except: print("a")
alpha="abcdefghijklmnopqrstuvwxyz" inp=input() def split(w): return [all for all in w] alpha=split(alpha) x=alpha.index(inp) try: print(alpha[x+1]) except: print("a")
[ "literal.string.change", "assignment.value.change" ]
603,817
603,818
u000085263
python
p02801
s = input() st = 'abcdefghijklmnopqrstuvwxyz' print(st[index(s)+1])
s = input() st = 'abcdefghijklmnopqrstuvwxyz' print(st[st.index(s)+1])
[]
603,819
603,820
u531599639
python
p02801
c = int(input()) C = ord(c) print(chr(C))
c = input() C = ord(c) print(chr(C+1))
[ "call.remove", "call.arguments.change" ]
603,821
603,822
u853728588
python
p02801
c = ord(input()) print(chr(c))
c = ord(input()) print(chr(c+1))
[ "expression.operation.binary.add" ]
603,825
603,826
u175590965
python
p02801
ch = ord(input()) print(chr(ord(ch) + 1))
ch = input() print(chr(ord(ch) + 1))
[ "call.remove", "call.arguments.change" ]
603,834
603,835
u652155485
python
p02801
ac = input() acc ='abcdefghijklmnopqrstuvwxyx' print(acc[acc.index(ac) + 1])
ac = input() acc ='abcdefghijklmnopqrstuvwxyz' print(acc[acc.index(ac) + 1])
[ "literal.string.change", "assignment.value.change" ]
603,838
603,839
u629540524
python
p02801
c = input() c = ord(c + 1) print(c)
c = input() c = ord(c) + 1 print(chr(c))
[ "call.arguments.change", "call.arguments.add" ]
603,845
603,846
u357751375
python
p02801
c = input() c = c + 1 print(c)
c = input() c = ord(c) + 1 print(chr(c))
[ "call.add", "call.arguments.change" ]
603,847
603,846
u357751375
python
p02801
al = abcdefghijklmnopqrstuvwxyz C = input() print(al[al.index(C)+1])
al = "abcdefghijklmnopqrstuvwxyz" C = input() print(al[al.index(C)+1])
[]
603,848
603,849
u841568901
python
p02801
c = input() ord_s = ord(c) chr_s = chr(ord_s) print(chr_s)
c = input() ord_s = ord(c) chr_s = chr(ord_s+1) print(chr_s)
[ "assignment.change" ]
603,876
603,877
u471503862
python
p02801
C=input() chr(ord(C) + 1)
C=input() print(chr(ord(C) + 1))
[ "call.add", "call.arguments.change" ]
603,882
603,883
u494295478
python
p02801
a = input() print(char(ord(a)+1))
a = input() print(chr(ord(a)+1))
[ "identifier.change", "call.function.change", "call.arguments.change", "io.output.change" ]
603,892
603,893
u026155812
python
p02801
C = input() print(chr(ord('C') + 1))
C = input() print(chr(ord(C) + 1))
[ "call.arguments.change" ]
603,894
603,895
u685244071
python
p02801
l="abcdefghijklmnopqrstuvwxy" print(l[l.index(input())+1])
l="abcdefghijklmnopqrstuvwxyz" print(l[l.index(input())+1])
[ "literal.string.change", "assignment.value.change" ]
603,899
603,900
u332793228
python
p02801
alphabet = 'abcdefghijklmnopqrstuvwxyz' print(alphabet[alphabet.find('a') + 1])
alphabet = 'abcdefghijklmnopqrstuvwxyz' print(alphabet[alphabet.find(input()) + 1])
[]
603,901
603,902
u856775981
python
p02801
c = raw_input() ls = [chr(ord('a') + i) for i in range(26)] for i in range(len(ls)): if ls[i] == c: print(ls[i + 1]) break
c = input() ls = [chr(ord('a') + i) for i in range(26)] for i in range(len(ls)): if ls[i] == c: print(ls[i + 1]) break
[ "assignment.value.change", "identifier.change", "call.function.change" ]
603,907
603,908
u916662650
python
p02801
import sys stdin=sys.stdin ns = lambda:stdin.readline().rstrip() ni = lambda:int(stdin.readline().rstrip()) nm = lambda:map(int,stdin.readline().split()) nl = lambda:list(map(int,stdin.readline().split())) S=input() A=['a','b','c','b','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] if(S=='z'): print('a') else: inds=A.index(S) print(A[inds+1])
import sys stdin=sys.stdin ns = lambda:stdin.readline().rstrip() ni = lambda:int(stdin.readline().rstrip()) nm = lambda:map(int,stdin.readline().split()) nl = lambda:list(map(int,stdin.readline().split())) S=input() A=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] if(S=='z'): print('a') else: inds=A.index(S) print(A[inds+1])
[ "literal.string.change", "assignment.value.change" ]
603,923
603,924
u525796732
python
p02801
print(chr(ord(str(input())+1)))
print(chr(ord(str(input()))+1))
[ "call.arguments.change" ]
603,929
603,930
u383450070
python
p02801
A = "abcdefghijklmnopqrstu" c = input() print(A[A.index(c)+1])
A = "abcdefghijklmnopqrstuvwxyz" c = input() print(A[A.index(c)+1])
[ "literal.string.change", "assignment.value.change" ]
603,937
603,938
u572343785
python
p02801
a="abcdefghijklmnopgrstuvwxyz" b=input() c=0 while True: if b==a[c]: print(a[c+1]) break c+=1
a="abcdefghijklmnopqrstuvwxyz" b=input() c=0 while True: if b==a[c]: print(a[c+1]) break c+=1
[ "literal.string.change", "assignment.value.change" ]
603,941
603,942
u156383602
python
p02801
C = input() print(chr(ord(C)))
C = input() print(chr(ord(C)+1))
[ "expression.operation.binary.add" ]
603,947
603,948
u425762225
python
p02801
C=input() print(str(ord(C)+1))
C=input() print(chr(ord(C)+1))
[ "identifier.change", "call.function.change", "call.arguments.change", "io.output.change" ]
603,957
603,958
u375616706
python
p02801
al = list("abcdefghijklmn") C = input() print(al[al.index(C)+1])
al = list("abcdefghijklmnopqrstuvwxyz") C = input() print(al[al.index(C)+1])
[ "literal.string.change", "assignment.value.change", "call.arguments.change" ]
603,965
603,966
u884323674
python
p02801
import sys, string c = sys.stdin.readline().rstrip() a = string.ascii_lowercase i = a.index('c') + 1 print(a[i])
import sys, string c = sys.stdin.readline().rstrip() a = string.ascii_lowercase i = a.index(c) + 1 print(a[i])
[ "call.arguments.change" ]
603,975
603,976
u823885866
python
p02801
c=input() z='abcdefghijklmnopqrstuvwxy' print(z[z.index(c)+1])
c=input() z='abcdefghijklmnopqrstuvwxyz' print(z[z.index(c)+1])
[ "literal.string.change", "assignment.value.change" ]
603,977
603,978
u235066013
python
p02801
a = ord(input())+1 print(a)
a = chr(ord(input())+1) print(a)
[ "call.add", "call.arguments.change" ]
603,985
603,986
u084320347
python
p02801
al = [ord(i) for i in range(ord("a"), ord("a")+26)] str = input() print(al[al.index(str)+1])
al = [chr(i) for i in range(ord("a"), ord("a")+26)] str = input() print(al[al.index(str)+1])
[ "assignment.value.change", "identifier.change", "call.function.change" ]
603,989
603,990
u674052742
python
p02801
alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] print(alphabet[alphabet.index(input())])
alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] print(alphabet[alphabet.index(input())+1])
[ "expression.operation.binary.add" ]
603,991
603,992
u033524082
python
p02801
C=input() str='abcdefghijtlmnopqrstuvwxyz' print(str[str.index(C)+1])
C=input() str='abcdefghijklmnopqrstuvwxyz' print(str[str.index(C)+1])
[ "literal.string.change", "assignment.value.change" ]
603,993
603,994
u233183615
python
p02801
al = 'abcdefghijklmnopqrstuvwxy' c = input() print(al[al.index(c)+1])
al = 'abcdefghijklmnopqrstuvwxyz' c = input() print(al[al.index(c)+1])
[ "literal.string.change", "assignment.value.change" ]
604,004
604,005
u175034939
python
p02801
s = input() print(chr(ord(s + 1)))
s = input() print(chr(ord(s) + 1))
[ "call.arguments.change" ]
604,028
604,029
u026862065
python
p02801
# simply use double ifs s = input() print(chr(ord(s))+1)
# simply use double ifs s = input() print(chr(ord(s)+1))
[ "call.arguments.change" ]
604,063
604,064
u024340351
python
p02801
alph = input() print(ord(alph+1))
alph = input() print(chr(ord(alph)+1))
[ "call.arguments.add", "call.arguments.change" ]
604,067
604,068
u265118937
python
p02801
alph = input() print(ord(alph)+1)
alph = input() print(chr(ord(alph)+1))
[ "call.arguments.add", "call.arguments.change" ]
604,069
604,068
u265118937
python
p02801
x = ord(input()) ind = (x - ord("A")+1)%26 print(chr(ind+ord("A")))
x = ord(input()) ind = (x - ord("a")+1)%26 print(chr(ind+ord("a")))
[ "literal.string.change", "literal.string.case.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
604,072
604,073
u545368057
python
p02801
c = input() al = "abcdefghijklmnopqrstuvwxz" print(al[al.index(c)+1])
c = input() al = "abcdefghijklmnopqrstuvwxyz" print(al[al.index(c)+1])
[ "literal.string.change", "assignment.value.change" ]
604,139
604,140
u995163736
python
p02801
C = input() alpha = ["a","b","c","d""e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] j = 0 for i in alpha: if i == C: print(alpha[j+1]) j += 1
C = input() alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] j = 0 for i in alpha: if i == C: print(alpha[j+1]) j += 1
[]
604,141
604,142
u335599768
python
p02801
a=input() if a=="a": print("b") if a=="b": print("c") if a=="c": print("d") if a=="d": print("e") if a=="e": print("f") if a=="f": print("g") if a=="g": print("h") if a=="h": print("i") if a=="i": print("j") if a=="j": print("k") if a=="k": print("l") if a=="l": print("m") if a=="m": print("n") if a=="n": print("o") if a=="o": print("p") if a=="p": print("q") if a=="q": print("r") if a=="r": print("s") if a=="s": print("t") if a=="t": print("u") if a=="u": print("v") if a=="v": print("w") if a=="w": print("x") if a=="x": print("y") if a=="y": print("x")
a=input() if a=="a": print("b") if a=="b": print("c") if a=="c": print("d") if a=="d": print("e") if a=="e": print("f") if a=="f": print("g") if a=="g": print("h") if a=="h": print("i") if a=="i": print("j") if a=="j": print("k") if a=="k": print("l") if a=="l": print("m") if a=="m": print("n") if a=="n": print("o") if a=="o": print("p") if a=="p": print("q") if a=="q": print("r") if a=="r": print("s") if a=="s": print("t") if a=="t": print("u") if a=="u": print("v") if a=="v": print("w") if a=="w": print("x") if a=="x": print("y") if a=="y": print("z")
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
604,149
604,150
u244836567
python
p02801
a=input() print=(chr(ord(a)+1))
a=input() print(chr(ord(a)+1))
[]
604,158
604,156
u355154595
python
p02801
nput() if x =='a': print('b') if x =='b': print('c') if x =='c': print('d') if x =='d': print('e') if x =='e': print('f') if x =='f': print('g') if x =='g': print('h') if x =='h': print('i') if x =='i': print('j') if x =='j': print('k') if x =='k': print('l') if x =='l': print('m') if x =='m': print('n') if x =='n': print('o') if x =='o': print('p') if x =='p': print('q') if x =='q': print('r') if x =='r': print('s') if x =='s': print('t') if x =='t': print('u') if x =='u': print('v') if x =='v': print('w') if x =='w': print('x') if x =='x': print('y') if x =='y': print('z')
x = input() if x =='a': print('b') if x =='b': print('c') if x =='c': print('d') if x =='d': print('e') if x =='e': print('f') if x =='f': print('g') if x =='g': print('h') if x =='h': print('i') if x =='i': print('j') if x =='j': print('k') if x =='k': print('l') if x =='l': print('m') if x =='m': print('n') if x =='n': print('o') if x =='o': print('p') if x =='p': print('q') if x =='q': print('r') if x =='r': print('s') if x =='s': print('t') if x =='t': print('u') if x =='u': print('v') if x =='v': print('w') if x =='w': print('x') if x =='x': print('y') if x =='y': print('z')
[ "assignment.variable.change" ]
604,166
604,167
u342369573
python
p02801
letter = ord(input()) print(chr(c+1))
letter = ord(input()) print(chr(letter+1))
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
604,171
604,172
u246401133
python
p02801
print(chr(ord(int(input())) + 1))
print(chr(ord(input()) + 1))
[ "call.remove", "call.arguments.change" ]
604,173
604,174
u898109279
python
p02801
import string AL = string.lowercase C = input() idx = AL.find(C) idy = (idx + 1) % 26 print(AL[idy])
import string AL = string.ascii_lowercase C = input() idx = AL.find(C) idy = (idx + 1) % 26 print(AL[idy])
[ "assignment.value.change", "identifier.change" ]
604,181
604,182
u934442292
python
p02801
import string AL = string.lowercase C = input() idx = AL.find(C) idy = (idx + 1) % 26 print(AL[idy])
import string AL = string.ascii_lowercase C = input() idx = AL.find(C) idy = (idx + 1) % 26 print(AL[idy])
[ "assignment.value.change", "identifier.change" ]
604,181
604,183
u934442292
python
p02801
listA = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] C = input() for i in range(24): if C == listA[i]: print(listA[i+1])
listA = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] C = input() for i in range(25): if C == listA[i]: print(listA[i+1])
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
604,187
604,188
u514118270
python
p02801
c = input() txt = 'abcdefjtijklmnopoqrstuvwxyz' for i in range(27): if txt[i] == c: print(txt[i + 1])
c = input() txt = 'abcdefghijklmnopqrstuvwxyz' for i in range(26): if txt[i] == c: print(txt[i + 1])
[ "literal.string.change", "assignment.value.change", "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
604,191
604,190
u307622233
python
p02801
C = input('') chr(ord(C) + 1)
C = input('') print (chr(ord(C) + 1))
[ "call.add", "call.arguments.change" ]
604,196
604,197
u354623416
python
p02801
s = input() print(char(ord(s) + 1))
s = input() print(chr(ord(s) + 1))
[ "identifier.change", "call.function.change", "call.arguments.change", "io.output.change" ]
604,207
604,205
u309423187
python
p02801
c = input() alpa = 'abcdefghijklmnopqrstuvwyxz' print(alpa[alpa.index(c)+1])
c = input() alpa = 'abcdefghijklmnopqrstuvwxyz' print(alpa[alpa.index(c)+1])
[ "literal.string.change", "assignment.value.change" ]
604,210
604,211
u797550216
python
p02801
imp = imput() alp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p', 'q','r','s','t','u','v','w','x','y','z'] print(alp[alp.index(str(imp)) + 2])
imp = input() alp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p', 'q','r','s','t','u','v','w','x','y','z'] print(alp[alp.index(imp) + 1])
[ "assignment.value.change", "identifier.change", "call.function.change", "call.remove", "call.arguments.change", "literal.number.integer.change", "variable_access.subscript.index.change", "expression.operation.binary.change", "io.output.change" ]
604,237
604,238
u127025777
python
p02801
imp = imput() alp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p', 'q','r','s','t','u','v','w','x','y','z'] print(alp[alp.index(imp) + 2])
imp = input() alp = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p', 'q','r','s','t','u','v','w','x','y','z'] print(alp[alp.index(imp) + 1])
[ "assignment.value.change", "identifier.change", "call.function.change", "literal.number.integer.change", "variable_access.subscript.index.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
604,239
604,238
u127025777
python
p02801
import numpy as np print(char(ord(input()[0])+1))
print(chr(ord(input()[0])+1))
[ "identifier.change", "call.function.change", "call.arguments.change", "io.output.change" ]
604,240
604,241
u331360010
python
p02801
N = int(input()) alp = 'abcdefghijklmnopqrstuvwxyz' ans = alp[(alp.index(N) + 1)] print(ans)
S = input() alp = 'abcdefghijklmnopqrstuvwxyz' ans = alp[(alp.index(S) + 1)] print(ans)
[ "assignment.variable.change", "identifier.change", "call.remove", "call.arguments.change", "assignment.value.change", "variable_access.subscript.index.change", "expression.operation.binary.change" ]
604,244
604,245
u325264482
python
p02801
N = int(input()) alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ans = alp[(alp.index(N) + 1)] print(ans)
S = input() alp = 'abcdefghijklmnopqrstuvwxyz' ans = alp[(alp.index(S) + 1)] print(ans)
[ "assignment.variable.change", "identifier.change", "call.remove", "call.arguments.change", "literal.string.change", "literal.string.case.change", "assignment.value.change", "variable_access.subscript.index.change", "expression.operation.binary.change" ]
604,246
604,245
u325264482
python