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
p02844
n,S,r=int(input()),input(),0 dp1=[0]*n dp2=[0]*n d1=set() d2=set() cs=[0]*10 for i in range(n): dp1[i] = len(d1) d1.add(S[i]) for i in range(n): j = n-i-1 dp2[j] = len(d2) r += dp1[i]*(dp2[j]-dp2[cs[int(S[j])]]) d2.add(S[j]) cs[int(S[j])] = j print(r)
n,S,r=int(input()),input(),0 dp1=[0]*n dp2=[0]*n d1=set() d2=set() cs=[0]*10 for i in range(n): dp1[i] = len(d1) d1.add(S[i]) for i in range(n): j = n-i-1 dp2[j] = len(d2) r += dp1[j]*(dp2[j]-dp2[cs[int(S[j])]]) d2.add(S[j]) cs[int(S[j])] = j print(r)
[ "identifier.change", "variable_access.subscript.index.change", "expression.operation.binary.change" ]
651,122
651,123
u941407962
python
p02844
N = int(input()) S = input() count = 0 for p in range(22,1000): v = format(p, '03') found = False pos1 = S.find(v[0]) if pos1 == -1: continue pos2 = S[pos1 + 1:].find(v[1]) if pos2 == -1: continue pos3 = S[pos1 + pos2 + 2:].find(v[2]) if pos3 == -1: continue ...
N = int(input()) S = input() count = 0 for p in range(1000): v = format(p, '03') found = False pos1 = S.find(v[0]) if pos1 == -1: continue pos2 = S[pos1 + 1:].find(v[1]) if pos2 == -1: continue pos3 = S[pos1 + pos2 + 2:].find(v[2]) if pos3 == -1: continue cou...
[ "call.arguments.change" ]
651,152
651,153
u471828790
python
p02844
n = int(input()) s = list(map(int, input())) print(s) ans = 0 for i in range(10): for j in range(10): for k in range(10): preindex = 0 flag1 = 0 flag2 = 0 flag3 = 0 while preindex < n: if s[preindex] == i: prein...
n = int(input()) s = list(map(int, input())) ans = 0 for i in range(10): for j in range(10): for k in range(10): preindex = 0 flag1 = 0 flag2 = 0 flag3 = 0 while preindex < n: if s[preindex] == i: preindex += 1 ...
[ "call.remove" ]
651,164
651,165
u691896522
python
p02844
N = int(input()) S = list(map(int,list(input()))) S_riv=S[::-1] l_lis=[0]*N r_lis=[0]*N mat=([0 for j in range(10)]) l_set=set([]) r_set=set([]) for i,s in enumerate(S): l_lis[i]=l_set.copy() l_set.add(s) for i,s in enumerate(S_riv): r_lis[i]=r_set.copy() r_set.add(s) r_lis.reverse() ans=0 for i,s in enum...
N = int(input()) S = list(map(int,list(input()))) S_riv=S[::-1] l_lis=[0]*N r_lis=[0]*N mat=([0 for j in range(10)]) l_set=set([]) r_set=set([]) for i,s in enumerate(S): l_lis[i]=l_set.copy() l_set.add(s) for i,s in enumerate(S_riv): r_lis[i]=r_set.copy() r_set.add(s) r_lis.reverse() ans=0 for i,s in enum...
[ "call.add" ]
651,171
651,172
u268554510
python
p02844
# #    ⋀_⋀  #   (・ω・) # ./ U ∽ U\ # │* 合 *│ # │* 格 *│ # │* 祈 *│ # │* 願 *│ # │*   *│ #  ̄ # import sys sys.setrecursionlimit(10**6) input=sys.stdin.readline from math import floor,ceil,sqrt,factorial,log #log2ないyp from heapq import heappop, heappush, heappushpop from collections import Counter,defaultd...
# #    ⋀_⋀  #   (・ω・) # ./ U ∽ U\ # │* 合 *│ # │* 格 *│ # │* 祈 *│ # │* 願 *│ # │*   *│ #  ̄ # import sys sys.setrecursionlimit(10**6) input=sys.stdin.readline from math import floor,ceil,sqrt,factorial,log #log2ないyp from heapq import heappop, heappush, heappushpop from collections import Counter,defaultd...
[]
651,179
651,180
u788137651
python
p02844
import sys input = sys.stdin.readline def main(): N = int(input()) S = input().strip() ans = 0 for i in range(1000+1): s = "{:03}".format(i) a = S.find(s[0]) b = S.find(s[1], a+1) c = S.find(s[2], b+1) if a >= 0 and b >= 0 and c >= 0 and (a < b < c): ...
import sys input = sys.stdin.readline def main(): N = int(input()) S = input().strip() ans = 0 for i in range(1000): s = "{:03}".format(i) a = S.find(s[0]) b = S.find(s[1], a+1) c = S.find(s[2], b+1) if a >= 0 and b >= 0 and c >= 0 and (a < b < c): a...
[ "expression.operation.binary.remove" ]
651,183
651,184
u076917070
python
p02844
n=int(input()) s=input() nsl=['{:03}'.format() for i in range(1000)] res=0 for ns in nsl: idx=0 for char in s: if char == ns[idx]: idx+=1 if idx == 3: res+=1 break print(res)
n=int(input()) s=input() nsl=['{:03}'.format(i) for i in range(1000)] res=0 for ns in nsl: idx=0 for char in s: if char == ns[idx]: idx+=1 if idx == 3: res+=1 break print(res)
[ "call.arguments.change" ]
651,185
651,186
u148218179
python
p02844
N=int(input()) S=int(input()) l_S=list(str(S)) count=0 for i in range(0,1000): i_1=int(i/100) i_2=int(i/10)-i_1*10 i_3=i%10 if str(i_1) in l_S[:-2]: idx_1=l_S[:-2].index(str(i_1)) if str(i_2) in l_S[idx_1+1:-1]: idx_2=l_S[idx_1+1:-1].index(str(i_2))+idx_1+1 if s...
N=int(input()) S=str(input()) l_S=list(S) count=0 for i in range(0,1000): i_1=int(i/100) i_2=int(i/10)-i_1*10 i_3=i%10 if str(i_1) in l_S[:-2]: idx_1=l_S[:-2].index(str(i_1)) if str(i_2) in l_S[idx_1+1:-1]: idx_2=l_S[idx_1+1:-1].index(str(i_2))+idx_1+1 if str(i_...
[ "assignment.value.change", "identifier.change", "call.function.change", "call.remove", "call.arguments.change" ]
651,199
651,200
u517327166
python
p02844
n=int(input()) s=input() ans=0 for i in range(1,1000): i=str(i) i=(3-len(i))*"0"+i r=0 for j in range(n): if s[j]==i[r]: r+=1 if r==3: break if r==3: ans+=1 print(ans)
n=int(input()) s=input() ans=0 for i in range(1000): i=str(i) i=(3-len(i))*"0"+i r=0 for j in range(n): if s[j]==i[r]: r+=1 if r==3: break if r==3: ans+=1 print(ans)
[ "call.arguments.change" ]
651,206
651,207
u296150111
python
p02844
n = int(input()) s = list(map(int, list(input()))) def aruka(a,b,c): i = 0 while i <= n: if i == n: return False if s[i] == a: i += 1 break i += 1 while i <= n: if i == n: return False if s[i] == b: i += 1 ...
n = int(input()) s = list(map(int, list(input()))) def aruka(a,b,c): i = 0 while i <= n: if i == n: return False if s[i] == a: i += 1 break i += 1 while i <= n: if i == n: return False if s[i] == b: i += 1 ...
[ "call.add" ]
651,223
651,224
u755363325
python
p02844
n = int(input()) S = input() result = 0 for i in range(10): if str(i) in S: T = S[S.index(str(i)):] for j in range(10): if str(j) in T: U = T[T.index(str(j)):] for k in range(10): if str(k) in U: result += 1 print(result)
n = int(input()) S = input() result = 0 for i in range(10): if str(i) in S: T = S[S.index(str(i))+1:] for j in range(10): if str(j) in T: U = T[T.index(str(j))+1:] for k in range(10): if str(k) in U: result += 1 print(result)
[ "assignment.change" ]
651,227
651,228
u079427319
python
p02845
N = int(input()) A = list(map(int, input().split())) mod = 10**9+7 G = [0]*3 ans = 1 for i in range(N): x = 0 cnt = 0 for j, g in enumerate(G): if g == A[i]: x = j if cnt == 0 else x cnt += 1 G[x] += 1 ans *= cnt ans = ans % mod print(i, G) print(ans)
N = int(input()) A = list(map(int, input().split())) mod = 10**9+7 G = [0]*3 ans = 1 for i in range(N): x = 0 cnt = 0 for j, g in enumerate(G): if g == A[i]: x = j if cnt == 0 else x cnt += 1 G[x] += 1 ans *= cnt ans = ans % mod print(ans)
[ "call.remove" ]
651,234
651,235
u267718666
python
p02845
n=int(input()) l=list(map(int,input().split())) mod=10**9+7 ans=1 rgb=[0]*3 for i in range(n): f=0 for i in range(3): if l[i]==rgb[i]: if f==0: rgb[i]+=1 f+=1 ans*=f ans%=mod print(ans)
n=int(input()) l=list(map(int,input().split())) mod=10**9+7 ans=1 rgb=[0]*3 for i in range(n): f=0 for j in range(3): if l[i]==rgb[j]: if f==0: rgb[j]+=1 f+=1 ans*=f ans%=mod print(ans)
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
651,236
651,237
u223904637
python
p02845
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
[ "assignment.value.change", "identifier.replace.remove", "literal.replace.add" ]
651,240
651,241
u044220565
python
p02845
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
[ "assignment.add" ]
651,242
651,241
u044220565
python
p02845
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
[ "assignment.value.change" ]
651,243
651,241
u044220565
python
p02845
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
[ "assignment.value.change" ]
651,244
651,241
u044220565
python
p02845
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
[ "assignment.value.change" ]
651,243
651,246
u044220565
python
p02845
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
[ "assignment.value.change" ]
651,244
651,246
u044220565
python
p02845
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) import math #from itertools import product, accumulate, combinations, product #import bisect #...
[ "assignment.value.change" ]
651,245
651,246
u044220565
python
p02845
N=int(input()) A=list(map(int, input().split())) mod=10**9+7 if A[0]!=0: print(0) break L=[1,0,0] ans=3 for i in range(1,N): a=A[i] count=0 add=True for j,l in enumerate(L): if a==l: count+=1 if add: L[j]+=1 add=False ans*=coun...
N=int(input()) A=list(map(int, input().split())) mod=10**9+7 if A[0]!=0: print(0) exit() L=[1,0,0] ans=3 for i in range(1,N): a=A[i] count=0 add=True for j,l in enumerate(L): if a==l: count+=1 if add: L[j]+=1 add=False ans*=cou...
[ "control_flow.break.remove", "control_flow.exit.add", "call.add" ]
651,249
651,250
u784022244
python
p02845
n=int(input()) a=list(map(int,input().split())) a_=max(a) con=[0]*(a_+1) tou=[0]*(a_+1) ans=[] for i in range(len(a)): u=a[i] if u==0: con[0]+=1 tou[0]+=1 ans.append(4-con[0]) else: con[u]+=1 tou[u]+=1 ans.append(min(tou[u-1]-con[u]+1,4-con[u])) c=1 for i ...
n=int(input()) a=list(map(int,input().split())) a_=max(a) con=[0]*(a_+1) tou=[0]*(a_+1) ans=[] for i in range(len(a)): u=a[i] if u==0: con[0]+=1 tou[0]+=1 ans.append(4-con[0]) else: con[u]+=1 tou[u]+=1 ans.append(min(tou[u-1]-con[u]+1,4-con[u])) c=1 for i ...
[ "call.remove" ]
651,264
651,265
u428199834
python
p02845
def read_int(): return int(input().strip()) def read_ints(): return list(map(int, input().strip().split(' '))) def solve(): """ """ N = read_int() A = read_ints() T = [0, 0, 0] answer = 1 modulo = 1000000007 for a in A: if a not in T: return -1 a...
def read_int(): return int(input().strip()) def read_ints(): return list(map(int, input().strip().split(' '))) def solve(): """ """ N = read_int() A = read_ints() T = [0, 0, 0] answer = 1 modulo = 1000000007 for a in A: if a not in T: return 0 an...
[ "function.return_value.change", "expression.operation.unary.remove" ]
651,283
651,284
u309716323
python
p02845
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 itemgetter...
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby from operator import itemgetter...
[ "call.remove" ]
651,301
651,302
u285891772
python
p02845
N = int(input()) A = list(map(int,input().split())) C = [0,0,0] Ans = 1 MOD = 1000000007 for a in A: ask = C.count(a) if ask==0: Ans=0 break ind = C.index(a) C[ind] += 1 Ans = (Ans*ask)%MOD print(C) print(Ans)
N = int(input()) A = list(map(int,input().split())) C = [0,0,0] Ans = 1 MOD = 1000000007 for a in A: ask = C.count(a) if ask==0: Ans=0 break ind = C.index(a) C[ind] += 1 Ans = (Ans*ask)%MOD print(Ans)
[ "call.remove" ]
651,309
651,310
u665873062
python
p02845
N = int(input()) A = list(map(int,input().split())) C = [0,0,0] Ans = 1 MOD = 1000000007 for a in A: ask = C.count(a) if ask == 0: break ind = C.index(a) C[ind] += 1 Ans = (Ans*ask)%MOD print(Ans)
N = int(input()) A = list(map(int,input().split())) C = [0,0,0] Ans = 1 MOD = 1000000007 for a in A: ask = C.count(a) if ask==0: Ans=0 break ind = C.index(a) C[ind] += 1 Ans = (Ans*ask)%MOD print(Ans)
[ "assignment.add" ]
651,311
651,310
u665873062
python
p02845
N = int(input()) A = list(map(int,input().split())) C = [0,0,0] Ans = 1 MOD = 1000000007 for a in A: ask = C.count(a) if ask == 0: continue ind = C.index(a) C[ind] += 1 Ans = (Ans*ask)%MOD print(Ans)
N = int(input()) A = list(map(int,input().split())) C = [0,0,0] Ans = 1 MOD = 1000000007 for a in A: ask = C.count(a) if ask==0: Ans=0 break ind = C.index(a) C[ind] += 1 Ans = (Ans*ask)%MOD print(Ans)
[ "assignment.variable.change", "control_flow.break.add" ]
651,312
651,310
u665873062
python
p02845
N = int(input()) As = list(map(int, input().split())) mod = 10**9+7 dp = [[0]*3 for _ in range(N+1)] ans = 1 for i in range(N): a = As[i] dplis = dp[i] cnt = 0 dp[i+1] = dplis[:] for j, d in enumerate(dplis): if a==d: cnt += 1 if cnt==1: dp[i+1][j] = ...
N = int(input()) As = list(map(int, input().split())) mod = 10**9+7 dp = [[0]*3 for _ in range(N+1)] ans = 1 for i in range(N): a = As[i] dplis = dp[i] cnt = 0 dp[i+1] = dplis[:] for j, d in enumerate(dplis): if a==d: cnt += 1 if cnt==1: dp[i+1][j] = ...
[]
651,332
651,333
u054514819
python
p02845
N=int(input()) A=list(map(int,input().split())) p=1000000007 R=[0] G=[0] B=[0] #print(A) ans=1 for i in range(N): if A[i]==R[-1]: tmp+=1 if A[i]==G[-1]: tmp+=1 if A[i]==B[-1]: tmp+=1 ans = (ans*tmp)%p if A[i]==R[-1]: R.append(R[-1]+1) G.append(G[-1]) ...
N=int(input()) A=list(map(int,input().split())) p=1000000007 R=[0] G=[0] B=[0] #print(A) ans=1 for i in range(N): tmp=0 if A[i]==R[-1]: tmp+=1 if A[i]==G[-1]: tmp+=1 if A[i]==B[-1]: tmp+=1 ans = (ans*tmp)%p if A[i]==R[-1]: R.append(R[-1]+1) G.append(G[...
[ "assignment.add", "assignment.remove" ]
651,337
651,338
u089142196
python
p02845
n = int(input()) a = list(map(int,input().split())) ans = 1 p = [0,0,0] mod = 10**9+7 for i in range(n-1): q = 0 for j in range(3): if p[j] == a[i]: q +=1 for k in range(3): if p[k] == a[i]: p[k] += 1 break ans = ans*q%mod print(ans%mod)
n = int(input()) a = list(map(int,input().split())) ans = 1 p = [0,0,0] mod = 10**9+7 for i in range(n): q = 0 for j in range(3): if p[j] == a[i]: q +=1 for k in range(3): if p[k] == a[i]: p[k] += 1 break ans = ans*q%mod print(ans%mod)
[ "expression.operation.binary.remove" ]
651,341
651,342
u342563578
python
p02845
N=int(input()) A=list(map(int,input().split())) l=[[] for _ in range(3)] ans=1 p=10**9+7 flag=1 for i in range(N): cnt=0 piv=A[i] ind=[] for j in range(3): if l[j]==piv: cnt=cnt+1 ind.append(j) if len(ind)==0: flag=0 break l[ind[0]].append(piv) ...
N=int(input()) A=list(map(int,input().split())) l=[[] for _ in range(3)] ans=1 p=10**9+7 flag=1 for i in range(N): cnt=0 piv=A[i] ind=[] for j in range(3): if len(l[j])==piv: cnt=cnt+1 ind.append(j) if len(ind)==0: flag=0 break l[ind[0]].append(piv...
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "call.add" ]
651,343
651,344
u995004106
python
p02845
import sys n=int(input()) a=list(map(int,input().split())) if a[0]!=0: print(0) sys.exit() mod=10**9+7 acnt=dict() acnt[a[0]]=1 acntkeymax=0 t=3 for i in range(1,n): if a[i] in acnt: acnt[a[i]]+=1 if acnt[a[i]]>3: print(0) sys.exit() else: if acntkeym...
import sys n=int(input()) a=list(map(int,input().split())) #n=54 #a=[0,0,1,0,1,2,1,2,3,2,3,3,4,4,5,4,6,5,7,8, # 5,6,6,7,7,8,8,9,9,10,10,11,9,12,10,13,14, # 11,11,12,12,13,13,14,14,15,15,15,16,16,16, # 17,17,17] #ans=115295190 #n=10 #a=[3,2,5,1,7,3,6,4,5,4] #ans=0 if a[0]!=0: print(0) sys.exit() mod...
[ "control_flow.branch.if.replace.remove", "control_flow.branch.else_if.replace.add", "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
651,353
651,354
u576432509
python
p02844
#import math #import bisect #import numpy as np #import itertools import sys input = sys.stdin.readline MOD = 10**9 + 7 INF = float('INF') sys.setrecursionlimit(10**5) def main(): n = int(input()) s = input() ans = 0 pin = list(itertools.product(range(10), repeat=3)) for cur in pin: a, b, ...
#import math #import bisect #import numpy as np import itertools import sys input = sys.stdin.readline MOD = 10**9 + 7 INF = float('INF') sys.setrecursionlimit(10**5) def main(): n = int(input()) s = input() ans = 0 pin = list(itertools.product(range(10), repeat=3)) for cur in pin: a, b, c...
[]
651,397
651,398
u261103969
python
p02844
def ok(target, S): for t in target: if t in S: S = S[S.index(t)+1:] else: return False print(target) return True N = int(input()) S = input() ans = 0 for i in range(0, 999+1): target = str(i).zfill(3) ans += ok(target, S) print(ans)
def ok(target, S): for t in target: if t in S: S = S[S.index(t)+1:] else: return False return True N = int(input()) S = input() ans = 0 for i in range(0, 999+1): target = str(i).zfill(3) ans += ok(target, S) print(ans)
[ "call.remove" ]
651,401
651,402
u735008991
python
p02844
n=int(input()) s=input() ans=0 fi=lambda x,y:x.find(str(y)) for i in range(10): f1=fi(s,i) if f1==-1: continue s1=s[f1+1:] for j in range(10): f2=fi(s1,j) if f2==-1: continue s2=s1[f2+1:] for k in range(10): f3=fi(s2,k) if f3>0: ans+=1 print(ans)
n=int(input()) s=input() ans=0 fi=lambda x,y:x.find(str(y)) for i in range(10): f1=fi(s,i) if f1==-1: continue s1=s[f1+1:] for j in range(10): f2=fi(s1,j) if f2==-1: continue s2=s1[f2+1:] for k in range(10): f3=fi(s2,k) if f3>=0: ans+=1 print(ans)
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
651,407
651,408
u762540523
python
p02844
n=int(input()) s=input() ans=0 fi=lambda x,y:x.find(str(y)) for i in range(10): f1=fi(s,i) if f1==-1: continue s1=s[f1+1:] for j in range(10): f2=fi(s1,j) if f2==-1: continue s2=s1[f2+1:] for k in range(10): f3=fi(s1,k) if f3>0: ans+=1 print(ans)
n=int(input()) s=input() ans=0 fi=lambda x,y:x.find(str(y)) for i in range(10): f1=fi(s,i) if f1==-1: continue s1=s[f1+1:] for j in range(10): f2=fi(s1,j) if f2==-1: continue s2=s1[f2+1:] for k in range(10): f3=fi(s2,k) if f3>=0: ans+=1 print(ans)
[ "assignment.value.change", "identifier.change", "call.arguments.change", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
651,409
651,408
u762540523
python
p02844
n = int(input()) s = input() sum = 0 box = [] for i in range(n-2): if s[i] not in box: box.append(s[i]) elif len(box) == 10: break else: continue box_1 = [] for j in range(i+1, n-1): if s[j] not in box_1: box_1.append(s[j]) elif len(box_1) == 10:...
n = int(input()) s = input() sum = 0 box = [] for i in range(n-2): if s[i] not in box: box.append(s[i]) elif len(box) == 10: break else: continue box_1 = [] for j in range(i+1, n-1): if s[j] not in box_1: box_1.append(s[j]) elif len(box_1) == 10: ...
[]
651,410
651,411
u768896740
python
p02844
n = int(input()) s = input() res = 0 lst = [[] for _ in range(10)] for i in range(n): lst[int(s[i])].append(i) done = [] cnt = 0 for i in range(1000): tmp = str(i).rjust(3, '0') n1,n2,n3 = int(tmp[0]), int(tmp[1]), int(tmp[2]) mi = -1 mx = -1 if len(lst[n1])!=0: mi = lst[n1][0] if...
n = int(input()) s = input() res = 0 lst = [[] for _ in range(10)] for i in range(n): lst[int(s[i])].append(i) done = [] cnt = 0 for i in range(1000): tmp = str(i).rjust(3, '0') n1,n2,n3 = int(tmp[0]), int(tmp[1]), int(tmp[2]) mi = -1 mx = -1 if len(lst[n1])!=0: mi = lst[n1][0] if ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
651,420
651,421
u672475305
python
p02844
n=int(input()) s=input() t=0 for i in range(10): for a in range(n): if s[a]==str(i): for j in range(10): for b in range(a+1,n-1)[::-1]: if s[b]==str(j): t+=len(set(list(s[a+1:b]))) print(t)
n=int(input()) s=input() t=0 for i in range(10): for a in range(n): if s[a]==str(i): for j in range(10): for b in range(a+1,n)[::-1]: if s[b]==str(j): t+=len(set(list(s[a+1:b]))) break break print(t)
[ "expression.operation.binary.remove", "control_flow.break.add" ]
651,424
651,425
u539517139
python
p02845
n = int(input()) a = list(map(int, input().split())) que = [-1, -1, -1] ans = 1 for i in range(n): if que[0]+1 == a[i]: if que[0] == que[1] and que[0] == que[2]: ans *= 3 ans %= (10**9 + 7) elif que[0] == que[1]: ans *= 2 ans %= (10**9 + 7) que[0] = a[i] elif que[1]+1 == a[i]: ...
n = int(input()) a = list(map(int, input().split())) que = [-1, -1, -1] ans = 1 for i in range(n): if que[0]+1 == a[i]: if que[0] == que[1] and que[0] == que[2]: ans *= 3 ans %= (10**9 + 7) elif que[0] == que[1]: ans *= 2 ans %= (10**9 + 7) que[0] = a[i] elif que[1]+1 == a[i]: ...
[ "control_flow.break.add" ]
651,437
651,438
u408375121
python
p02845
n = int(input()) a = list(map(int,input().split())) mod = 1000000007 ans = 1 l = [] for i in range(n): if a[i] == 0: l.append(0) ans = ans*(4-len(l))%mod else: id = -1 count = 0 for j in range(len(l)): if l[j] == a[i] - 1: count += 1 id = j if id == -1: break ...
n = int(input()) a = list(map(int,input().split())) mod = 1000000007 ans = 1 l = [] for i in range(n): if a[i] == 0: l.append(0) ans = ans*(4-len(l))%mod else: id = -1 count = 0 for j in range(len(l)): if l[j] == a[i] - 1: count += 1 id = j if id == -1: ans = 0 ...
[ "assignment.add" ]
651,441
651,442
u535236942
python
p02845
N = int(input()) A = list(map(int, input().split())) MOD = 10**9+7 ans = 1 dp = [0]*3 for a in A: ans = ans*dp.count(a) % MOD dp[dp.index(a)] += 1 print(ans)
N = int(input()) A = list(map(int, input().split())) MOD = 10**9+7 ans = 1 dp = [0]*3 for a in A: ans = ans*dp.count(a) % MOD try: dp[dp.index(a)] += 1 except ValueError: break print(ans)
[ "control_flow.break.add" ]
651,453
651,454
u375616706
python
p02845
import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) A=[int(i) for i in input().split()] ans=1 mod=10**9+7 C=[0,0,0] for i in range(1,n): cur=A[i] ct=0 Chk=True for i,c in enumerate(C): if cur==c: ct+=1 if Chk: C[i]+=1 Chk=False ans=(ans*ct)%mod print(ans)
import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) A=[int(i) for i in input().split()] ans=1 mod=10**9+7 C=[0,0,0] for i in range(n): cur=A[i] ct=0 Chk=True for i,c in enumerate(C): if cur==c: ct+=1 if Chk: C[i]+=1 Chk=False ans=(ans*ct)%mod print(ans)
[ "call.arguments.change" ]
651,457
651,458
u969190727
python
p02845
n = int(input()) a = list(map(int, input().split())) from collections import defaultdict d = defaultdict(int) ans=1 for num in a: if num==0: last_cnt=3 tmp = last_cnt - d[num] else: last_cnt=d[num-1] tmp = last_cnt - d[num] if tmp == 0: tmp=1 ans*=tmp ...
n = int(input()) a = list(map(int, input().split())) from collections import defaultdict d = defaultdict(int) ans=1 for num in a: if num==0: last_cnt=3 tmp = last_cnt - d[num] else: last_cnt=d[num-1] tmp = last_cnt - d[num] if tmp == 0: # tmp=1 an...
[ "assignment.variable.change", "identifier.change", "literal.number.integer.change", "assignment.value.change" ]
651,477
651,478
u358254559
python
p02845
n = int(input()) a = list(map(int, input().split())) from collections import defaultdict d = defaultdict(int) ans=1 for num in a: if num==0: last_cnt=3 tmp = last_cnt - d[num] else: last_cnt=d[num-1] tmp = last_cnt - d[num] if tmp == 0: tmp=1 ans*=tmp ans%=1...
n = int(input()) a = list(map(int, input().split())) from collections import defaultdict d = defaultdict(int) ans=1 for num in a: if num==0: last_cnt=3 tmp = last_cnt - d[num] else: last_cnt=d[num-1] tmp = last_cnt - d[num] if tmp == 0: # tmp=1 an...
[ "assignment.variable.change", "identifier.change", "literal.number.integer.change", "assignment.value.change" ]
651,479
651,478
u358254559
python
p02845
n = int(input()) a = list(map(int, input().split())) from collections import defaultdict d = defaultdict(int) ans=1 for num in a: if num==0: last_cnt=3 else: last_cnt=d[num-1] tmp = last_cnt - d[num] if tmp <= 0: tmp=1 ans*=tmp ans%=1000000007 d[num]+=1 print(ans)
n = int(input()) a = list(map(int, input().split())) from collections import defaultdict d = defaultdict(int) ans=1 for num in a: if num==0: last_cnt=3 else: last_cnt=d[num-1] tmp = last_cnt - d[num] if tmp < 0: tmp=1 ans*=tmp ans%=1000000007 d[num]+=1 print(ans)
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
651,480
651,481
u358254559
python
p02845
n = int(input()) a = list(map(int, input().split())) from collections import defaultdict d = defaultdict(int) ans=1 for num in a: if num==0: ans*= (3 - d[0]) else: ans*= (d[num-1] - d[num]) ans*=tmp ans%=1000000007 d[num]+=1 print(ans)
n = int(input()) a = list(map(int, input().split())) from collections import defaultdict d = defaultdict(int) ans=1 for num in a: if num==0: ans*= (3 - d[0]) else: ans*= (d[num-1] - d[num]) ans%=1000000007 d[num]+=1 print(ans)
[]
651,482
651,483
u358254559
python
p02845
N = int(input()) A = list(map(int, input().split())) C = [0, 0, 0] # 同じ帽子をかぶっている人数 降順 B = 10 ** 9 + 7 ans = 1 for i in range(N): if A[i] in C: ans *= C.count(A[i]) C[C.index(A[i])] += 1 print(ans % B)
N = int(input()) A = list(map(int, input().split())) C = [0, 0, 0] # 同じ帽子をかぶっている人数 降順 B = 10 ** 9 + 7 ans = 1 for i in range(N): if A[i] in C: ans *= C.count(A[i]) C[C.index(A[i])] += 1 else: ans = 0 break print(ans % B)
[ "control_flow.break.add" ]
651,488
651,489
u389122588
python
p02845
N = int(input()) A = list(map(int,input().split())) MOD = 1000000007 #色ごとの人数 C=[0,0,0] ans=1 for a in A: #人数が一致する色がなければOUT found=False count=C.count(a) if count==0: print(0) exit() #適当に1人足す C[C.index(a)]+=1 #今見ている人の色の可能性はcount種類 ans=ans*count%MOD print(count) print...
N = int(input()) A = list(map(int,input().split())) MOD = 1000000007 #色ごとの人数 C=[0,0,0] ans=1 for a in A: #人数が一致する色がなければOUT found=False count=C.count(a) if count==0: print(0) exit() #適当に1人足す C[C.index(a)]+=1 #今見ている人の色の可能性はcount種類 ans=ans*count%MOD print(ans)
[ "call.remove" ]
651,490
651,491
u852690916
python
p02845
N=int(input()) A=[int(i) for i in input().split()] X=[-1,-1,-1] ans=1 mod=10**9+7 for i in range(N): tmp=0 if A[i]>i: ans=0 for j in range(3): if X[j]==A[i]-1: tmp+=1 for j in range(3): if X[j]==A[i]-1: ans=tmp*ans ans%=mod X[j]+=1 ...
N=int(input()) A=[int(i) for i in input().split()] X=[-1,-1,-1] ans=1 mod=10**9+7 for i in range(N): tmp=0 if A[i]>i: ans=0 for j in range(3): if X[j]==A[i]-1: tmp+=1 for j in range(3): if X[j]==A[i]-1 or tmp==0: ans=tmp*ans ans%=mod ...
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
651,494
651,495
u562016607
python
p02845
def examE(mod): N = I() A = LI() a =[0,0,0] cur = 1 for i in A: if a[0]==i: if a[0]==a[1]: if a[1]==a[2]: cur *= 3 else: cur *=2 a[0]+=1 elif a[1]==i: if a[1] == a[2]: ...
def examE(mod): N = I() A = LI() a =[0,0,0] cur = 1 for i in A: if a[0]==i: if a[0]==a[1]: if a[1]==a[2]: cur *= 3 else: cur *=2 a[0]+=1 elif a[1]==i: if a[1] == a[2]: ...
[ "call.arguments.change" ]
651,565
651,566
u638795007
python
p02845
MOD = 10**9+7 N = int(input()) count = [0] * 3 ans = 1 A = [int(x) for x in input().split()] for i in range(N): sames = 0 for j in range(3): if A[i] == count[j]: sames += 1 if sames == 0: break ans *= sames ans %= MOD for j in range(3): if A[i] == count[...
MOD = 10**9+7 N = int(input()) count = [0] * 3 ans = 1 A = [int(x) for x in input().split()] for i in range(N): sames = 0 for j in range(3): if A[i] == count[j]: sames += 1 if sames == 0: ans = 0 break ans *= sames ans %= MOD for j in range(3): i...
[ "assignment.add" ]
651,622
651,623
u118642796
python
p02845
MOD = 10**9+7 N = int(input()) count = [0] * 3 ans = 1 A = [int(x) for x in input().split()] for i in range(N): sames = 0 for j in range(3): if A[i] == count[j]: sames += 1 if sames == 0: print(0) break ans *= sames ans %= MOD for j in range(3): ...
MOD = 10**9+7 N = int(input()) count = [0] * 3 ans = 1 A = [int(x) for x in input().split()] for i in range(N): sames = 0 for j in range(3): if A[i] == count[j]: sames += 1 if sames == 0: ans = 0 break ans *= sames ans %= MOD for j in range(3): i...
[ "call.arguments.change" ]
651,624
651,623
u118642796
python
p02845
N = int(input()) A = list(map(int, input().split())) mod = 10**9+7 cnt = [0] * (max(A) + 2) cnt[-1] = 1 ans = 1 for a in A: if a == 0: cnt[0] += 1 continue ans = (ans * (cnt[a - 1] - cnt[a])) % mod cnt[a] += 1 if max(cnt) == 1: print((ans*3) % mod) elif max(cnt) == 3: print((ans * ...
N = int(input()) A = list(map(int, input().split())) mod = 10**9+7 cnt = [0] * (max(A) + 2) cnt[-1] = 1 ans = 1 for a in A: if a == 0: cnt[0] += 1 continue ans = (ans * (cnt[a - 1] - cnt[a])) % mod cnt[a] += 1 if max(cnt) == 1: print((ans*3) % mod) elif max(cnt) == 3: print((ans * ...
[ "literal.number.integer.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
651,643
651,644
u892251744
python
p02846
T1, T2=(int(i) for i in input().split()) A1, A2=(int(i) for i in input().split()) B1, B2=(int(i) for i in input().split()) if T1*A1+T2*A2==T1*B1+T2*B2: print("infinity") elif ((A1>B1) & (T1*A1+T2*A2-(T1*B1+T2*B2)>0)) or ((A1<B1) & (T1*A1+T2*A2-(T1*B1+T2*B2)<0)): print(0) else: d=T1*A1+T2*A2-(T1*B1+T2*B2)#T...
T1, T2=(int(i) for i in input().split()) A1, A2=(int(i) for i in input().split()) B1, B2=(int(i) for i in input().split()) if T1*A1+T2*A2==T1*B1+T2*B2: print("infinity") elif ((A1>B1) & (T1*A1+T2*A2-(T1*B1+T2*B2)>0)) or ((A1<B1) & (T1*A1+T2*A2-(T1*B1+T2*B2)<0)): print(0) else: d=abs(T1*A1+T2*A2-(T1*B1+T2*B...
[ "call.add", "call.arguments.change" ]
651,666
651,667
u069172538
python
p02846
T1, T2=(int(i) for i in input().split()) A1, A2=(int(i) for i in input().split()) B1, B2=(int(i) for i in input().split()) if T1*A1+T2*A2==T1*B1+T2*B2: print("infinity") elif ((A1>B1) & (T1*A1+T2*A2-(T1*B1+T2*B2)>0)) or ((A1<B1) & (T1*A1+T2*A2-(T1*B1+T2*B2)<0)): print(0) else: d=T1*A1+T2*A2-(T1*B1+T2*B2)#T...
T1, T2=(int(i) for i in input().split()) A1, A2=(int(i) for i in input().split()) B1, B2=(int(i) for i in input().split()) if T1*A1+T2*A2==T1*B1+T2*B2: print("infinity") elif ((A1>B1) & (T1*A1+T2*A2-(T1*B1+T2*B2)>0)) or ((A1<B1) & (T1*A1+T2*A2-(T1*B1+T2*B2)<0)): print(0) else: d=abs(T1*A1+T2*A2-(T1*B1+T2*B...
[ "call.add", "call.arguments.change" ]
651,668
651,667
u069172538
python
p02846
T1,T2=[int(i) for i in input().split()] A1,A2=[int(i) for i in input().split()] B1,B2=[int(i) for i in input().split()] if((B1-A1)*((B1-A1)*T1+(B2-A2)*T2)>0): print(0); exit(); if((B1-A1)*T1+(B2-A2)*T2==0): print("infinity") exit(); ans=(abs((B1-A1)*T1)/abs((B1-A1)*T1+(B2-A2)*T2))*2+1 if(abs((B1-A1)*T1)%abs((B...
T1,T2=[int(i) for i in input().split()] A1,A2=[int(i) for i in input().split()] B1,B2=[int(i) for i in input().split()] if((B1-A1)*((B1-A1)*T1+(B2-A2)*T2)>0): print(0); exit(); if((B1-A1)*T1+(B2-A2)*T2==0): print("infinity") exit(); ans=(abs((B1-A1)*T1)//abs((B1-A1)*T1+(B2-A2)*T2))*2+1 if(abs((B1-A1)*T1)%abs((B...
[ "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "call.remove", "call.arguments.change" ]
651,687
651,688
u236193715
python
p02846
from decimal import Decimal T = tuple(map(Decimal, input().split())) A = list(map(Decimal, input().split())) B = list(map(Decimal, input().split())) ans = 0 if A[0] < B[0]: tmp = (A[0], A[1]) A[0], A[1] = B[0], B[1] B[0], B[1] = tmp[0], tmp[1] a = abs(T[0]*A[0] - T[0]*B[0]) b = T[0]*(B[0]-A[0])+T[1]*(B...
from decimal import Decimal T = tuple(map(Decimal, input().split())) A = list(map(Decimal, input().split())) B = list(map(Decimal, input().split())) ans = 0 if A[0] < B[0]: tmp = (A[0], A[1]) A[0], A[1] = B[0], B[1] B[0], B[1] = tmp[0], tmp[1] a = abs(T[0]*A[0] - T[0]*B[0]) b = T[0]*(B[0]-A[0])+T[1]*(B...
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
651,699
651,700
u814986259
python
p02846
from math import floor t1, t2 = map(int, input().split()) a1, a2 = map(int, input().split()) b1, b2 = map(int, input().split()) diff1 = (a1 - b1) * t1 diff2 = (a2 - b2) * t2 diff = diff1 + diff2 if diff1 * diff > 0: print("0") elif diff == 0: print("infinity") else: diff1 = abs(diff1) diff2 = abs(d...
from math import floor t1, t2 = map(int, input().split()) a1, a2 = map(int, input().split()) b1, b2 = map(int, input().split()) diff1 = (a1 - b1) * t1 diff2 = (a2 - b2) * t2 diff = diff1 + diff2 if diff1 * diff > 0: print("0") elif diff == 0: print("infinity") else: diff1 = abs(diff1) diff2 = abs(d...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
651,704
651,705
u893063840
python
p02846
#F t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) l1 = (a1-b1)*t1 l2 = (a2-b2)*t2 if (l1+l2)==0: print('infinity') elif (l1>0)*(l1+l2)>0: print(0) else: zure = abs(l1+l2) oitsuki = abs(l1) n = oitsuki//zure if n * zure == oitsuki: ...
#F t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) l1 = (a1-b1)*t1 l2 = (a2-b2)*t2 if (l1+l2)==0: print('infinity') elif (l1)*(l1+l2)>0: print(0) else: zure = abs(l1+l2) oitsuki = abs(l1) n = oitsuki//zure if n * zure == oitsuki: p...
[]
651,725
651,726
u602544363
python
p02846
#%% t1, t2 = map(int, input().split()) a1, a2 = map(int, input().split()) b1, b2 = map(int, input().split()) x = (a1-b1) * t1 y = x + (a2-b2) * t2 #print(x, y) def p(x, y): if x%y == 0: return abs(x//y) else: return abs(x//y) + 1 if y == 0: ans = 'infinity' else: if x%y != 0: ...
#%% t1, t2 = map(int, input().split()) a1, a2 = map(int, input().split()) b1, b2 = map(int, input().split()) x = (a1-b1) * t1 y = x + (a2-b2) * t2 #print(x, y) def p(x, y): if x%y == 0: return abs(x//y) else: return abs(x//y) + 1 if y == 0: ans = 'infinity' else: if x%y != 0: ...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
651,741
651,742
u921773161
python
p02846
t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) import math f = (a1-b1)*t1 s = (a2-b2)*t2 if f == -s: print("infinity") elif (f>0 and s>0) or (f<0 and s<0): print(0) elif f//(-(f+s)) == math.ceil(f/(-(f+s))): print(f//(-(f+s))*2) else: print(f//(-(f+s))*2+1)
t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) import math f = (a1-b1)*t1 s = (a2-b2)*t2 if f == -s: print("infinity") elif (f>0 and f+s>0) or (f<0 and f+s<0): print(0) elif f//(-(f+s)) == math.ceil(f/(-(f+s))): print(f//(-(f+s))*2) else: print(f//(-(f+s))*2+1...
[ "control_flow.branch.if.condition.change" ]
651,773
651,774
u881116515
python
p02846
t1,t2=map(int, input().split()) a1,a2=map(int, input().split()) b1,b2=map(int, input().split()) a1*=t1 a2*=t2 b1*=t1 b2*=t2 if a1<b1: a1,a2,b1,b2=b1,b2,a1,a2 #a1>b2 if a1+a2==b1+b2: print('infinity') exit() a1-=b1;b2-=a2 b2-=a1 if b2<0: print(0) exit() ans=1+(a1//b2)*2 if a1%b2==0: ans+=1 prin...
t1,t2=map(int, input().split()) a1,a2=map(int, input().split()) b1,b2=map(int, input().split()) a1*=t1 a2*=t2 b1*=t1 b2*=t2 if a1<b1: a1,a2,b1,b2=b1,b2,a1,a2 #a1>b2 if a1+a2==b1+b2: print('infinity') exit() a1-=b1;b2-=a2 b2-=a1 if b2<0: print(0) exit() ans=1+(a1//b2)*2 if a1%b2==0: ans-=1####...
[ "expression.operator.change" ]
651,798
651,799
u520276780
python
p02846
t1,t2=map(int, input().split()) a1,a2=map(int, input().split()) b1,b2=map(int, input().split()) a1*=t1 a2*=t2 b1*=t1 b2*=t2 if a1<b1: a1,a2,b1,b2=b1,b2,a1,a2 #a1>b2 if a1+a2==b1+b2: print('infinity') exit() a1-=b1;b2-=a2 b2-=a1 if b2<0: print(1) exit() ans=1+(a1//b2)*2 if a1%b2==0: ans+=1 prin...
t1,t2=map(int, input().split()) a1,a2=map(int, input().split()) b1,b2=map(int, input().split()) a1*=t1 a2*=t2 b1*=t1 b2*=t2 if a1<b1: a1,a2,b1,b2=b1,b2,a1,a2 #a1>b2 if a1+a2==b1+b2: print('infinity') exit() a1-=b1;b2-=a2 b2-=a1 if b2<0: print(0) exit() ans=1+(a1//b2)*2 if a1%b2==0: ans-=1####...
[ "literal.number.integer.change", "call.arguments.change", "io.output.change", "expression.operator.change" ]
651,800
651,799
u520276780
python
p02846
t1, t2 = map(int, input().split()) a1, a2 = map(int, input().split()) b1, b2 = map(int, input().split()) ave_a, ave_b = t1 * a1 + t2 * a2, t1 * b1 + t2 * b2 if ave_a < ave_b: a1, a2, b1, b2 = b1, b2, a1, a2 ave_a, ave_b = ave_b, ave_a if ave_a == ave_b: print('infinity') exit() first, second = t1 * (...
t1, t2 = map(int, input().split()) a1, a2 = map(int, input().split()) b1, b2 = map(int, input().split()) ave_a, ave_b = t1 * a1 + t2 * a2, t1 * b1 + t2 * b2 if ave_a < ave_b: a1, a2, b1, b2 = b1, b2, a1, a2 ave_a, ave_b = ave_b, ave_a if ave_a == ave_b: print('infinity') exit() first, second = t1 * (...
[ "call.add", "call.arguments.change" ]
651,809
651,810
u222668979
python
p02846
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 itemgetter...
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby from operator import itemgetter...
[ "control_flow.branch.if.replace.remove", "control_flow.branch.else_if.replace.add" ]
651,811
651,812
u285891772
python
p02846
t1, t2 = map(int, input().split()) a1, a2 = map(int, input().split()) b1, b2 = map(int, input().split()) d1 = t1 * (a1 - b1) d2 = t2 * (a2 - b2) if d1 > 0: d1 *= -1 d2 *= -1 if d1 + d2 == 0: print("infinity") elif d1 + d2 < 0: print(0) else: cnt = -d1 // (d1 + d2) t = -d1 % (d1 + d2) ans...
t1, t2 = map(int, input().split()) a1, a2 = map(int, input().split()) b1, b2 = map(int, input().split()) d1 = t1 * (a1 - b1) d2 = t2 * (a2 - b2) if d1 > 0: d1 *= -1 d2 *= -1 if d1 + d2 == 0: print("infinity") elif d1 + d2 < 0: print(0) else: cnt = -d1 // (d1 + d2) t = -d1 % (d1 + d2) ans...
[ "expression.operation.binary.remove", "misc.opposites", "expression.operator.compare.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
651,825
651,826
u057109575
python
p02846
T1, T2 = list(map(int, input().split())) A1, A2 = list(map(int, input().split())) B1, B2 = list(map(int, input().split())) L1 = T1 * (A1- B1) L2 = L1 + T2 * (A2- B2) if L1 * L2 > 0: print(0) elif L2 == 0: print("infinity") else: M = (-L1) / L2 ans = 2 * M + 1 if float(int(M)) == M: ans -...
T1, T2 = list(map(int, input().split())) A1, A2 = list(map(int, input().split())) B1, B2 = list(map(int, input().split())) L1 = T1 * (A1- B1) L2 = L1 + T2 * (A2- B2) if L1 * L2 > 0: print(0) elif L2 == 0: print("infinity") else: M = (-L1) / L2 ans = 2 * int(M) + 1 if float(int(M)) == M: ...
[ "call.add", "call.arguments.change" ]
651,853
651,854
u896004073
python
p02846
''' 自宅用PCでの解答 ''' import math #import numpy as np import itertools import queue import bisect from collections import deque,defaultdict import heapq as hpq from sys import stdin,setrecursionlimit #from scipy.sparse.csgraph import dijkstra #from scipy.sparse import csr_matrix ipt = stdin.readline setrecursionlimit(10**7...
''' 自宅用PCでの解答 ''' import math #import numpy as np import itertools import queue import bisect from collections import deque,defaultdict import heapq as hpq from sys import stdin,setrecursionlimit #from scipy.sparse.csgraph import dijkstra #from scipy.sparse import csr_matrix ipt = stdin.readline setrecursionlimit(10**7...
[ "control_flow.branch.if.condition.change" ]
651,855
651,856
u169350228
python
p02846
import sys sys.setrecursionlimit(10 ** 6) INF = float("inf") MOD = 10 ** 9 + 7 def input(): return sys.stdin.readline().strip() def main(): T1, T2 = map(int, input().split()) A1, A2 = map(int, input().split()) B1, B2 = map(int, input().split()) A = A1 * T1 + A2 * T2 B = B1 * T1 + B2 * T2 ...
import sys sys.setrecursionlimit(10 ** 6) INF = float("inf") MOD = 10 ** 9 + 7 def input(): return sys.stdin.readline().strip() def main(): T1, T2 = map(int, input().split()) A1, A2 = map(int, input().split()) B1, B2 = map(int, input().split()) A = A1 * T1 + A2 * T2 B = B1 * T1 + B2 * T2 ...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
651,869
651,870
u346812984
python
p02846
import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") t1,t2 = map(int, input().split()) a1,a2 = map(int, input().split()) b1,b2 = map(int, input().split()) a1 *= t1 a2 *= t2 b1 *= t1 b2 *= t2 if a1+a2==b1+b2: ans = "infinity"...
import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") t1,t2 = map(int, input().split()) a1,a2 = map(int, input().split()) b1,b2 = map(int, input().split()) a1 *= t1 a2 *= t2 b1 *= t1 b2 *= t2 if a1+a2==b1+b2: ans = "infinity"...
[ "expression.operator.change" ]
651,878
651,879
u535803878
python
p02846
t = list(map(int, input().split())) a = list(map(int, input().split())) b = list(map(int, input().split())) f_a = t[0]*a[0] f_b = t[0]*b[0] if f_a < f_b: x = 1 else: x = -1 s_a = f_a + t[1]*a[1] s_b = f_b + t[1]*b[1] if s_a < s_b: y = 1 else: y = -1 if s_a==s_b: print('infinity') else: if x==...
t = list(map(int, input().split())) a = list(map(int, input().split())) b = list(map(int, input().split())) f_a = t[0]*a[0] f_b = t[0]*b[0] if f_a < f_b: x = 1 else: x = -1 s_a = f_a + t[1]*a[1] s_b = f_b + t[1]*b[1] if s_a < s_b: y = 1 else: y = -1 if s_a==s_b: print('infinity') else: if x==...
[ "expression.operation.binary.remove", "misc.opposites", "expression.operator.compare.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
651,889
651,890
u413165887
python
p02846
import sys input = sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 T=LI() A=LI() B=LI() SA=T[1]*A[1]+T[0]*A[0] SB=T[1]*B[1]+T[0]*B[0] if SA == SB: print("in...
import sys input = sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 T=LI() A=LI() B=LI() SA=T[1]*A[1]+T[0]*A[0] SB=T[1]*B[1]+T[0]*B[0] if SA == SB: print("in...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "expression.operation.binary.remove" ]
651,911
651,912
u498487134
python
p02846
import sys input = sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 T=LI() A=LI() B=LI() d1=(A[0]-B[0])*T[0] d2=(A[1]-B[1])*T[1] if d1>=0: #最初は必ず正の方向へいか...
import sys input = sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 T=LI() A=LI() B=LI() d1=(A[0]-B[0])*T[0] d2=(A[1]-B[1])*T[1] if d1>=0: #最初は必ず正の方向へいか...
[ "control_flow.branch.if.condition.change", "call.arguments.change" ]
651,913
651,914
u498487134
python
p02846
import numpy as np t1,t2 = map(int, input().split()) a1,a2 = map(int, input().split()) b1,b2 = map(int, input().split()) # まず大きい方にswap if a1 <= b1: a1,b1 = b1,a1 a2,b2 = b2,a2 # t1での距離 x1 = a1*t1 - b1*t1 # t2での距離 x2 = x1 + a2*t2 - b2*t2 if x2 == 0: print("infinity") elif x2 > 0: print(0) else: ans ...
import numpy as np t1,t2 = map(int, input().split()) a1,a2 = map(int, input().split()) b1,b2 = map(int, input().split()) # まず大きい方にswap if a1 <= b1: a1,b1 = b1,a1 a2,b2 = b2,a2 # t1での距離 x1 = a1*t1 - b1*t1 # t2での距離 x2 = x1 + a2*t2 - b2*t2 if x2 == 0: print("infinity") elif x2 > 0: print(0) else: ans ...
[ "expression.operation.binary.remove", "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
651,923
651,924
u545368057
python
p02846
#!usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop import sys import math import bisect import random def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def LS():return [list(x) for x in sys.stdin.readline().split()]...
#!usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop import sys import math import bisect import random def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def LS():return [list(x) for x in sys.stdin.readline().split()]...
[ "expression.operator.change" ]
651,928
651,929
u585482323
python
p02845
_,a=open(0) c=1 d=[3]+[0]*10**6 for a in map(int,a.split()): c=c*d[a]%(10**9+7) d[a]-=1 d[a]+=1 print(c)
_,a=open(0) c=1 d=[3]+[0]*10**6 for a in map(int,a.split()): c=c*d[a]%(10**9+7) d[a]-=1 d[a+1]+=1 print(c)
[ "expression.operation.binary.add" ]
651,950
651,951
u729133443
python
p02845
_,a=open(0) c=1 d=[3]+[0]*10**6 for a in map(int,a.split()): c=c*dp[a]%(10**9+7) d[a]-=1 d[a]+=1 print(c)
_,a=open(0) c=1 d=[3]+[0]*10**6 for a in map(int,a.split()): c=c*d[a]%(10**9+7) d[a]-=1 d[a+1]+=1 print(c)
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change" ]
651,952
651,951
u729133443
python
p02845
import sys input = sys.stdin.readline def main(): mod = 1000000007 N = int(input()) A = list(map(int, input().split())) cnt = [[0, 0, 0] for i in range(N+1)] ans = 1 for i in range(N-1): a = A[i] ans = ans * cnt[i].count(a) % mod for j in range(3): cnt[i+1][...
import sys input = sys.stdin.readline def main(): mod = 1000000007 N = int(input()) A = list(map(int, input().split())) cnt = [[0, 0, 0] for i in range(N+1)] ans = 1 for i in range(N): a = A[i] ans = ans * cnt[i].count(a) % mod for j in range(3): cnt[i+1][j]...
[ "expression.operation.binary.remove" ]
651,990
651,991
u076917070
python
p02845
N = int(input) A = list(map(int, input().split())) L = [0 for i in range(max(A)+2)] ans = 1 L[0] = 3 p = 10 ** 9 + 7 for i in range(N): ai = A[i] ans *= (L[ai] - L[ai + 1]) ans = ans % p L[ai + 1] += 1 print(ans)
N = int(input()) A = list(map(int, input().split())) L = [0 for i in range(max(A)+2)] ans = 1 L[0] = 3 p = 10 ** 9 + 7 for i in range(N): ai = A[i] ans *= (L[ai] - L[ai + 1]) ans = ans % p L[ai + 1] += 1 print(ans)
[ "call.add" ]
651,992
651,993
u729008627
python
p02845
import numpy as np i8 = np.int64 i4 = np.int32 def solve(A, N): MOD = 1000000007 x = 0 y = 0 z = 0 count = 1 for i in range(N): if A[i] == x: if x == y and x == z: count = (count * 3) % MOD elif x == y: count = (count * 2) % MOD ...
import numpy as np i8 = np.int64 i4 = np.int32 def solve(A, N): MOD = 1000000007 x = 0 y = 0 z = 0 count = 1 for i in range(N): if A[i] == x: if x == y and x == z: count = (count * 3) % MOD elif x == y: count = (count * 2) % MOD ...
[ "assignment.remove" ]
651,996
651,997
u326609687
python
p02845
import numpy as np i8 = np.int64 i4 = np.int32 def solve(A, N): MOD = 1000000007 x = 0 y = 0 z = 0 count = 1 for i in range(N): if A[i] == x: if x == y and x == z: count = (count * 3) % MOD elif x == y: count = (count * 2) % MOD ...
import numpy as np i8 = np.int64 i4 = np.int32 def solve(A, N): MOD = 1000000007 x = 0 y = 0 z = 0 count = 1 for i in range(N): if A[i] == x: if x == y and x == z: count = (count * 3) % MOD elif x == y: count = (count * 2) % MOD ...
[ "control_flow.return.add" ]
651,998
651,997
u326609687
python
p02845
N = int(input()) A = list(map(int, input().split())) c = [-1, -1 ,-1] sum = 1 tmp = 0 for a in A: sum = sum * c.count(A-1) % 1000000007 if A-1 == c[0]: c[0] += 1 tmp = c.count(c[0] - 1) + 1 elif A-1 == c[1]: c[1] += 1 tmp = c.count(c[1]-1) + 1 elif A-1 == c[2]: ...
N = int(input()) A = list(map(int, input().split())) c = [-1, -1 ,-1] sum = 1 tmp = 0 for a in A: sum = sum * c.count(a-1) % 1000000007 if a-1 == c[0]: c[0] += 1 tmp = c.count(c[0] - 1) + 1 elif a-1 == c[1]: c[1] += 1 tmp = c.count(c[1]-1) + 1 elif a-1 == c[2]: ...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "expression.operation.binary.change", "control_flow.branch.if.condition.change" ]
652,003
652,004
u759938562
python
p02845
mod=1000000007 N=int(input()) A=list(map(int,input().split())) ans=1 c1=c2=c3=0 for Ai in A: if c1==c2==c3==Ai: c1+=1 ans=ans*3%mod elif c1==c2==Ai: c1+=1 ans=ans*2%mod elif c2==c3==Ai: c2+=1 ans=ans*2%mod elif c1==Ai: c1+=1 elif c2==Ai: ...
mod=1000000007 N=int(input()) A=list(map(int,input().split())) ans=1 c1=c2=c3=0 for Ai in A: if c1==c2==c3==Ai: c1+=1 ans=ans*3%mod elif c1==c2==Ai: c1+=1 ans=ans*2%mod elif c2==c3==Ai: c2+=1 ans=ans*2%mod elif c1==Ai: c1+=1 elif c2==Ai: ...
[ "control_flow.break.add" ]
652,025
652,026
u042802884
python
p02846
"""from collections import * from itertools import * from bisect import * from heapq import * import math from fractions import gcd""" T1,T2=map(int,input().split()) A1,A2=map(int,input().split()) B1,B2=map(int,input().split()) A1*=T1 A2*=T2 B1*=T1 B2*=T2 if A1+A2==B1+B2: print("infinity") else: if A1+A2<B1...
"""from collections import * from itertools import * from bisect import * from heapq import * import math from fractions import gcd""" T1,T2=map(int,input().split()) A1,A2=map(int,input().split()) B1,B2=map(int,input().split()) A1*=T1 A2*=T2 B1*=T1 B2*=T2 if A1+A2==B1+B2: print("infinity") else: if A1+A2<B1...
[ "misc.opposites", "expression.operator.arithmetic.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change", "literal.number.integer.change" ]
652,061
652,062
u779455925
python
p02846
"""from collections import * from itertools import * from bisect import * from heapq import * import math from fractions import gcd""" T1,T2=map(int,input().split()) A1,A2=map(int,input().split()) B1,B2=map(int,input().split()) A1*=T1 A2*=T2 B1*=T1 B2*=T2 if A1+A2==B1+B2: print("infinity") else: if A1+A2<B1...
"""from collections import * from itertools import * from bisect import * from heapq import * import math from fractions import gcd""" T1,T2=map(int,input().split()) A1,A2=map(int,input().split()) B1,B2=map(int,input().split()) A1*=T1 A2*=T2 B1*=T1 B2*=T2 if A1+A2==B1+B2: print("infinity") else: if A1+A2<B1...
[ "misc.opposites", "expression.operator.arithmetic.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
652,063
652,062
u779455925
python
p02846
t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) p1 = t1*a1 q1 = t1*b1 p2 = p1+t2*a2 q2 = q1+t2*b2 if p2 == q2: print("infinity") exit() if (p1>q1 and p2>q2) or (p1<q1 and p2<q2): print(0) exit() x = abs(p1-q1) y = abs(q2-p2) if x%y == 0: ans = (x//y)*2-2 else...
t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) p1 = t1*a1 q1 = t1*b1 p2 = p1+t2*a2 q2 = q1+t2*b2 if p2 == q2: print("infinity") exit() if (p1>q1 and p2>q2) or (p1<q1 and p2<q2): print(0) exit() x = abs(p1-q1) y = abs(q2-p2) if x%y == 0: ans = (x//y)*2 else: ...
[ "expression.operation.binary.remove" ]
652,064
652,065
u905582793
python
p02846
T1, T2 = map(int, input().split()) A1, A2 = map(int, input().split()) B1, B2 = map(int, input().split()) C1 = A1 - B1 C2 = A2 - B2 if C1 > 0: C1, C2 = -C1, -C2 x1 = C1 * T1 + C2 * T2 x2 = x1 + C1 * T1 if x1 == 0: print('inifinity') elif x1 < 0: print(0) else: if 0 < x2: count = 1 elif 0 =...
T1, T2 = map(int, input().split()) A1, A2 = map(int, input().split()) B1, B2 = map(int, input().split()) C1 = A1 - B1 C2 = A2 - B2 if C1 > 0: C1, C2 = -C1, -C2 x1 = C1 * T1 + C2 * T2 x2 = x1 + C1 * T1 if x1 == 0: print('infinity') elif x1 < 0: print(0) else: if 0 < x2: count = 1 elif 0 ==...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
652,098
652,099
u022488946
python
p02846
#!/usr/bin/env python3 from itertools import combinations import sys input = sys.stdin.readline MOD = 10**9 + 7 t1, t2 = [int(item) for item in input().split()] a1, a2 = [int(item) for item in input().split()] b1, b2 = [int(item) for item in input().split()] a1 *= t1 b1 *= t1 a2 *= t2 b2 *= t2 if a1 + a2 == b1 + b2: ...
#!/usr/bin/env python3 from itertools import combinations import sys input = sys.stdin.readline MOD = 10**9 + 7 t1, t2 = [int(item) for item in input().split()] a1, a2 = [int(item) for item in input().split()] b1, b2 = [int(item) for item in input().split()] a1 *= t1 b1 *= t1 a2 *= t2 b2 *= t2 if a1 + a2 == b1 + b2: ...
[ "expression.operation.binary.remove", "expression.operator.change" ]
652,129
652,130
u052499405
python
p02846
s,t,a,b,x,y=map(int,open(0).read().split()) i=(x-a)*s j=(b-y)*t-i print(max(0,i//j*2+(i%j>0))if j else'infinity')
s,t,a,b,x,y=map(int,open(0).read().split()) i=(x-a)*s j=(b-y)*t-i print(max(0,i//j*2+(i%j!=0))if j else'infinity')
[ "expression.operator.compare.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
652,155
652,156
u729133443
python
p02846
# -*- coding: utf-8 -*- #mitsui f import sys import math import collections #sys.setrecursionlimit(100000) #n=int(input()) tmp = input().split() t1,t2 = list(map(lambda a: int(a), tmp)) tmp = input().split() a1,a2 = list(map(lambda a: int(a), tmp)) tmp = input().split() b1,b2 = list(map(lambda a: int(a), tmp)) if(a1...
# -*- coding: utf-8 -*- #mitsui f import sys import math import collections #sys.setrecursionlimit(100000) #n=int(input()) tmp = input().split() t1,t2 = list(map(lambda a: int(a), tmp)) tmp = input().split() a1,a2 = list(map(lambda a: int(a), tmp)) tmp = input().split() b1,b2 = list(map(lambda a: int(a), tmp)) if(a1...
[]
652,170
652,171
u707870100
python
p02846
t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) if a1*t1+a2*t2>=b1*t1+b2*t2: a1,a2,b1,b2 = b1,b2,a1,a2 d = b1*t1+b2*t2 - (a1*t1+a2*t2) if d == 0: print('inifinity') elif a1*t1<b1*t1: print(0) else: if (a1*t1 - b1*t1)*2%d ==0: print(((a1*t1 - b1*...
t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) if a1*t1+a2*t2>=b1*t1+b2*t2: a1,a2,b1,b2 = b1,b2,a1,a2 d = b1*t1+b2*t2 - (a1*t1+a2*t2) if d == 0: print('infinity') elif a1*t1<b1*t1: print(0) else: if (a1*t1 - b1*t1)*2%d ==0: print(((a1*t1 - b1*...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
652,172
652,173
u693953100
python
p02846
t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) if a1*t1+a2*t2>=b1*t1+b2*t2: a1,a2,b1,b2 = b1,b2,a1,a2 d = b1*t1+b2*t2 - (a1*t1+a2*t2) if d == 0: print('inifinity') elif a1*t1<b1*t1: print(0) else: if (a1*t1 - b1*t1)*2%d ==0: print(((a1*t1 - b1...
t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) if a1*t1+a2*t2>=b1*t1+b2*t2: a1,a2,b1,b2 = b1,b2,a1,a2 d = b1*t1+b2*t2 - (a1*t1+a2*t2) if d == 0: print('infinity') elif a1*t1<b1*t1: print(0) else: if (a1*t1 - b1*t1)*2%d ==0: print(((a1*t1 - b1*...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
652,174
652,173
u693953100
python
p02846
t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) if a1*t1+a2*t2>=b1*t1+b2*t2: a1,a2,b1,b2 = b1,b2,a1,a2 d = b1*t1+b2*t2 - (a1*t1+a2*t2) print(d) if d == 0: print('inifinity') elif a1*t1<b1*t1: print(0) else: if (a1*t1 - b1*t1)*2%d ==0: print(((a...
t1,t2 = map(int,input().split()) a1,a2 = map(int,input().split()) b1,b2 = map(int,input().split()) if a1*t1+a2*t2>=b1*t1+b2*t2: a1,a2,b1,b2 = b1,b2,a1,a2 d = b1*t1+b2*t2 - (a1*t1+a2*t2) if d == 0: print('infinity') elif a1*t1<b1*t1: print(0) else: if (a1*t1 - b1*t1)*2%d ==0: print(((a1*t1 - b1*...
[ "call.remove", "literal.string.change", "call.arguments.change", "io.output.change" ]
652,175
652,173
u693953100
python
p02846
t,T,a,A,b,B=map(int,open(0).read().split()) x,y=(b-a)*t,(A-B)*T if y-x==0: r="infinity" else: s,t=divmod(x,y-x) r=max(0,s*2+(t>0)) print(r)
t,T,a,A,b,B=map(int,open(0).read().split()) x,y=(b-a)*t,(A-B)*T if y-x==0: r="infinity" else: s,t=divmod(x,y-x) r=max(0,s*2+(t!=0)) print(r)
[ "expression.operator.compare.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
652,197
652,198
u941407962
python
p02846
t,T,a,A,b,B=map(int,open(0).read().split()) x,y=(b-a)*t,(A-B)*T if y-x==0: r="infinity" else: s,t=divmod(x,y-x) t=0 r=max(0,s*2+bool(t)) print(r)
t,T,a,A,b,B=map(int,open(0).read().split()) x,y=(b-a)*t,(A-B)*T if y-x==0: r="infinity" else: s,t=divmod(x,y-x) r=max(0,s*2+bool(t)) print(r)
[ "assignment.remove" ]
652,199
652,200
u941407962
python
p02846
t,T,a,A,b,B=map(int,open(0).read().split()) x,y=(b-a)*t,(A-B)*T if y-x==0: r="infinity" else: s,t=divmod(x,y-x) r=max(0,s*2+(t>0)) print(r)
t,T,a,A,b,B=map(int,open(0).read().split()) x,y=(b-a)*t,(A-B)*T if y-x==0: r="infinity" else: s,t=divmod(x,y-x) r=max(0,s*2+bool(t)) print(r)
[ "call.add", "call.arguments.change" ]
652,197
652,200
u941407962
python
p02846
t,T,a,A,b,B=map(int, open(0).read().split()) x,y=(a-b)*t,(A-B)*T if x+y==0: r="infinity" else: s,t=divmod(-y, x+y) r=0 if s<0 else s*2+(1 if t else 0) print(r)
t,T,a,A,b,B=map(int, open(0).read().split()) x,y=(a-b)*t,(A-B)*T if x+y==0: r="infinity" else: s,t=divmod(-x, x+y) r=0 if s<0 else s*2+(1 if t else 0) print(r)
[ "assignment.value.change", "identifier.change", "call.arguments.change" ]
652,201
652,202
u941407962
python
p02846
t1,t2 = map(int, input().split()) a1,a2 = map(int, input().split()) b1,b2 = map(int, input().split()) x,y=(a1-b1)*t1 + (a2-b2)*t2, (a1-b1)*t1 if x == 0: print("infinity") elif x*y > 0: print(0) else: s,t = divmod(abs(y), abs(x)) print(s*2+1 if t else 0)
t1,t2 = map(int, input().split()) a1,a2 = map(int, input().split()) b1,b2 = map(int, input().split()) x,y=(a1-b1)*t1 + (a2-b2)*t2, (a1-b1)*t1 if x == 0: print("infinity") elif x*y > 0: print(0) else: s,t = divmod(abs(y), abs(x)) print(s*2+(1 if t else 0))
[ "call.arguments.change" ]
652,203
652,204
u941407962
python
p02846
T1, T2 = map(int,input().split()) A1, A2 = map(int,input().split()) B1, B2 = map(int,input().split()) if T1*A1 + T2*A2 == T1*B1 + T2*B2: print("infinity") else: if T1*A1 + T2*A2 > T1*B1 + T2*B2: A1, B1 = B1, A1 A2, B2 = B2, A2 if T1*A1 < T1*B1: print("0") else: forward = ...
T1, T2 = map(int,input().split()) A1, A2 = map(int,input().split()) B1, B2 = map(int,input().split()) if T1*A1 + T2*A2 == T1*B1 + T2*B2: print("infinity") else: if T1*A1 + T2*A2 > T1*B1 + T2*B2: A1, B1 = B1, A1 A2, B2 = B2, A2 if T1*A1 < T1*B1: print("0") else: forward = ...
[ "expression.operation.binary.remove" ]
652,213
652,214
u882620594
python