s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s058661999 | p03998 | u403986473 | 1570242824 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 743 | sa = input()
sb = input()
sc = input()
def judges(lis):
if lis[0] == 'a':
judge=1
elif lis[0] == 'b':
judge=2
else:
judge=3
return judge
import sys
judge = 1
while(1):
if judge == 1:
try:
judge = judges(sa)
sa = sa[1:]
print(sa)
except IndexError:
print('A')
break
elif judge == 2:
try:
judge = judges(sb)
sb = sb[1:]
print(sb)
except IndexError:
print('B')
break
else:
try:
judge = judges(sc)
sc = sc[1:]
print(sc)
except IndexError:
print('C')
break |
s145914190 | p03998 | u941438707 | 1570147905 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3316 | 424 | from collections import deque
A=deque(input())
B=deque(input())
C=deque(input())
t="a"
for i in range(len(A+B+C)):
if t=="a":
if len(A)==0:
print("A")
exit()
t=A.popleft()
if t=="b":
if len(B)==0:
print("B")
exit()
t=B.popleft()
if t=="c":
if len(C)==0:
print("C")
exit()
t=C.popleft() |
s542427159 | p03998 | u837184304 | 1570136827 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3192 | 1395 | S_A = input()
S_B = input()
S_C = input()
i_A = 0
i_B = 0
i_C = 0
def AIf() :
if i_A == len(S_A):
return 'A'
if S_A[i_A] == 'a':
i_A += 1
IfA()
if S_A[i_A] == 'b':
i_A += 1
IfB()
if S_A[i_A] == 'c':
i_A += 1
IfC()
def IfA() :
if i_A == len(S_A):
return 'A'
if S_A[i_A] == 'a':
i_A += 1
AIf()
if S_A[i_A] == 'b':
i_A += 1
IfB()
if S_A[i_A] == 'c':
i_A += 1
IfC()
def BIf() :
if i_B == len(S_B):
return 'B'
if S_B[i_B] == 'a':
i_B += 1
IfA()
if S_B[i_B] == 'b':
i_B += 1
IfB()
if S_B[i_B] == 'c':
i_B += 1
IfC()
def IfB() :
if i_B == len(S_B):
return 'B'
if S_B[i_B] == 'a':
i_B += 1
IfA()
if S_B[i_B] == 'b':
i_B += 1
BIf()
if S_B[i_B] == 'c':
i_B += 1
IfC()
def CIf() :
if i_C == len(S_C):
return 'C'
if S_C[i_C] == 'a':
i_C += 1
IfA()
if S_C[i_C] == 'b' :
i_C += 1
IfB()
if S_C[i_c] == 'c' :
i_C += 1
IfC()
def IfC() :
if i_C == len(S_C):
return 'C'
if S_C[i_C] == 'a':
i_C += 1
IfA()
if S_C[i_C] == 'b' :
i_C += 1
IfB()
if S_C[i_c] == 'c' :
i_C += 1
CIf()
IfA() |
s831989879 | p03998 | u821989875 | 1570066034 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 381 | # coding: utf-8
a = list(input())
b = list(input())
c = list(input())
trash = a.pop(0)
def card_trash(x):
if x == "a":
t = a.pop(0)
elif x == "b":
t = b.pop(0)
elif x == "c":
t = c.pop(0)
return t
while True:
trash = card_trash(trash)
if a == []:
print("A")
break
elif b == []:
print("B")
break
elif c == []:
print("C")
break |
s826845673 | p03998 | u821989875 | 1570065963 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 444 | # coding: utf-8
a = list(input())
b = list(input())
c = list(input())
trash = a.pop(0)
def card_trash(x):
if x == "a":
t = a.pop(0)
elif x == "b":
t = b.pop(0)
elif x == "c":
t = c.pop(0)
return t
while True:
print("---")
print(a)
print(b)
print(c)
print("---")
trash = card_trash(trash)
if a == []:
print("A")
break
elif b == []:
print("B")
break
elif c == []:
print("C")
break |
s310283267 | p03998 | u821989875 | 1570064680 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 460 | # coding: utf-8
a = list(str(s) for s in input().split())
b = list(str(s) for s in input().split())
c = list(str(s) for s in input().split())
trash = "a"
end_flag = 0
def card_trash(x):
if x == "a":
t = a.pop(0)
elif x == "b":
t = b.pop(0)
elif x = "c":
t = c.pop(0)
return t
while True:
trash = card_trash(trash)
if a == []:
print("A")
break
elif b == []:
print("B")
break
elif c == []:
print("C")
break |
s108068890 | p03998 | u747602774 | 1569795165 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 329 | S_A=list(input())
S_B=list(input())
S_C=list(input())
S_A=reversed(S_A)
S_B=reversed(S_B)
S_C=reversed(S_C)
turn='a'
while S_A!=[] and S_B!=[] and S_C!=[]:
if turn=='a':
turn=S_A.pop()
elif turn=='b':
turn=S_B.pop()
else:
turn=S_C.pop()
if S_A==[]:
print('A')
elif S_B==[]:
print('B')
else:
print('C') |
s190183522 | p03998 | u115188504 | 1569792384 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 452 |
A, B, C = list(input() for i in range(3))
turn = "a"
while True:
if turn == 'a':
if len(A) != 0:
turn = A.pop(0)
else:
print('A')
break
elif turn == 'b':
if len(B) != 0:
turn = B.pop(0)
else:
print('B')
break
elif turn == 'c':
if len(C) != 0:
turn = C.pop(0)
else:
print('C')
break |
s162279667 | p03998 | u385244248 | 1569484268 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 710 | Sa = list(input())
Sb = list(input())
Sc = list(input())
for _ in range(10**8):
if _ == 0:
s = Sa[0]
if s == "a":
s = Sa[1]
del Sa[0]
elif s == "b":
s = Sb[1]
del Sb[0]
else:
s = Sc[1]
del Sc[0]
elif len(Sa) == 1 and s == "a":
print("A")
break
elif len(Sb) == 1 and s == "b":
print("B")
break
elif len(Sc) == 1 and s == "c":
print("C")
break
else:
if s == "a":
s = Sa[1]
del Sa[0]
elif s == "b":
s = Sb[1]
del Sb[0]
else:
s = Sc[1]
del Sc[0]
|
s332200421 | p03998 | u174273188 | 1569007929 | Python | PyPy3 (2.4.0) | py | Runtime Error | 189 | 38256 | 359 | def resolve():
a = input()
b = input()
c = input()
d = {"a": a, "b": b, "c": c}
now = d["a"][0]
d["a"] = d["a"][1:]
next = d[now][0]
while True:
if len(d[next]) == 0:
print(next.upper())
return 0
next = d[next][0]
d[next] = d[next][1:]
if __name__ == "__main__":
resolve()
|
s319090039 | p03998 | u608355135 | 1568907820 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 493 | s_a = input()
s_b = input()
s_c = input()
x = s_a[0]
while( len(s_a) >= 0 and len(s_b) >=0 and len(s_c) >= 0):
if x == 'a':
x = s_a[0]
s_a = s_a[1:]
if x == 'b':
x = s_b[0]
s_b = s_b[1:]
if x == 'c':
x = s_c[0]
s_c = s_c[1:]
if x == 'a' and len(s_a) == 0:
print('A')
break
if x == 'b' and len(s_b) == 0:
print('B')
break
if x == 'c' and len(s_c) == 0:
print('C')
break
|
s650351981 | p03998 | u608355135 | 1568907715 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 602 | s_a = input()
s_b = input()
s_c = input()
x = s_a[0]
while( len(s_a) >= 0 and len(s_b) >=0 and len(s_c) >= 0):
print(s_a,s_b,s_c,1)
if x == 'a':
x = s_a[0]
s_a = s_a[1:]
print(s_a,s_b,s_c,2)
if x == 'b':
x = s_b[0]
s_b = s_b[1:]
print(s_a,s_b,s_c,3)
if x == 'c':
x = s_c[0]
s_c = s_c[1:]
print(s_a,s_b,s_c,4)
if x == 'a' and len(s_a) == 0:
print('A')
break
if x == 'b' and len(s_b) == 0:
print('B')
break
if x == 'c' and len(s_c) == 0:
print('C')
break
|
s342904962 | p03998 | u480138356 | 1568825291 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 847 | import sys
input = sys.stdin.readline
def main():
sa = input().strip()
sb = input().strip()
sc = input().strip()
rest_a = 0
rest_b = 0
rest_c = 0
rest_a += 1
next_ = sa[0]
while True:
if next_ == "a":
if rest_a == len(sa) - 1:
print("A")
break
else:
next_ = sa[rest_a]
rest_a += 1
elif next_ == "b":
if rest_b == len(sb) - 1:
print("B")
break
else:
next_ = sb[rest_b]
rest_b += 1
elif next_ == "c":
if rest_c == len(sc) - 1:
print("C")
break
else:
next_ = sc[rest_c]
rest_c += 1
if __name__ == "__main__":
main() |
s258979738 | p03998 | u871596687 | 1568752980 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 468 | sa = list(input())
sb = list(input())
sc = list(input())
turn = "a"
while True:
if turn == "a":
if len(sa) != 0:
turn = sa.pop(0)
else:
print("A")
exit()
elif turn == "b":
if len(sb) != 0:
turn = sb.pop(0)
else:
print("B")
exit()
else:
if len(sc) != "c"
turn = sc.pop(0)
else:
print("C")
exit()
|
s794200260 | p03998 | u460737328 | 1568684129 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 259 | S = {
'a' : input(),
'b' : input(),
'c' : input()
}
ans = None
prv, nxt = None, 'a'
while True:
if len(S[nxt]) != 1:
prv = nxt
nxt = S[nxt][1]
else:
ans = prv.upper()
break
S[prv] = S[prv][1:]
print(ans) |
s756470203 | p03998 | u738474183 | 1568525147 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 302 | # cards = [input() for _ in range(3)]
dict = {'a':0, 'b':1, 'c':2}
inv = ['A', 'B', 'C']
turn = 'a'
game = True
while game:
turn = cards[dict[turn]][0]
cards[dict[turn]] = cards[dict[turn]][1:]
for i in range(3):
if cards[i] == '':
print(inv[i])
game = False |
s443055263 | p03998 | u580093517 | 1568433054 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 88 | s = {c:list(input()) for c in "abc"}
s = "a"
while S[s]:s = S[s].pop(0)
print(s.upper()) |
s062490248 | p03998 | u319690708 | 1567897835 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 374 | SA = list(input())
SB = list(input())
SC = list(input())
x = "a"
while True:
if x == "a":
if len(SA) ==0:
print("A")
exit()
x = SA[0]
SA.remove(x)
elif x == "b":
if len(SB) ==0:
print("B")
exit()
x = SB[0]
SB.remove(x)
else:
if len(SB) == 0:
print("C")
exit()
x = SC[0]
SC.remove(x)
|
s472310941 | p03998 | u045408189 | 1567644924 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 79 | S = {c:list(input()) for c in 'ABC'}
s = A
while S[s]:
s=S[s].pop(0)
print(s) |
s994906149 | p03998 | u187462782 | 1567281692 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 207 | hands_a, hands_b, hands_c = (list(input()) for i in range(3))
hands = {'a': hands_a, 'b': hands_b, 'c': hands_c}
turn = 'a'
while len(hands[turn]) > 0:
turn = hands[turn].popleft()
print(turn.upper())
|
s474410872 | p03998 | u187462782 | 1567281633 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 205 | hands_a, hands_b, hands_c = (list(input()) for i in range(3))
hands = {'a': hands_a, 'b': hands_b, 'c': hands_c}
turn = 'a'
while len(hands[turn]) > 0:
turn = hands[turn].popleft
print(turn.upper())
|
s833665179 | p03998 | u957872856 | 1567026727 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 85 | S = {c:input() for c in "abc"}
s = "a"
while S[s]:
s = S[s].pop(0)
print(s.upper()) |
s727202567 | p03998 | u881816188 | 1566930329 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 403 | def f(x):
return x[1:],x[0]
x=input()
y=input()
z=input()
k='a'
while 1:
if k=='a':
if x=='':
print('A')
break
else:
x,k=f(x)
if k=='b':
if y=='':
print('B')
break
else:
z,k=f(z)
if k=='c':
if z=='':
print('C')
break
else:
z,k=f(z) |
s198170495 | p03998 | u881816188 | 1566930257 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 429 | import sys
def f(x):
return x[1:],x[0]
x=input()
y=input()
z=input()
k='a'
while 1:
if k=='a':
if x=='':
print('A')
sys.exit()
else:
x,k=f(x)
if k=='b':
if y=='':
print('B')
sys.exit()
else:
z,k=f(z)
if k=='c':
if z=='':
print('C')
sys.exit()
else:
z,k=f(z) |
s065328426 | p03998 | u713465512 | 1566784760 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1166 | import sys
sys.stdin = open("./sample_data.txt")
input = sys.stdin.readline
######################################
from collections import deque
SA = input()
SB = input()
SC = input()
count_a = len(SA)-1
count_b = len(SB)-1
count_c = len(SC)-1
da = deque()
db = deque()
dc = deque()
for i in range(len(SA)-1):
da.append(SA[i])
for j in range(len(SB)-1):
db.append(SB[j])
for k in range(len(SC)-1):
dc.append(SC[k])
turn = 0
times = count_a+count_b+count_c
for i in range(times):
if turn == 0:
if count_a== 0:
print("A")
exit()
a = da.popleft()
count_a -= 1
if a == "a":
continue
else:
turn = 1
continue
elif turn == 1:
if count_b == 0:
print("B")
exit()
b = db.popleft()
count_b -= 1
if b == "b":
continue
else:
turn = 2
continue
elif turn == 2:
if count_c == 0:
print("C")
exit()
c = dc.popleft()
count_c -=1
if c == "c":
continue
else:
turn = 0
|
s910068273 | p03998 | u559103167 | 1566774863 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 79 | S = {i:list(input()) for i in "abc"}
while S[s]: s=S[s].pop(0)
print(s.upper()) |
s298100491 | p03998 | u243572357 | 1566681523 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 112 | dic = {i:list(input()) for i in 'abc'}
key = 'a'
while len(dic[key]) != 0:
key = dic.pop(0)
print(key.upper()) |
s347787675 | p03998 | u243572357 | 1566681242 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 114 | dic = {i:list(input()) for i in 'abc'}
key = 'a'
while len(dic[key]) != 0:
key = dic.pop(key)
print(key.upper()) |
s038405625 | p03998 | u243572357 | 1566681209 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 116 | dic = {i:list(input()) for i in 'abc'}
while len(dic[key]) != 0:
key = 'a'
key = dic.pop(key)
print(key.upper()) |
s507418412 | p03998 | u243572357 | 1566361967 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 78 | S = {i: input() for i in 'abc'}
s = 'a'
while S[s]:
s = S[s].pop(0)
print(s) |
s432696812 | p03998 | u798316285 | 1565979930 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 289 | a=list(input())
b=list(input())
c=list(input())
turn="a"
while True:
if turn=="a":
turn=a.pop()
if not a:
print("A")
break
elif turn=="b"
turn=b.pop()
if not b:
print("B")
break
else:
turn=c.pop()
if not c:
print("C")
break |
s439518350 | p03998 | u369199820 | 1565970046 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 366 | A = list(input())
B = list(input())
C = list(input())
count = [0,0,0]
turn = A[count[0]]
count[0] += 1
if turn == 'a':
turn = A[count[0]]
count[0] += 1
elif turn == 'b':
turn = B[count[1]]
count[1] += 1
elif turn == 'c':
turn = C[count[2]]
count[2] += 1
else:
if turn == 'a':
print("A")
elif turn == 'b':
print("B")
else:
print("C")
|
s610896670 | p03998 | u248670337 | 1565837969 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 76 | S={c:list for c in "abc"}
s="a"
while S[s]:
s=S[s].pop(0)
print(s.upper()) |
s834250958 | p03998 | u462329577 | 1565653517 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38256 | 346 | s = [ input() for i in [0]*3]
current = 0
while len(s[current]) >= 0 :
if len(s[ord(s[current][-1]) - 97]) == 0:
print(s[current][-1].upper())
break
else:
tmp = s[current][-1] # 末尾の値を保存
s[current] = s[current][:-1] # 末尾を消去する
current = ord(tmp) - 97
# 末尾の値にcurrentを更新する
|
s152522647 | p03998 | u626337957 | 1565293812 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 367 | sa = input()
sb = input()
sc = input()
ia = 0
ib = 0
ic = 0
next = 'a'
while True:
if ia == len(sa)-1:
print('A')
break
if ib == len(sb)-1:
print('B')
break
if ic == len(sc)-1:
print('C')
break
if next == 'a':
next = S[ia]
ia += 1
if next == 'b':
next = S[ib]
ib += 1
if next == 'c':
next = S[ic]
ic += 1
|
s804152558 | p03998 | u957872856 | 1565142516 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 348 | Sa = list(input())
Sb = list(input())
Sc = list(input())
d = Sa.pop(0)
for i in range(305):
if d == "a":
d = Sa.pop(0)
elif d == "b":
d = Sb.pop(0)
else:
d = Sc.pop(0)
if Sa == [] and d == "a":
print("A")
break
elif Sb == [] and d == "b":
print("B")
break
elif Sc == [] and d == "c":
print("C")
break |
s287677584 | p03998 | u957872856 | 1565142483 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 348 | Sa = list(input())
Sb = list(input())
Sc = list(input())
d = Sa.pop(0)
for i in range(300):
if d == "a":
d = Sa.pop(0)
elif d == "b":
d = Sb.pop(0)
else:
d = Sc.pop(0)
if Sa == [] and d == "a":
print("A")
break
elif Sb == [] and d == "b":
print("B")
break
elif Sc == [] and d == "c":
print("C")
break |
s771886798 | p03998 | u948524308 | 1563730498 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 360 | SA = input()
SB = input()
SC = input()
ca,cb,cc = 0,0,0
t = "a"
while ca < len(SA) and cb < len(SB) and cc < len(SC):
if t == "a":
answer = "A"
t = SA[ca]
ca = ca + 1
elif t == "b":
answer = "B"
t = [cb]
cb = cb + 1
else:
answer ="C"
t = SC[cb]
cb = cb +1
print(answer) |
s530039567 | p03998 | u257332942 | 1563415191 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 185 | d = {"a": input(), "b": input(), "c": input()}
def func(s):
if len(d[s]) == 0:
return s.upper()
next = d[s][0]
d[s] = d[s][1:]
return func(next)
print(func(a)) |
s570803997 | p03998 | u257332942 | 1563415082 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 183 | d = {"a": input(), "b": input(), "c": input()}
def func(s):
if len(d[s]) == 0:
return upper()
next = d[s][0]
d[s] = d[s][1:]
return func(next)
print(func(a)) |
s003574106 | p03998 | u405256066 | 1562910884 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 576 | from sys import stdin
from collections import deque
sa = deque(list((stdin.readline().rstrip())))
sb = deque(list((stdin.readline().rstrip())))
sc = deque(list((stdin.readline().rstrip())))
next = "a"
for i in range(300):
if len(sa) == 0 and next == "a":
print("A")
break
if len(sb) == 0 and next == "b":
print("B")
break
if len(sc) == 0 and next == "c":
print("C")
break
if next == "a":
next = sa.popleft()
if next == "b":
next = sb.popleft()
if next == "c":
next = sc.popleft() |
s766206293 | p03998 | u405256066 | 1562910616 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 576 | from sys import stdin
from collections import deque
sa = deque(list((stdin.readline().rstrip())))
sb = deque(list((stdin.readline().rstrip())))
sc = deque(list((stdin.readline().rstrip())))
next = "a"
for i in range(300):
if next == "a":
next = sa.popleft()
if next == "b":
next = sb.popleft()
if next == "c":
next = sc.popleft()
if len(sa) == 0 and next == "a":
print("A")
break
if len(sb) == 0 and next == "b":
print("B")
break
if len(sc) == 0 and next == "c":
print("C")
break |
s555408840 | p03998 | u790812284 | 1562746630 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 570 | import sys
sa=list(str(input()))
sb=list(str(input()))
sc=list(str(input()))
tmp="a"
while True:
if tmp=="a":
if len(sa)==0:
print("A")
sys.exit()
else:
tmp=sa[0]
sa=sa.lstrip(sa[0])
elif tmp=="b":
if len(sb)==0:
print("B")
sys.exit()
else:
tmp=sb[0]
sb=sb.lstrip(sb[0])
elif tmp=="c":
if len(sc)==0:
print("C")
sys.exit()
else:
tmp=sc[0]
sc=sc.lstrip(sc[0]) |
s731293266 | p03998 | u093500767 | 1562561630 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 403 | A = list(str(input()))
B = list(str(input()))
C = list(str(input()))
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "A"
while a_len>=0 and b_len>=0 and c_len>=0:
if next=="A":
next = A[0]
del A[0]
a_len -= 1
elif next=="B":
next = B[0]
del B[0]
b_len -= 1
else:
next = C[0]
del C[0]
c_len -= 1
print(next.upper()) |
s852028291 | p03998 | u093500767 | 1562561286 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 403 | A = list(str(input()))
B = list(str(input()))
C = list(str(input()))
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "A"
while a_len>=0 and b_len>=0 and c_len>=0:
if next=="A":
next = A[0]
A.pop(0)
a_len -= 1
elif next=="B":
next = B[0]
A.pop(0)
b_len -= 1
else:
next = C[0]
B.pop(0)
c_len -= 1
print(next.upper()) |
s446651107 | p03998 | u093500767 | 1562561119 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 370 | A = input()
B = input()
C = input()
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "A"
while a_len>=0 and b_len>=0 and c_len>=0:
if next=="A":
next = A[0]
A.pop(0)
a_len -= 1
elif next=="B":
next = B[0]
A.pop(0)
b_len -= 1
else:
next = C[0]
B.pop(0)
c_len -= 1
print(next.upper()) |
s894432703 | p03998 | u093500767 | 1562560902 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 407 | A = input()
B = input()
C = input()
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "A"
while a_len>=0 and b_len>=0 and c_len>=0:
if next=="A":
next = A[0].upper()
A.pop(0)
a_len = a_len - 1
elif next=="B":
next = B[0].upper()
A.pop(0)
b_len = b_len - 1
else:
next = C[0].upper()
B.pop(0)
c_len = c_len - 1
print(next) |
s064590713 | p03998 | u093500767 | 1562560079 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 417 | A = input()
B = input()
C = input()
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "A"
while a_len>=0 and b_len>=0 and c_len>=0:
if next=="A":
next = A[0].upper()
A = A[1:-1]
a_len = a_len - 1
elif next=="B":
next = B[0].upper()
A = A[1:-1]
b_len = b_len - 1
else:
next = C[0].upper()
B = B[1:-1]
c_len = c_len - 1
print(next)
|
s968512966 | p03998 | u093500767 | 1562558017 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 419 | A = input()
B = input()
C = input()
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "A"
while a_len>=0 and b_len>=0 and c_len>=0:
if next=="A":
next = A[0].upper()
A = A.pop(0)
a_len = a_len - 1
elif next=="B":
next = B[0].upper()
A = A.pop(0)
b_len = b_len - 1
else:
next = C[0].upper()
B = B.pop(0)
c_len = c_len - 1
print(next) |
s476616615 | p03998 | u093500767 | 1562557362 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 452 | A = list(str(input()))
B = list(str(input()))
C = list(str(input()))
a_len = len(A)
b_len = len(B)
c_len = len(C)
next = "A"
while a_len>=0 and b_len>=0 and c_len>=0:
if next=="A":
next = A[0].upper()
A = A.pop(0)
a_len = a_len - 1
elif next=="B":
next = B[0].upper()
A = A.pop(0)
b_len = b_len - 1
else:
next = C[0].upper()
B = B.pop(0)
c_len = c_len - 1
print(next) |
s207111207 | p03998 | u927534107 | 1562094308 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 288 | x = l_a.pop(0)
ans=0
while ans==0:
if x == "a":
if len(l_a) != 0: x = l_a.pop(0)
else:ans = "A"
if x == "b":
if len(l_b) != 0: x = l_b.pop(0)
else:ans = "B"
if x == "c":
if len(l_c) != 0: x = l_c.pop(0)
else:ans = "C"
print(ans) |
s850660054 | p03998 | u539517139 | 1560896763 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 354 | a=input()
b=input()
c=input()
def g(x):
if x=='a':
if len(a)==0:
y='A'
else:
y=a[0]
a[0]=''
elif x=='b':
if len(b)==0:
y='B'
else:
y=b[0]
b[0]=''
else:
if len(c)==0:
y='C'
else:
y=c[0]
c[0]=''
return y
t=g(a[0])
while t!='A' and t!='B' and t!='C':
t=g(t)
print(t)
|
s377597408 | p03998 | u539517139 | 1560896650 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 354 | a=input()
b=input()
c=input()
def g(x):
if x=='a':
if len(a)==0:
y='A'
else:
y=a[0]
a=a[1:]
elif x=='b':
if len(b)==0:
y='B'
else:
y=b[0]
b=b[1:]
else:
if len(c)==0:
y='C'
else:
y=c[0]
c=c[1:]
return y
t=g(a[0])
while t!='A' and t!='B' and t!='C':
t=g(t)
print(t)
|
s810335406 | p03998 | u394721319 | 1560808674 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38640 | 605 | A = list(input())
B = list(input())
C = list(input())
for _ in range(A.count('a')):
A.remove('a')
for _ in range(B.count('b')):
B.remove('b')
for _ in range(C.count('c')):
C.remove('c')
tmp = A.pop()
while True:
if tmp == 'a':
if len(A) == 0:
print('A')
exit()
else:
tmp = A.pop()
if tmp == 'b':
if len(B) == 0:
print('B')
exit()
else:
tmp = B.pop()
if tmp == 'c':
if len(C) == 0:
print('C')
exit()
else:
tmp = C.pop()
|
s908198335 | p03998 | u181668771 | 1560610696 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 230 | import sys
arr = list(map(int,sys.stdin))
a, b, c = 0
tmp = 0
while True:
x = [a, b, c][tmp]
s = arr[tmp][x]
[a,b,c][tmp] += 1
tmp = [0, 1, 2]["abc".find(s)]
if arr[tmp][x]:
[a,b,c][tmp]
break
|
s827659338 | p03998 | u136811344 | 1560532810 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 157 | S = dict()
S['a'] = list(input())[::-1]
S['b'] = list(input())[::-1]
S['c'] = list(input())[::-1]
p = 'a'
while S[]:
p = S[p].pop()
print(player.upper()) |
s242672525 | p03998 | u136811344 | 1560532746 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 158 | S = dict()
S['a'] = list(input())[::-1]
S['b'] = list(input())[::-1]
S['c'] = list(input())[::-1]
p = 'a'
while S[]:
p = S[p].pop()
print(player.upper()) |
s028711180 | p03998 | u778814286 | 1560381787 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38256 | 275 | lis = [input() for _ in range(3)]
len = [len(lis[i]) for i in range(3)]
idx = [0,0,0]
name = ['a','b','c']
turn = 0
while 1:
if len[turn] <= idx[turn]:
print(name(turn))
exit()
else:
tmp = ord(lis[turn][idx[turn]])-ord('a')
idx[turn] += 1
turn = tmp
|
s208088283 | p03998 | u778814286 | 1560381756 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38384 | 276 | lis = [input() for _ in range(3)]
len = [len(lis[i]) for i in range(3)]
idx = [0,0,0]
name = ['a','b','c']
turn = 0
while 1:
if len[turn] <= idx[turn]:
print(name(turn))
exit()
else:
tmp = ord(lis[turn][idx[turn]])-ord('a')
idx[turn] += 1
turn = tmp
|
s219552774 | p03998 | u778814286 | 1560381118 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38640 | 247 | lis = [input() for _ in range(3)]
len = [len(lis[i]) for i in range(3)]
idx = [0,0,0]
name = ['a','b','c']
turn = 0
while 1:
if len[turn] <= idx[turn]:
print(name[turn])
exit()
else:
turn = lis[turn][idx[turn]]
idx[turn] += 1
|
s116345079 | p03998 | u778814286 | 1560380960 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38640 | 246 | lis = [input() for _ in range(3)]
len = [len(lis[i]) for _ in range(3)]
idx = [0,0,0]
name = ['a','b','c']
turn = 0
while 1:
if len[turn] <= idx[turn]:
print(name[turn])
exit()
else:
turn = lis[turn][idx[turn]]
idx[turn] += 1 |
s503980037 | p03998 | u102461423 | 1560321301 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 153 | S = dict()
S['a'] = list(input())
S['b'] = list(input())
S['c'] = list(input())
player = a
while S[player]:
player = S[player].pop()
print(player)
|
s776494417 | p03998 | u564060397 | 1560006082 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 246 | A=input())
B=input())
C=input())
card={a:A,b:B,c:C}
answer=["a":"A","b":"B","c":"C"]
turn="a"
while True:
if len(card[turn])==0:
break
next_turn=card[turn][0]
card[turn]=card[turn][1:]
turn=next_turn
print(answer[turn]) |
s346247141 | p03998 | u223904637 | 1559182495 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 449 | a=list(input())
b=list(input())
c=list(input())
cur='a'
while True:
if cur=='a':
if len(a)==0:
print('a')
break
else:
cur=a.pop()
elif cur=='b':
if len(b)==:
print('b')
break
else:
cur=b.pop()
else:
if len(c)==0:
print('c')
break
else:
cur=c.pop()
|
s512410828 | p03998 | u223646582 | 1559141484 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 493 | SA=input()
SB=input()
SC=input()
A_rest=len(SA)
B_rest=len(SA)
C_rest=len(SA)
next='a'
while(1):
if next=='a':
A_rest-=1
if A_rest<0:
break
next=SA[len(SA)-A_rest]
elif next=='b':
B_rest-=1
if B_rest<0:
break
next=SB[len(SB)-B_rest]
else:
C_rest-=1
if C_rest<0:
break
next=SC[len(SC)-C_rest]
if A_rest<0:
print('A')
elif B_rest<0:
print('B')
else:
print('C') |
s835384684 | p03998 | u296150111 | 1559062134 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 387 | sa=input()
sb=input()
sc=input()
pointa=len(sa)
sua=0
pointb=len(sb)
sub=0
pointc=len(sc)
suc=0
turn="a"
for i in range(500):
if pointa==-1:
print("A")
break
elif pointb==0:
print("B")
break
elif pointc==0:
print("C")
break
elif turn=="a":
turn=sa[sua]
pointa-=1
sua+=1
elif turn=="b":
turn=sb[sub]
pointb-=1
sub+=1
else:
turn=sc[suc]
pointc-=1
suc+=1 |
s022306309 | p03998 | u008489560 | 1558706015 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 454 | a_hands = [*input()]
b_hands = [*input()]
c_hands = [*input()]
turn = 'a'
while True:
if turn == 'a':
if len(a_hands) == 0:
print('A')
break
turn = a_hands.pop(0)
elif turn == 'b':
if len(b_hands) == 0:
print('B')
break
turn = b_hands.pop(0)
elif turn == 'c':
if len(c_hands) == 0:
print('C')
break
turn = c_hands.pop(0)
|
s240308468 | p03998 | u008489560 | 1558705934 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 454 | a_hands = [*input()]
b_hands = [*input()]
c_hands = [*input()]
turn = 'a'
while True:
if turn == 'a':
if len(a_hands) == 0:
print('A')
break
turn = a_hands.pop(0)
elif turn == 'b':
if len(b_hands) == 0:
print('B')
break
turn = b_hands.pop(0)
elif turn == 'c':
if len(c_hands) == 0:
print('C')
break
turn = c_hands.pop(0)
|
s520202563 | p03998 | u513900925 | 1558150887 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 592 | a = input()
b = input()
c = input()
def turn(x ,a_hand ,b_hand ,c_hand):
if not a_hand and x == "a"
print("A")
return
if not b_hand and x =="b":
print("B")
return
if not c_hand and x =="c":
print("C")
return
if x == "a":
x = a_hand[0]
a_hand = a_hand[1:]
turn(x , a_hand , b_hand , c_hand)
elif x == "b":
x = b_hand[0]
b_hand = b_hand[1:]
turn(x , a_hand , b_hand , c_hand)
else:
x = c_hand[0]
c_hand = c_hand[1:]
turn(x , a_hand , b_hand , c_hand) |
s342668771 | p03998 | u581187895 | 1557628296 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 102 | dic_S = {c: list(input()) for c in "abc"}
s = "a"
while dic_S[s]:
s = S[s].pop(0)
print(s.upper()) |
s135574752 | p03998 | u732870425 | 1556923858 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 521 | A = input()
B = input()
C = input()
next_turn = A[0]
Acnt = 1
Bcnt = 0
Ccnt = 0
while True:
if next_turn == 'a':
if Acnt == len(A)-1:
print('A')
break
next_turn = A[Acnt]
Acnt += 1
elif next_turn == 'b':
if Bcnt == len(B)-1:
print('B')
break
next_turn = B[Bcnt]
Bcnt += 1
elif next_turn == 'c':
if Ccnt == len(C)-1:
print('C')
break
next_turn = C[Ccnt]
Ccnt += 1 |
s247206611 | p03998 | u732870425 | 1556923693 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 519 | A = input()
B = input()
C = input()
next_turn = A[0]
Acnt = 1
Bcnt = 0
Ccnt = 0
while True:
if next_turn == 'a':
next_turn = A[Acnt]
Acnt += 1
if Acnt == len(A)-1:
print('A')
break
elif next_turn == 'b':
next_turn = B[Bcnt]
Bcnt += 1
if Bcnt == len(B)-1:
print('B')
break
elif next_turn == 'c':
next_turn = C[Ccnt]
Ccnt += 1
if Ccnt == len(C)-1:
print('C')
break |
s638692276 | p03998 | u732870425 | 1556923589 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 519 | A = input()
B = input()
C = input()
next_turn = A[0]
Acnt = 0
Bcnt = 0
Ccnt = 0
while True:
if next_turn == 'a':
next_turn = A[Acnt]
Acnt += 1
if Acnt == len(A)-1:
print('A')
break
elif next_turn == 'b':
next_turn = B[Bcnt]
Bcnt += 1
if Bcnt == len(B)-1:
print('B')
break
elif next_turn == 'c':
next_turn = C[Ccnt]
Ccnt += 1
if Ccnt == len(C)-1:
print('C')
break |
s037316593 | p03998 | u222138979 | 1556071646 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 442 | #045 b
A = input()
B = input()
C = input()
start = True
if len(A) == 0:
print('A')
else:
while len(A) > 1 and len(B) > 1 and len(C) > 1:
if start:
x = A[0]
A = A[1:]
start = False
if x == 'a':
x = A[0]
A = A[1:]
elif x == 'b':
x = B[0]
B = B[1:]
else:
x = C[0]
C = C[1:]
print(x.upper())
|
s775096254 | p03998 | u885899351 | 1555449680 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 340 | sa=input()
sb=input()
sc=input()
i=sa[0]
sa=sa[1:]
while 1:
if i=="a":i,sa=sa[0],sa[1:]
elif i=="b":i,sb=sb[0],sb[1:]
elif i=="c":i,sc=sc[0],sc[1:]
if i=="a" and sa=="":
print("A")
break
elif i=="b" and sb=="":
print("B")
break
elif i=="c" and sc=="":
print("C")
break |
s093546692 | p03998 | u428855582 | 1555377576 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 125 | #人の回答を写経したもの
dic = {k: list(input()) for k in "abc"}
while dic[s]:
s=dic[s].pop(0)
print(s.upper()) |
s127939849 | p03998 | u457423258 | 1555259079 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 508 | k=['a']
for i in range(len(sa)+len(sb)+len(sc)):
if k[-1]=='a':
k.append(sa[0])
if k.count('a')>len(sa):
print('A')
exit()
sa.replace('sa[0:1]',"")
elif k[-1]=='b':
k.append(sb[0])
if k.count('b')>len(sb):
print('B')
exit()
sb.replace('sb[0:1]',"")
elif k[-1]=='c':
k.append(sc[0])
if k.count('c')>len(sc):
print('C')
exit()
sc.replace('sc[0:1]',"")
|
s176523950 | p03998 | u457423258 | 1555258198 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 469 | sa=input()
sb=input()
sc=input()
k=['a']
for i in range(n):
if k[0::-1]=='a':
k.append(sa[0])
if k.count('a')>len(sa):
print('A')
exit()
del sa[0]
elif k[0::-1]=='b':
k.append(sb[0])
if k.count('b')>len(sb):
print('B')
exit()
del sb[0]
else:
k.append(sc[0])
if k.count('c')>len(sc):
print('C')
exit()
del sc[0] |
s055266877 | p03998 | u457423258 | 1555258106 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 467 | sa=input()
sb=input()
sc=input()
k=['a']
for i in range(n):
if k[0::-1]=='a':
k.append(sa[0])
del sa[0]
if k.count('a')>len(sa):
print('A')
exit()
elif k[0::-1]=='b':
k.append(sb[0])
del sb[0]
if k.count('b')>len(sb):
print('B')
exit()
else:
k.append(sc[0])
del sc[0]
if k.count('c')>len(sc):
print('C')
exit() |
s061873249 | p03998 | u844005364 | 1554942964 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 90 |
S = {c: input() for c in "abc"}
s = "a"
while S[s]:
s = S[s].pop(0)
print(s.upper()) |
s878238306 | p03998 | u844005364 | 1554942704 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 309 | import sys
p = ["A", "B", "C"]
p_dic = {"a": 0, "b": 1, "c": 2}
def card(cards, player):
if len(cards[player]) == 1:
print(p[player])
sys.exit()
else:
x = cards[player][0]
cards[player] = cards[player][1:]
def card(cards, p_dic[x])
cards = [input() for i in range(3)]
card(cards, 0) |
s681959393 | p03998 | u616522759 | 1554841004 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1002 | s = [input() for i in range(3)]
flg = 1
while(True):
if flg == 1:
if s[0] == '':
print('A')
break
elif s[0][0] == 'a':
s[0] = s[0][1:]
flg = 1
elif s[0][0] == 'b':
s[0] = s[0][1:]
flg = 2
elif s[0][0] == 'c':
s[0] = s[0][1:]
flg = 3
elif flg == 2:
if s[1] == '':
print('B')
break
elif s[1][0] == 'a':
s[1] = s[1][1:]
flg = 1
elif s[1][0] == 'b':
s[1] = s[1][1:]
flg = 2
elif s[1][0] == 'c':
s[1] = s[1][1:]
flg = 3
elif flg == 3:
if s[0] == '':
print('C')
break
elif s[2][0] == 'a':
s[2] = s[2][1:]
flg = 1
elif s[2][0] == 'b':
s[2] = s[2][1:]
flg = 2
elif s[2][0] == 'c':
s[2] = s[2][1:]
flg = 3 |
s004774115 | p03998 | u319818856 | 1554745986 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 720 | def str2turn(c: str) -> int:
if c.lower() == 'a':
return 0
elif c.lower() == 'b':
return 1
return 2
def turn2str(t: int) -> str:
if t == 0:
return 'a'
elif t == 1:
return 'b'
return 'c'
def card_game_for_three(Sa: str, Sb: str, Sc: str) -> str:
indexes = [0, 0, 0]
limits = [len(Sa), len(Sb), len(Sc)]
cards = [Sa, Sb, Sc]
turn = 0
while indexes[turn] < limits[turn]:
next_turn = cards[turn][indexes[turn]]
indexes[turn] += 1
turn = next_turn
return turn2str(turn).upper()
if __name__ == "__main__":
Sa = input()
Sb = input()
Sc = input()
ans = card_game_for_three(Sa, Sb, Sc)
print(ans)
|
s144763547 | p03998 | u589726284 | 1554697963 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 526 | S = [input() for _ in range(3)]
current = 'a'
winenr = ''
while 1:
if 'A' == current.upper():
S[0] = S[0][1:]
if '' == S[0]:
winenr = 'A'
break
current = S[0][0]
if 'B' == current.upper():
S[1] = S[1][1:]
if '' == S[0]:
winenr = 'B'
break
current = S[1][0]
if 'C' == current.upper():
S[2] = S[2][1:]
if '' == S[0]:
winenr = 'C'
break
current = S[2][0]
print(winenr)
|
s200531314 | p03998 | u777028980 | 1554492797 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 745 | hoge_a=input()
hoge_b=input()
hoge_c=input()
tugi="A"
while 1:
if(tugi=="A"):
if(hoge_a[0]=="a"):
tugi="A"
if(hoge_a[0]=="b"):
tugi="B"
if(hoge_a[0]=="c"):
tugi="C"
hoge_a=hoge_a[1:]
if(tugi=="B"):
if(hoge_b[0]=="a"):
tugi="A"
if(hoge_b[0]=="b"):
tugi="B"
if(hoge_b[0]=="c"):
tugi="C"
hoge_b=hoge_b[1:]
if(tugi=="C"):
if(hoge_c[0]=="a"):
tugi="A"
if(hoge_c[0]=="b"):
tugi="B"
if(hoge_c[0]=="c"):
tugi="C"
hoge_c=hoge_c[1:]
if(len(hoge_a)==0 and tugi=="A"):
print(tugi)
break
if(len(hoge_b)==0 and tugi=="B"):
print(tugi)
break
if(len(hoge_c)==0 and tugi=="C"):
print(tugi)
break |
s981365202 | p03998 | u777028980 | 1554491961 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 715 | hoge_a=input()
hoge_b=input()
hoge_c=input()
tugi="A"
while 1:
if(tugi=="A"):
if(len(hoge_a)==0):
print("A")
break:
if(hoge_a[0]=="a"):
tugi=="A"
if(hoge_a[0]=="b"):
tugi=="B"
if(hoge_a[0]=="c"):
tugi=="C"
hoge_a=hoge_a[1:]
if(tugi=="B"):
if(len(hoge_b)==0):
print("B")
break:
if(hoge_b[0]=="a"):
tugi=="A"
if(hoge_b[0]=="b"):
tugi=="B"
if(hoge_b[0]=="c"):
tugi=="C"
hoge_b=hoge_b[1:]
if(tugi=="C"):
if(len(hoge_a)==0):
print("C")
break:
if(hoge_c[0]=="a"):
tugi=="A"
if(hoge_c[0]=="b"):
tugi=="B"
if(hoge_c[0]=="c"):
tugi=="C"
hoge_c=hoge_c[1:] |
s377725621 | p03998 | u585482323 | 1554158122 | Python | PyPy3 (2.4.0) | py | Runtime Error | 188 | 38512 | 1463 | #!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
l = [None for i in range(n)]
for i in range(n):l[i] = I()
return l
def LIR(n):
l = [None for i in range(n)]
for i in range(n):l[i] = LI()
return l
def SR(n):
l = [None for i in range(n)]
for i in range(n):l[i] = S()
return l
def LSR(n):
l = [None for i in range(n)]
for i in range(n):l[i] = SR()
return l
mod = 1000000007
#A
"""
a,b,h = IR(3)
print(((a+b)*h)//2)
"""
#B
s = SR(3)
i = 0
while 1:
if len(s[i]) == 0:
if i == 0:print("A")
if i == 1:print("B")
if i == 2:print("C")
quit()
if x == "a":i = 0
if x == "b":i = 1
if x == "c":i = 2
#C
#D
"""
h,w,n = LI()
dp = [0 for i in range(10)]
dp[0] = (h-2)*(w-2)
q = defaultdict(int)
for i in range(n):
a,b = LI()
a -= 1
b -= 1
for i in [-1,0,1]:
for j in [-1,0,1]:
if 0 < a+i < h-1 and 0 < b+j < w-1:
q[(a+i)*w+b+j] += 1
dp[q[(a+i)*w+b+j]] += 1
dp[q[(a+i)*w+b+j]-1] -= 1
for i in dp:
print(i)
"""
#E
#F
#G
#H
#I
#J
#K
#L
#M
#N
#O
#P
#Q
#R
#S
#T
|
s721574906 | p03998 | u585482323 | 1554158021 | Python | PyPy3 (2.4.0) | py | Runtime Error | 205 | 40176 | 1468 | #!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
l = [None for i in range(n)]
for i in range(n):l[i] = I()
return l
def LIR(n):
l = [None for i in range(n)]
for i in range(n):l[i] = LI()
return l
def SR(n):
l = [None for i in range(n)]
for i in range(n):l[i] = S()
return l
def LSR(n):
l = [None for i in range(n)]
for i in range(n):l[i] = SR()
return l
mod = 1000000007
#A
"""
a,b,h = IR(3)
print(((a+b)*h)//2)
"""
#B
s = SR(3)
i = 0
while 1:
x = s[i].pop(0)
if len(s[i]) == 0:
if i == 0:print("A")
if i == 1:print("B")
if i == 2:print("C")
if x == "a":i = 0
if x == "b":i = 1
if x == "c":i = 2
#C
#D
"""
h,w,n = LI()
dp = [0 for i in range(10)]
dp[0] = (h-2)*(w-2)
q = defaultdict(int)
for i in range(n):
a,b = LI()
a -= 1
b -= 1
for i in [-1,0,1]:
for j in [-1,0,1]:
if 0 < a+i < h-1 and 0 < b+j < w-1:
q[(a+i)*w+b+j] += 1
dp[q[(a+i)*w+b+j]] += 1
dp[q[(a+i)*w+b+j]-1] -= 1
for i in dp:
print(i)
"""
#E
#F
#G
#H
#I
#J
#K
#L
#M
#N
#O
#P
#Q
#R
#S
#T
|
s877184577 | p03998 | u143318682 | 1554038133 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 348 | # -*- coding: utf-8 -*-
S = []
for i in range(3):
S.append(input())
for i in range(3):
S[i] = S[i].replace('a', '0').replace('b', '1').replace('c', '2')
idx = int(S[0][0])
S[0] = S[0][1:]
while True:
tmp = int(S[idx][0])
S[idx] = S[idx][1:]
idx = tmp
if S[idx] == '':
print(['A', 'B', 'C'][idx])
break
|
s624738673 | p03998 | u143318682 | 1554037405 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 449 | # -*- coding: utf-8 -*-
S = []
for i in range(3):
S.append(input())
for i in range(3):
S[i] = S[i].replace('a', '0').replace('b', '1').replace('c', '2')
idx = int(S[0][0])
S[0] = S[0][1:]
while True:
tmp = int(S[idx][0])
S[tmp] = S[tmp][1:]
idx = tmp
if len(S[0]) == 0:
print('A')
break
elif len(S[1]) == 0:
print('B')
break
elif len(S[2]) == 0:
print('C')
break
|
s157908098 | p03998 | u143318682 | 1554037096 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 437 | # -*- coding: utf-8 -*-
S = []
for i in range(3):
S.append(input())
for i in range(3):
S[i] = S[i].replace('a', '0').replace('b', '1').replace('c', '2')
idx = int(S[0][0])
S[0] = S[0][1:]
while True:
tmp = int(S[idx][0])
S[tmp] = S[tmp][1:]
idx = tmp
if len([i for i, x in enumerate(S) if len(x) == 0]) == 1:
print(['A', 'B', 'C'][int([i for i, x in enumerate(S) if len(x) == 0][0])])
break
|
s065502409 | p03998 | u714533789 | 1553828397 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 166 | s=[input().replace('a','0').replace('b','1').replace('c','2') for _ in '111'];
while True:
t=int(s[t][0])
s[t]=s[t][1:]
if len(s[t])==0:
print('ABC'[t])
exit() |
s365178380 | p03998 | u785989355 | 1553748891 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 451 |
Sa = input()
Sb = input()
Sc = input()
flg=True
nxt = "a"
while flg:
if nxt=="a":
if len(Sa)==0:
break
winner = "A"
nxt = Sa[0]
Sa=Sa[1:]
elif nxt=="b":
if len(Sb)==0:
break
winner = "B"
nxt = Sb[0]
Sb=Sb[1:]
elif nxt=="c":
if len(Sc)==0:
break
winner = "C"
nxt = Sc[0]
Sc=Sc[1:]
print(winner) |
s530749552 | p03998 | u785989355 | 1553748842 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 463 |
Sa = input()
Sb = input()
Sc = input()
flg=True
nxt = "a"
while flg:
if nxt=="a":
if len(Sa)==0:
flg=False
winner = "A"
nxt = Sa[0]
Sa=Sa[1:]
elif nxt=="b":
if len(Sb)==0:
flg=False
winner = "B"
nxt = Sb[0]
Sb=Sb[1:]
elif nxt=="c":
if len(Sc)==0:
flg=False
winner = "C"
nxt = Sc[0]
Sc=Sc[1:]
print(winner) |
s934074145 | p03998 | u363610900 | 1553672351 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 434 | A = input()
B = input()
C = input()
turn = A[0]
while True:
if turn == 'a':
if len(A) == 0:
print('A')
break
turn = A[0]
A = A[:-1]
if turn == 'b':
if len(sb) == 0:
print('B')
break
turn = B[0]
B = B[:-1]
if turn == 'c':
if len(sc) == 0:
print('C')
break
turn = C[0]
C = C[:-1] |
s863580598 | p03998 | u363610900 | 1553126101 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 490 | b = input()
c = input()
sa = [i for i in a]
sb = [i for i in b]
sc = [i for i in c]
turn = sa[0]
while True:
if turn == 'a':
if len(sa) == 0:
print('A')
break
turn = sa[0]
sa.pop(0)
if turn == 'b':
if len(sb) == 0:
print('B')
break
turn = sb[0]
sb.pop(0)
if turn == 'c':
if len(sc) == 0:
print('C')
break
turn = sc[0]
sc.pop(0)
|
s281548035 | p03998 | u280512618 | 1552945211 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 298 | from collections import deque
def solve(top, sa, sb, sc):
if len(s[top]) == 0:
return top.upper()
top = s[top].popleft()
return solve(top, sa, sb, sc)
s = {}
s['a'] = deque(input())
s['b'] = deque(input())
s['c'] = deque(input())
top = s['a'].popleft()
print(solve(top, sa, sb, sc))
|
s026275213 | p03998 | u280512618 | 1552944933 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3444 | 289 | from collections import deque
def solve(top, sa, sb, sc):
if len(s[top]) == 0:
return top
top = s[top].popleft()
return solve(top, sa, sb, sc)
s = {}
s['a'] = deque(input())
s['b'] = deque(input())
s['c'] = deque(input())
top = s['a'].popleft()
print(solve(top, sa, sb, sc)) |
s052142671 | p03998 | u518042385 | 1552928318 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 257 | a=input()
b=input()
c=input()
t="a"
while a!=[] and b!=[] and c!=[]:
if t=="a":
t=a[0]
del a[0]
elif t=="b":
t=b[0]
del b[0]
else:
t=c[0]
del c[0]
if a==[]:
print("A")
elif b==[]:
print("B")
else:
print("C")
|
s265260395 | p03998 | u393512980 | 1552798400 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38768 | 333 | A = list(input())
B = list(input())
C = list(input())
next = A.pop(0)
while 1:
if next == 'a':
next = A.pop(0)
elif next == 'b':
next = B.pop(0)
else:
next = C.pop(0)
if len(A) == 0:
print("A")
break
elif len(B) == 0:
print("B")
break
elif len(C) == 0:
print("C")
break
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.