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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s139165396 | p03998 | u771167374 | 1600539954 | Python | PyPy3 (7.3.0) | py | Runtime Error | 126 | 74648 | 386 | A = list(input())
B = list(input())
C = list(input())
s = A.pop(0)
while True:
if A == [] and s == 'a':
print('A')
exit()
if B == [] and s == 'b':
print('B')
exit()
if C == [] and s == 'c':
print('C')
exit()
if s == 'a':
s = A.pop(0)
if s == 'b':
s = B.pop(0)
if s == 'c':
s = C.pop(0) |
s235244252 | p03998 | u624613992 | 1599451528 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9068 | 408 | sa = list(input())
sb = list(input())
sc = list(input())
start = sa.pop(0)
for i in range(399):
if len(sa) == 0 and start == "a" :
print("A")
exit()
if len(sb) == 0 and start == "b":
print("B")
exit()
if len(sc) == 0 and start == "c":
print("C")
exit()
if start == "a":
start = sa.pop(0)
if start == "b":
start = sb.pop(0)
if start == "c":
start = sc.pop(0)
|
s721211938 | p03998 | u624613992 | 1599451333 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9016 | 338 | sa = input()
sb = input()
sc = input()
start = sa.pop(0)
for i in range(399):
if len(sa) == 0 :
print("A")
exit()
if len(sb) == 0:
print("B")
exit()
if len(sc) == 0:
print("C")
exit()
if start == "a":
start = sa.pop(0)
if start == "b":
start = sb.pop(0)
if start == "c":
start = sc.pop(0) |
s332841783 | p03998 | u705418271 | 1599358936 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9040 | 138 | s={'a': input(), 'b': input(), 'c' input()}
now='a'
while s[now]!="":
next =s[now][0]
s[now]=s[now][1:]
now= next
print(now.upper()) |
s609832655 | p03998 | u705418271 | 1599357184 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8932 | 317 | a=str(input())
b=str(input())
c=str(input())
x=a[1]
a=a[1:]
while True:
if x=='a':
x=a[1]
a=a[1:]
if len(a)==0:
print("A")
break
elif x=='b':
x=b[1]
b=b[1:]
if len(b)==0:
print("B")
break
else:
x=c[1]
c=c[1:]
if len(c)==0:
print("C")
break |
s580941024 | p03998 | u250734103 | 1599338987 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9104 | 240 | d = { 'a':input(), 'b':input(), 'c':input() }
pointer = 'a'
while True:
if 0 < len(d[pointer]):
tmp = d[pointer][0]
d[pointer] = s[pointer][1:]
pointer = tmp
else:
print(pointer.upper())
break |
s325665571 | p03998 | u250734103 | 1599338316 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9128 | 267 | SA = input()
SB = input()
SC = input()
pointer = SA[0]
SA = SA[1:]
d = {'a': SA, 'b': SB, 'c': SC}
while True:
tmp = d[pointer][0]
d[pointer] = d[pointer][1:]
pointer = tmp
if d[pointer] == '':
ans = pointer
break
print(ans.upper()) |
s003591664 | p03998 | u801274036 | 1599086261 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9152 | 469 | a = [int(input()) for i in range(3)]
S_a = a[0].split()
S_b = a[1].split()
S_c = a[2].split()
card_dict = {'a':S_a, 'b':S_b, 'c':S_c}
first_card = card_dict['a'][0]
card_dict['a'] = S_a[1:]
next_turn = first_card
stop_flag = 0
winner = 'z'
while(stop_flag == 0):
temp_card = card_dict[next_turn][0]
if not temp_card:
stop_flag = 1
winner = temp_card.upper()
else:
next_turn = temp_card
card_dict[next_turn] = card_dict[next_turn][1:]
print(winner) |
s401563745 | p03998 | u980753441 | 1598998034 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8992 | 226 | S = Sa
card = S.pop(0)
while True:
if card == 'a':
S = Sa
if card == 'b':
S = Sb
if card == 'c':
S = Sc
try:
card = S.pop(0)
except:
print(card.upper())
break |
s933271360 | p03998 | u460745860 | 1598909817 | Python | Python (3.8.2) | py | Runtime Error | 33 | 9348 | 505 | # ABC045
from collections import deque
S_A = deque(input())
S_B = deque(input())
S_C = deque(input())
next_turn = S_A.pop()
while True:
if next_turn == 'a':
next_turn = S_A.pop()
elif next_turn == 'b':
next_turn = S_B.pop()
else:
next_turn = S_C.pop()
# 勝利判定
if len(S_A) == 0:
print("A")
exit()
elif len(S_B) == 0:
print("B")
exit()
elif len(S_C) == 0:
print("C")
exit()
else:
pass
|
s632798704 | p03998 | u909716307 | 1598560287 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8928 | 386 | a=input()
b=input()
c=input()
i=1
j=0
k=0
p=a[0]
while 1:
if p=='a':
if i==len(a)-1:
print('A')
break
i+=1
p=a[i]
elif p=='b':
if j==len(b)-1:
print('B')
break
j+=1
p=b[j]
elif p=='c':
if k==len(c)-1:
print('C')
break
k+=1
p=c[k]
|
s179751597 | p03998 | u894694822 | 1598445605 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 68812 | 340 | a=list(input())
b=list(input())
c=list(input())
next=a.pop(0)
while True:
if next=="a":
if not a:
print("A")
break
else:
next=a.pop(0)
elif next=="b":
if not b:
print("B")
break
else:
next=b.pop(0)
else :
if not b:
print("C")
break
else:
next=c.pop(0)
|
s502020790 | p03998 | u468972478 | 1598192346 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8840 | 89 | S = {i: input() for i in "abc"}
n = "a"
while S[n]:
n = S[n].pop(0)
print(n.upper()) |
s387324871 | p03998 | u468972478 | 1598191847 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8888 | 101 | S = [n: list(input()) for n in "abc"]
i = "a"
while S[i]:
i = S[i].pop(0)
print(i.upper())
|
s683539823 | p03998 | u895918162 | 1596474364 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8912 | 750 | alice = input()
bob = input()
charlie = input()
for i in range(len(alice)):
if alice[i] == "a":
while alice[i] == "a":
alice.pop(i)
elif alice[i] == "b":
alice.pop(i)
if bob[i] == "b":
while bob[i] == "b":
bob.pop(i)
elif bob[i] == "a":
while bob[i] == "a":
alice.pop(i)
elif bob[i] == "c":
while bob[i] == "c":
charlie.pop(i)
elif alice[i] == "c":
alice.pop(i)
if charlie[i] == "c":
while charlie[i] == "c":
charlie.pop(i)
elif charlie[i] == "b":
while charlie[i] == "b":
bob.pop(i)
elif charlie[i] == "a":
while charlie[i] == "a":
alice.pop(i)
for i in range(len(alice)):
if len(alice) == 0 and alice[ |
s437297138 | p03998 | u250662864 | 1596450743 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8820 | 437 | alice = list(input())
bob = list(input())
charlie = list(input())
current = alice
while(len(alice) > 0 and len(bob) > 0 and len(charlie) > 0):
if(current[0] == 'a'):
del current[0]
current = alice
elif(current[0] == 'b'):
del current[0]
currrent = bob
elif(current[0] == 'c'):
del current[0]
current = charlie
if(len(alice) == 0):
print('A')
elif(len(bob) == 0):
print('B')
elif(len(charlie) == 0):
print('C') |
s810351965 | p03998 | u200245833 | 1596376815 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9064 | 383 | a = list(input())
b = list(input())
c = list(input())
# print('a',a)
# print('b',b)
# print('c',c)
# exit()
ptr = 'a'
while (True):
if ptr == 'a':
ptr = a.pop(0)
if ptr == 'b':
ptr = b.pop(0)
if ptr == 'c':
ptr = c.pop(0)
if ptr == 'a' and a == []:
print('A')
break
elif ptr == 'b' and b == []:
print('B')
break
elif ptr == 'c' and c == []:
print('C')
break |
s466517065 | p03998 | u684743124 | 1595399459 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9052 | 161 | mb=input()
mc=input()
mdic={"a":ma,"b":mb,"c":mc}
m="a"
ndic={"a":0,"b":-1,"c":-1}
while ndic[m]<len(mdic[m]):
m=mdic[m][ndic[m]]
ndic[m]+=1
print(m.upper()) |
s079778578 | p03998 | u350093546 | 1595383616 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74516 | 379 | a=list(input())
b=list(input())
c=list(input())
order='a'
while True:
if order='a':
order=a[0]
if len(a)==1:
print('A')
break
else:
a=a[1:]
elif order='b':
order=b[0]
if len(b)==1:
print('B')
break
else:
b=b[1:]
elif order='c':
order=c[0]
if len(c)==1:
print('C')
break
else:
c=c[1:] |
s690778089 | p03998 | u684743124 | 1595342192 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8968 | 175 | ma=input()
mb=input()
mc=input()
mdic={"a":ma,"b":mb,"c":mc}
m="a"
i=0
ndic={"a":0,"b":0,"c":0}
while ndic[m]=<len(mdic[m]):
m=mdic[m][ndic[m]]
ndic[m]+=1
print(m.upper()) |
s580631282 | p03998 | u326552320 | 1594956130 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9416 | 1050 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: B
# CreatedDate: 2020-07-16 23:00:42 +0900
# LastModified: 2020-07-16 23:21:33 +0900
#
from collections import deque
def main():
s_a = input()
s_b = input()
s_c = input()
s_a = [s for s in s_a if s != 'a']
s_b = [s for s in s_b if s != 'b']
s_c = [s for s in s_c if s != 'c']
s_a = deque(s_a)
s_b = deque(s_b)
s_c = deque(s_c)
turn = s_a.popleft()
ans = -1
while 1:
if turn == 'a' and s_a:
turn = s_a.popleft()
elif turn == 'b' and s_b:
turn = s_b.popleft()
elif turn == 'c' and s_c:
turn = s_c.popleft()
elif turn == 'a' and not s_a:
ans = 0
break
elif turn == 'b' and not s_b:
ans = 1
break
elif turn == 'c' and not s_c:
ans = 2
break
if ans == 0:
print("A")
elif ans == 1:
print("B")
else:
print("C")
if __name__ == "__main__":
main()
|
s921783446 | p03998 | u326552320 | 1594955899 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9084 | 1011 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: B
# CreatedDate: 2020-07-16 23:00:42 +0900
# LastModified: 2020-07-16 23:18:00 +0900
#
import os
import sys
# import numpy as np
# import pandas as pd
def main():
s_a = input()
s_b = input()
s_c = input()
s_a = [s for s in s_a if s != 'a']
s_b = [s for s in s_b if s != 'b']
s_c = [s for s in s_c if s != 'c']
turn = s_a.pop(0)
ans = -1
while 1:
if turn == 'a' and s_a:
turn = s_a.pop(0)
elif turn == 'b' and s_b:
turn = s_b.pop(0)
elif turn == 'c' and s_c:
turn = s_c.pop(0)
elif turn == 'a' and not s_a:
ans = 0
break
elif turn == 'b' and not s_b:
ans = 1
break
elif turn == 'c' and not s_c:
ans = 2
break
if ans == 0:
print("A")
elif ans == 1:
print("B")
else:
print("C")
if __name__ == "__main__":
main()
|
s643790804 | p03998 | u326552320 | 1594955826 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9072 | 1023 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: B
# CreatedDate: 2020-07-16 23:00:42 +0900
# LastModified: 2020-07-16 23:16:42 +0900
#
import os
import sys
# import numpy as np
# import pandas as pd
def main():
s_a = input()
s_b = input()
s_c = input()
s_a = [s for s in s_a if s is not 'a']
s_b = [s for s in s_b if s is not 'b']
s_c = [s for s in s_c if s is not 'c']
turn = s_a.pop(0)
ans = -1
while 1:
if turn == 'a' and s_a:
turn = s_a.pop(0)
elif turn == 'b' and s_b:
turn = s_b.pop(0)
elif turn == 'c' and s_c:
turn = s_c.pop(0)
elif turn == 'a' and not s_a:
ans = 0
break
elif turn == 'b' and not s_b:
ans = 1
break
elif turn == 'c' and not s_c:
ans = 2
break
if ans == 0:
print("A")
elif ans == 1:
print("B")
else:
print("C")
if __name__ == "__main__":
main()
|
s053289798 | p03998 | u081149041 | 1594939903 | Python | Python (3.8.2) | py | Runtime Error | 21 | 8944 | 972 | def play():
card_a = input()
card_b = input()
card_c = input()
s = 0
while 1:
if s == 0:
if card_a[0] == a:
s = 0
if card_a[0] == b:
s = 1
if card_a[0] == c:
s = 2
card_a = card_a[1:]
if card_a == "":
print("A")
break
if s == 1:
if card_b[0] == a:
s = 0
if card_b[0] == b:
s = 1
if card_b[0] == c:
s = 2
card_b = card_b[1:]
if card_b == "":
print("B")
break
if (s == 2)
if card_c[0] == a:
s = 0
if card_c[0] == b:
s = 1
if card_c[0] == c:
s = 2
card_c = card_c[1:]
if card_c == "":
print("C")
break
play() |
s037608481 | p03998 | u081149041 | 1594939816 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8996 | 972 | def play():
card_a = input()
card_b = input()
card_c = input()
s = 0
while 1:
if s == 0:
if card_a[0] == a:
s = 0
if card_a[0] == b:
s = 1
if card_a[0] == c:
s = 2
card_a = card_a[1:]
if card_a == "":
print("A")
break
if s == 1:
if card_b[0] == a:
s = 0
if card_b[0] == b:
s = 1
if card_b[0] == c:
s = 2
card_b = card_b[1:]
if card_a == "":
print("B")
break
if (s == 2)
if card_c[0] == a:
s = 0
if card_c[0] == b:
s = 1
if card_c[0] == c:
s = 2
card_c = card_c[1:]
if card_a == "":
print("C")
break
play() |
s619059614 | p03998 | u081149041 | 1594939591 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8900 | 612 | def play():
card_a = input()
card_b = input()
card_c = input()
s = 0
while 1:
if s == 0:
s = card_a[0] - 48
card_a = card_a[1:]
if card_a == "":
print("A")
break
if s == 1:
s = card_b[0] - 48
card_b = card_b[1:]
if card_a == "":
print("B")
break
if (s == 2)
s = card_c[0] - 48
card_c = card_c[1:]
if card_a == "":
print("C")
break
def test():
play()
test() |
s127122595 | p03998 | u452337391 | 1594877088 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9052 | 415 | S = [input() for _ in range(3)]
for i in range(3):
S[i] = list(S[i])
p = 0 #プレイヤー
while True:
if not S[0] and p == 0:
print("A")
break
if not S[1] and p == 1:
print("B")
break
if not S[2] and p == 3:
print("C")
break
p_t = S[p].pop(0)
if p_t == "a":
p = 0
elif p_t == "b":
p = 1
elif p_t == "c":
p = 2 |
s369786755 | p03998 | u586639900 | 1594448994 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8928 | 178 | S = dict()
S['a'] = input()[::-1]
S['b'] = input()[::-1]
S['c'] = input()[::-1]
player = 'a'
while S[player]:
player = S[player].pop()
res = player.upper()
print(res)
|
s509816597 | p03998 | u062999487 | 1594235660 | Python | PyPy3 (7.3.0) | py | Runtime Error | 94 | 74616 | 62 | N,K=map(int,input().split())
ans = (K-1)**(N-1)*K
print(ans) |
s776298831 | p03998 | u849029577 | 1594169758 | Python | PyPy3 (7.3.0) | py | Runtime Error | 83 | 74824 | 354 | s = [list(input()) for i in range(3)]
turn = s[0]
for i in range(300):
if "a" == turn.pop(0):
turn = s[0]
elif "b" == turn.pop(0):
turn = s[1]
else:
turn = s[2]
if not s[0]:
print("A")
exit()
if not s[1]:
print("B")
exit()
if not s[2]:
print("C")
exit() |
s867583426 | p03998 | u168416324 | 1594039642 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8956 | 182 | lis=[]
ll=["a","b","c"]
for i in range(3):
lis.append(list(input()))
turn=0
while 1:
x=ll.index(lis[turn].pop())
if lis[turn]=[]:
print(ll[turn].upper())
break
turn=x |
s392695587 | p03998 | u697615293 | 1593387309 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9092 | 590 | a = list(input())
b = list(input())
c = list(input())
x = "d"
a_idx = 0
b_idx = 0
c_idx = 0
while True:
if x == "a":
if a_idx == len(a):
print("A")
break
else:
x = str(a[a_idx])
a_idx += 1
elif x == "b":
if b_idx == len(b):
print(B)
break
else:
x = str(b[b_idx])
b_idx += 1
elif x == "c":
if c_idx == len(c):
print("C")
break
else:
x = str(c[c_idx])
c_idx += 1
else:
x = "a" |
s589816948 | p03998 | u697615293 | 1593358104 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9096 | 478 | a = list(input())
b = list(input())
c = list(input())
x = "d"
a_idx = 0
b_idx = 0
c_idx = 0
while a_idx != len(a) -1 and b_idx != len(b) -1 and c_idx != len(c) -1:
if x == "a":
x = str(a[a_idx])
a_idx += 1
elif x == "b":
x = str(b[b_idx])
b_odx += 1
elif x == "c":
x = str(c[c_idx])
c_idx += 1
else:
x = "a"
if a_idx == len(a) -1 :
print("A")
elif b_idx == len(b)-1:
print("B")
else:
print("C") |
s514248822 | p03998 | u088488125 | 1593312768 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8936 | 312 | for i in range(3):
s.append(input())
member=["A","B","C"]
turn=0
while True:
if s[turn]=="":
winner=turn
break
elif s[turn][0]=="a":
s[turn]=s[turn][1:]
turn=0
elif s[turn][0]=="b":
s[turn]=s[turn][1:]
turn=1
else:
s[turn]=s[turn][1:]
turn=2
print(member[winner])
|
s876203419 | p03998 | u891847179 | 1593135209 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8908 | 879 | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
struct Edge {
ll to;
ll cost;
};
int main() {
string sa, sb, sc;
cin >> sa >> sb >> sc;
char now = 'a';
while (true) {
if (now == 'a') {
if (sa.size() == 0) {
cout << 'A' << endl;
return 0;
}
now = sa[0];
sa.erase(sa.begin());
} else if (now == 'b') {
if (sb.size() == 0) {
cout << 'B' << endl;
return 0;
}
now = sb[0];
sb.erase(sb.begin());
} else {
if (sc.size() == 0) {
cout << 'C' << endl;
return 0;
}
now = sc[0];
sc.erase(sc.begin());
}
}
}
|
s795346119 | p03998 | u350093546 | 1592601500 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9000 | 220 | a=list(input())
b=list(input())
c=list(input())
x=a
y=''
While True:
y=x[0]
x.pop(0)
x=y
if len(a)==0:
print('A'):
break
if len(b)==0:
print('B')
break
if len(c)==0:
print('C')
break |
s557449626 | p03998 | u583799976 | 1592535948 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8888 | 512 | A=input()
B=input()
C=input()
l='a'
for i in range(300):
if l=='a':
if len(A)==0:
print('A')
exit()
elif len(A)==1:
l=A[0]
A=''
else:
l=A[0]
A=A[1:]
elif l=='b':
l=B[0]
if len(B)==0:
print('B')
exit()
elif len(B)==1:
l=B[0]
B=''
else:
l=B[0]
B=B[1:]
else:
l=C[0]
if len(C)==0:
print('C')
exit()
elif len(C)==1:
l=C[0]
C=''
else:
l=C[0]
C=C[1:] |
s147264000 | p03998 | u289876798 | 1592169463 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38256 | 394 | #! env python
# -*- coding: utf-8 -*-
import os
import sys
# ac_py.main
# Date: 2020/06/14
# Filename: main
# Author: acto_mini
def main():
N, K = map(int, input().split())
# all = K ** N
# out_single, out_multi = 0, 0
# for i in range(2, N + 1):
# out_multi += (N - i + 1) * K
print(K * ((K - 1) ** (N - 1)))
return
if __name__ == '__main__':
main()
|
s528645123 | p03998 | u942280986 | 1592085207 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 258 | a=input()
b=input()
c=input()
for i in a:
while a[i]=='a':
i+=1
elif a[i]='b':
for i in b:
while b[i]=='b':
i+=1
else:
for i in c:
while c[i]=='c':
i+=1
|
s671214556 | p03998 | u247830763 | 1591899101 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 501 | import sys
sa = list(input())
sb = list(input())
sc = list(input())
sa = sa[::-1]
sb = sb[::-1]
sc = sc[::-1]
p = "a"
while True:
if p == "a":
p = sa.pop(-1)
if len(sa) == 0 and p == "a":
print("A")
sys.exit()
elif p == "b":
p = sb.pop(-1)
if len(sb) == 0 and p == "b":
print("B")
sys.exit()
else:
p = sc.pop(-1)
if len(sc) == 0 and p == "c":
print("C")
sys.exit()
|
s032983570 | p03998 | u222668979 | 1591821286 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 230 | strin = [input(), input(), input()]
l = ['a','b','c']
cnt, nxt = [0, 0, 0], 0
while True:
lttr = strin[nxt][cnt[nxt]]
cnt[nxt] += 1
if cnt[nxt] >= len(strin[nxt]):
print(l[nxt].upper())
nxt = l.index(lttr)
|
s727223583 | p03998 | u806403461 | 1591759227 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 445 | SA = list(input())
SB = list(input())
SC = list(input())
LenSA = len(SA)
LenSB = len(SB)
LenSC = len(SC)
NowCard = SA.pop()
while True:
if NowCard == 'a':
NowList = SA
elif NowCard == 'b':
NowList = SB
elif NowCard == 'c':
NowList = SC
NowCard = NowList.pop()
if SA == [] or SB == [] or SC == []:
break
if SA == []:
print('A')
if SB == []:
print('B')
if SC == []:
print('C')
|
s973224098 | p03998 | u822179469 | 1591757840 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 442 | sa, sb, sc = [input() for i in range(3)]
sa, sb, sc = list(sa),list(sb),list(sc)
i = sa.pop(0)
while True :
if i =='a':
if lem(sa) ==0:
print(sa)
exit()
i = sa.pop(0)
if i =='b':
if lem(sb) ==0:
print(sb)
exit()
i = sb.pop(0)
if i =='c':
if lem(sc) ==0:
print(sc)
exit()
i = sc.pop(0)
|
s339262965 | p03998 | u822179469 | 1591757386 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 431 | sa, sb, sc = [input() for i in range(3)]
sa, sb, sc = list(sa),list(sb),list(sc)
i = sa.pop(0)
while len(sa) != 0 and len(sb) != 0 and len(sb) != 0 :
if i =='a':
i = sa.pop(0)
continue
elif i =='b':
i = sb.pop(0)
continue
elif i =='c':
i = sc.pop(0)
continue
if len(sa) == 0:
print('A')
elif len(sb) == 0:
print('B')
elif len(sc) == 0:
print('C') |
s704626113 | p03998 | u822179469 | 1591757320 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 453 | sa, sb, sc = [input() for i in range(3)]
sa, sb, sc = list(sa),list(sb),list(sc)
i = sa.pop(0)
while len(sa) != 0 and len(sb) != 0 and len(sb) != 0 :
print(sa,sb,sc,i)
if i =='a':
i = sa.pop(0)
continue
elif i =='b':
i = sb.pop(0)
continue
elif i =='c':
i = sc.pop(0)
continue
if len(sa) == 0:
print('A')
elif len(sb) == 0:
print('B')
elif len(sc) == 0:
print('C') |
s854434300 | p03998 | u822179469 | 1591756209 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 368 | sa, sb, sc = [input() for i in range(3)]
sa, sb, sc = list(sa),list(sb),list(sc)
i = sa.pop(0)
while len(sa) != 0 and len(sb) != 0 and len(sb) != 0 :
if i =='a':
i = sa.pop(0)
if i =='b':
i = sb.pop(0)
if i =='c':
i = sc.pop(0)
if len(sa) == 0:
print('A')
elif len(sb) == 0:
print('B')
elif len(sc) == 0:
print('C') |
s726780650 | p03998 | u957957759 | 1591674146 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 431 | a=input()
b=input()
c=input()
l=a+b+c
n=a[0]
a=a.lstrip(n)
for i in range(len(l)-1):
if n=='a':
if len(a)==0:
print('A')
break
n=a[0]
a=a.lstrip(n)
elif x=='b':
if len(b)==0:
print('B')
break
n=b[0]
b=b.lstrip(n)
else:
if len(c)==0:
print('C')
break
n=c[0]
c=c.lstrip(n)
|
s711504810 | p03998 | u641446860 | 1591585963 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 547 | A, B, C = [input() for _ in range(3)]
ca = 1
cb = 0
cc = 0
current = A[0]
while True:
if current == 'a':
ca += 1
if ca == len(A):
print('A')
break
else:
current = A[ca]
elif current == 'b':
cb += 1
if cb == len(B):
print('B')
break
else:
current = B[cb]
elif current == 'c':
cc += 1
if cc == len(C):
print('C')
break
else:
current = C[cc]
|
s924752934 | p03998 | u492749916 | 1591513034 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 455 | sa = str(input())
sb = str(input())
sc = str(input())
dest = sa[0]
sa = sa[1:]
for i in range(0,len(sa)+len(sb)+len(sc)):
if dest == "a":
dest = str(sa[0])
if len(sa) ==1:
flag = "A"
else:
sa = sa[1:]
elif dest == "b":
dest = str(sb[0])
if len(sb) ==1:
flag = "B"
else:
sb = sb[1:]
elif dest == "c":
dest = str(sc[0])
if len(sc) ==1:
flag = "C"
else:
sc = sc[1:]
print(flag) |
s045352907 | p03998 | u757274384 | 1591406926 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 470 | # -*- coding : utf-8 -*-
A = list(input())
B = list(input())
C = list(input())
X = [A,B,C]
x = 0
while True :
if X[x][0] == "a":
if X[0] == []:
print("A")
break
else:
X[0].remove(X[0][0])
x = 0
elif X[x][0] == "b":
if X[1] == []:
print("B")
break
else:
X[1].remove(X[1][0])
x = 1
elif X[x][0] == "c":
if X[2] == []:
print("C")
break
else:
X[2].remove(X[2][0])
x = 2 |
s002869096 | p03998 | u757274384 | 1591406759 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 488 | # -*- coding : utf-8 -*-
A = list(input())
B = list(input())
C = list(input())
X = [A,B,C]
x = 0
while True :
if X[x][0] == "a":
if X[0] == []:
print("A")
break
else:
X[0].remove(X[0][0])
x == 0
elif X[x][0] == "b":
if X[1] == []:
print("B")
break
else:
X[1].remove(X[1][0])
x == 1
elif X[x][0] == "c":
if X[2] == []:
print("C")
break
else:
X[2].remove(X[2][0])
x == 2
|
s379831401 | p03998 | u048176319 | 1591266835 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 314 | sa = str(input()) + "d"
sb = str(input()) + "d"
sc = str(input()) + "d"
s = sa
sa = sa[1:]
while s != "d":
x = s[0]
if x == "a":
sa = sa[1:]
s = sa
elif x == "b":
sb = sb[1:]
s = sb
elif x == "c":
sc = sc[1:]
s = sc
if sa == "d":
print("A")
elif sb == "d":
print("B")
elif sc == "d":
print("C")
|
s384059420 | p03998 | u663767599 | 1591187567 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3444 | 506 | from collections import deque
A = deque(input())
B = deque(input())
C = deque(input())
current = A.popleft()
while True:
if current == "a":
current = A.popleft()
elif current == "b":
current = B.popleft()
elif current == "c":
current = C.popleft()
if current == "a" and len(A) == 0:
print("A")
break
elif current == "b" and len(B) == 0:
print("B")
break
elif current == "c" and len(C) == 0:
print("C")
break |
s522719661 | p03998 | u552738814 | 1590624469 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 379 | sa = list(reversed(input()))
sb = list(reversed(input()))
sc = list(reversed(input()))
turn = sa.pop()
while True:
if (turn == "a" and not sa) or (turn == "b" and not sb) or (turn == "c" and not sc):
break
elif turn == "a":
turn = sa.pop()
elif turn == "b":
turn = sb.pop()
else turn == "c":
turn = sc.pop()
print(turn.upper())
|
s511618008 | p03998 | u646792990 | 1590617648 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 378 | sa = list(reversed(input()))
sb = list(reversed(input()))
sc = list(reversed(input()))
turn = sa.pop()
while True:
if turn == 'a':
turn = sa.pop()
elif turn == 'b':
turn = sb.pop()
else:
turn = sc.pop()
if (turn == 'a' and not sa) or (
turn == 'b' and not sb) or (turn == 'c' and not sc):
break
print(turn.upper())
|
s255028485 | p03998 | u594956556 | 1590453615 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 292 | S = {}
S['a'] = input()
S['b'] = input()
S['c'] = input()
next = 'a'
lens = {'a':len(S['a']), 'b':len(S['b']), 'c':len(S['c'])}
counts = {'a':0, 'b':0, 'c':0}
while True:
now = next
if counts[now] == lens[now]:
print(now)
exit()
counts[now] += 1
next = S[now][counts[now]]
|
s805125017 | p03998 | u594956556 | 1590453448 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 291 | S = {}
S['a'] = input()
S['b'] = input()
S['c'] = input()
next = 'a'
lens = {'a':len(S['a']), 'b':len(S['b']), 'c':len(S['c'])}
counts = {'a':0, 'b':0, 'c':0}
while True:
now = next
if counts[now] == len[now]:
print(now)
exit()
next = S[now][counts[now]]
counts[now] += 1
|
s907325357 | p03998 | u594956556 | 1590453344 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 284 | S = {}
S['a'] = input()
S['b'] = input()
S['c'] = input()
next = 'a'
lens = {'a':len(S['a']), 'b':len(S['b']), 'c':len(S['c'])}
counts = {'a':0, 'b':0, 'c':0}
while True:
if counts[next] == len[next]:
print(next)
exit()
next = S[next][counts[next]]
counts[next] += 1
|
s206942105 | p03998 | u594956556 | 1590453292 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 278 | S = {}
S['a'] = input()
S['b'] = input()
S['c'] = input()
next = 'a'
lens = {'a':len(S[0]), 'b':len(S[1]), 'c':len(S[2])}
counts = {'a':0, 'b':0, 'c':0}
while True:
if counts[next] == len[next]:
print(next)
exit()
next = S[next][counts[next]]
counts[next] += 1
|
s778284181 | p03998 | u594956556 | 1590453003 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 289 | S = [input() for _ in range(3)]
next = 0
lens = [len(i) for i in S]
counts = [0]*3
while True:
if counts[next] == len[next]:
if next == 0:
print('a')
elif next == 1:
print('b')
else:
print('c')
exit()
next = S[next][counts[next]]
counts[next] += 1 |
s344210613 | p03998 | u344065503 | 1590360248 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38512 | 105 | a=list(input())
b=list(input())
c=list(input())
S=[a,b,c]
s=a
while True:
s=S[s].pop()
print(s.upper()) |
s943858335 | p03998 | u213580455 | 1590104273 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1001 | Alice = 'A'
Bob = 'B'
Charlie = 'C'
def answer(Sa, Sb, Sc):
currentUser = Alice
ai, bi, ci = (0, 0, 0)
while(True):
if currentUser == Alice:
if ai == len(Sa):
return Alice
if Sa[ai] == 'b':
currentUser = Bob
if Sa[ai] == 'c':
currentUser = Charlie
ai += 1
continue
if currentUser == Bob:
if bi == len(Sb):
return Bob
if Sa[bi] == 'a':
currentUser = Alice
if Sa[bi] == 'c':
currentUser = Charlie
bi += 1
continue
if currentUser == Charlie:
if ci == len(Sc):
return Charlie
if Sa[ci] == 'a':
currentUser = Alice
if Sa[ci] == 'b':
currentUser = Bob
ci += 1
continue
Sa = input()
Sb = input()
Sc = input()
print(answer(Sa, Sb, Sc)) |
s807241174 | p03998 | u167647458 | 1590017063 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 389 | s = []
for _ in range(3):
x = input().replace('a', '0').replace('b', '1').replace('c', '2')
s.append(str(x))
now = 0
while True:
if len(s[0])==0:
print('A')
break
elif len(s[1])==0:
print('B')
break
elif len(s[1])==0:
print('C')
break
after = int(s[now][0])
s[now] = s[now][1:]
now = after
|
s489264497 | p03998 | u493130708 | 1590009431 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38256 | 3329 | # -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache
#############
# Constants #
#############
MOD = 10**9+7
INF = float('inf')
#############
# Functions #
#############
######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]
######OUTPUT######
def P(arg): return print(arg)
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()
#####Shorten#####
def DD(arg): return defaultdict(arg)
#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)
######Combination######
kaijo_memo = []
def kaijo(n):
if(len(kaijo_memo) > n):
return kaijo_memo[n]
if(len(kaijo_memo) == 0):
kaijo_memo.append(1)
while(len(kaijo_memo) <= n):
kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
return kaijo_memo[n]
gyaku_kaijo_memo = []
def gyaku_kaijo(n):
if(len(gyaku_kaijo_memo) > n):
return gyaku_kaijo_memo[n]
if(len(gyaku_kaijo_memo) == 0):
gyaku_kaijo_memo.append(1)
while(len(gyaku_kaijo_memo) <= n):
gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
return gyaku_kaijo_memo[n]
def nCr(n,r):
if(n == r):
return 1
if(n < r or r < 0):
return 0
ret = 1
ret = ret * kaijo(n) % MOD
ret = ret * gyaku_kaijo(r) % MOD
ret = ret * gyaku_kaijo(n-r) % MOD
return ret
######Factorization######
def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-n**0.5//1))+1):
if temp%i==0:
cnt=0
while temp%i==0:
cnt+=1
temp //= i
arr.append([i, cnt])
if temp!=1:
arr.append([temp, 1])
if arr==[]:
arr.append([n, 1])
return arr
#####MakeDivisors######
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n//i)
return divisors
#####LCM#####
def lcm(a, b):
return a * b // gcd (a, b)
#####BitCount#####
def count_bit(n):
count = 0
while n:
n &= n -1
count += 1
return count
#####ChangeBase#####
def base_10_to_n(X, n):
if X//n:
return base_10_to_n(X//n, n)+[X%n]
return [X%n]
def base_n_to_10(X, n):
return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))
#####IntLog#####
def int_log(n, a):
count = 0
while n>=a:
n //= a
count += 1
return count
#############
# Main Code #
#############
Sa = S()
Sb = S()
Sc = S()
now = "a":
while True:
if now == "a":
if len(Sa):
now = Sa[0]
Sa = Sa[1:]
else:
P("A")
E()
if now == "b":
if len(Sb):
now = Sb[0]
Sb = Sb[1:]
else:
P("B")
E()
if now == "c":
if len(Sc):
now = Sc[0]
Sc = Sc[1:]
else:
P("C")
E() |
s400296536 | p03998 | u203669169 | 1589996756 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 237 | A = input()
B = input()
C = input()
ABC = {"a":deque(A), "b":deque(B), "c":deque(C)}
ABC_H = {"a":"A", "b":"B", "c":"C"}
ind = A[0]
while True:
if len(ABC[ind]) == 0:
break
ind = ABC[ind].popleft()
print(ABC_H[ind])
|
s534231307 | p03998 | u370852395 | 1589481551 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 436 | s_a=list(input())
s_b=list(input())
s_c=list(input())
tmp =''
tmp=s_a.pop(0)
while 1:
if tmp=='a':
if s_a:
tmp=s_a.pop(0)
else:
print('A')
break
elif tmp=='b':
if s_b:
tmp=s_b.pop(0)
else:
print('B')
break
else tmp=='c':
if s_c:
tmp=s_c.pop(0)
else:
print('C')
break
|
s573648034 | p03998 | u370852395 | 1589481453 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 444 | s_a=list(input())
s_b=list(input())
s_c=list(input())
temp =''
temp=s_a.pop(0)
while 1:
if temp=='a':
if s_a:
temp=s_a.pop(0)
else:
print('A')
break
elif temp=='b':
if s_b:
temp=s_b.pop(0)
else:
print('B')
break
elif temp=='c':
if s_b:
temp=s_c.pop(0)
else:
print('C')
break
|
s167999217 | p03998 | u060793972 | 1589082369 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3060 | 179 | a = list(input()[::-1])
b = list(input()[::-1])
c = list(input()[::-1])
i=a.pop()
while True:
i=eval(i+'.pop()')
if len(eval(i))==0:
print(i.upper())
break |
s646211118 | p03998 | u158570493 | 1588899321 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 152 | a = input()
b = input()
c = input()
player = a
while True:
l = player[0]
player = player[1:]
if len(player) == 0
print(player)
player = l
|
s617799089 | p03998 | u308918401 | 1588714249 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 393 | A=input()
B=input()
C=input()
t=[0,0,0]
flag="a"
while True:
if flag=="a":
if len(A)==t[0]+1:
print("A")
break
else:
flag=A[t[0]]
t[0]+=1
elif flag=="b":
if len(B)==t[1]+1:
print("B")
break
else:
flag=B[t[1]]
t[1]+=1
elif flag=="c":
if len(C)==0:
print("C")
break
else:
flag=C[t[2]]
t[2]+=1
|
s580345280 | p03998 | u308918401 | 1588713867 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 402 | A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
flag="a"
while True:
if flag=="a":
if len(A)==0:
print("A")
break
else:
flag=A.pop(0)
elif flag=="b":
if len(B)==0:
print("B")
break
else:
flag=B.pop(0)
elif flag=="c":
if len(C)==0:
print("C")
break
else:
flag=C.pop(0) |
s089315901 | p03998 | u383450070 | 1588346206 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 473 | a = list(input())
b = list(input())
c = list(input())
moji = a[0]
select = "a"
lengtha = len(a)
lengthb = len(b)
lengthc = len(c)
while True:
if select == "a":
select = a[0]
del a[0]
lengtha -= 1
if lengtha == 0:
print("A")
elif select == "b":
select = b[0]
del b[0]
lengthb -= 1
if lengthb == 0:
print("B")
break;
else:
select = c[0]
del c[0]
lengthc -= 1
if lengthc==0:
print("C")
break; |
s338870280 | p03998 | u199459731 | 1588142705 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1161 | a_list = list(input())
b_list = list(input())
c_list = list(input())
a_turn = True
b_turn = False
c_turn = False
max_battle = len(a_list) + len(b_list) + len(c_list)
for i in range(max_battle):
if(a_turn):
a_list.pop(0)
if(len(a_list) == 0):
print("A")
exit()
else:
if(a_list[0] == 'b'):
a_turn = False
b_turn = True
elif(a_list[0] == 'c'):
a_turn = False
c_turn = True
elif(b_turn):
a_list.pop(0)
if(len(b_list) == 0):
print("B")
exit()
else:
if(b_list[0] == 'a'):
b_turn = False
a_turn = True
elif(b_list[0] == 'c'):
b_turn = False
c_turn = True
elif(c_turn):
c_list.pop(0)
if(len(c_list) == 0):
print("C")
exit()
else:
if(c_list[0] == 'a'):
c_turn = False
a_turn = True
elif(a_list[0] == 'b'):
c_turn = False
b_turn = True
|
s494342303 | p03998 | u199459731 | 1588142658 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1161 | a_list = list(input())
b_list = list(input())
c_list = list(input())
a_turn = True
b_turn = False
c_turn = False
max_battle = len(a_list) + len(b_list) + len(c_list)
for i in range(max_battle):
if(a_turn):
a_list.pop(0)
if(len(a_list) == 0):
print("a")
exit()
else:
if(a_list[0] == 'b'):
a_turn = False
b_turn = True
elif(a_list[0] == 'c'):
a_turn = False
c_turn = True
elif(b_turn):
a_list.pop(0)
if(len(b_list) == 0):
print("b")
exit()
else:
if(b_list[0] == 'a'):
b_turn = False
a_turn = True
elif(b_list[0] == 'c'):
b_turn = False
c_turn = True
elif(c_turn):
c_list.pop(0)
if(len(c_list) == 0):
print("c")
exit()
else:
if(c_list[0] == 'a'):
c_turn = False
a_turn = True
elif(a_list[0] == 'b'):
c_turn = False
b_turn = True
|
s459089912 | p03998 | u199459731 | 1588142619 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1158 | a_list = list(input())
b_list = list(input())
c_list = list(input())
a_turn = True
b_turn = False
c_turn = False
max_battle = len(a_list) + len(b_list) + len(c_list)
for i in range(max_battle):
if(a_turn):
a_list.pop(0)
if(len(a_list) == 0):
print("a")
exit()
else:
if(a_list[0] == 'b'):
a_turn = False
b_turn = True
elif(a_list[0] == 'c'):
a_turn = False
c_turn = True
elif(b_turn):
a_list.pop(0)
if(len(b_list) == 0):
print("b")
exit()
else:
if(b_list[0] == 'a'):
b_turn = False
a_turn = True
elif(b_list[0] == 'c'):
b_turn = False
c_turn = True
elif(c_turn):
c_list.pop(0)
if(len(c_list) == 0):
print("c")
exit()
else:
if(c_list[0] == 'a'):
c_turn = False
a_turn = True
elif(a_list[0] == 'b'):
c_turn = False
b_turn = True
|
s141488179 | p03998 | u095094246 | 1588042148 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 80 | s={i:list(input())for i in'abc'}
i='a'
while d[i]:i=s[i].pop(0)
print(i.upper()) |
s510300172 | p03998 | u095094246 | 1588041479 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 175 | import sys
sa=input()
sb=input()
sc=input()
ss={'a':sa,'b':sb,'c':sc}
t='a'
while True:
t=ss[t][0]
if len(ss[t])==0:
print(t.upper())
sys.exit()
ss[t]=ss[t][1:]
|
s462648526 | p03998 | u252964975 | 1587912138 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 417 | A = str(input())
B = str(input())
C = str(input())
turn = "A"
while True:
if turn == "A":
turn = A[0].upper()
if len(A) == 0:
print(A.upper())
break
A = A[1:len(A)]
elif turn == "B":
turn = B[0].upper()
if len(B) == 0:
print(B.upper())
break
B = B[1:len(B)]
else:
turn = C[0].upper()
if len(C) == 0:
print(C.upper())
break
C = C[1:len(C)] |
s073288481 | p03998 | u252964975 | 1587911219 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 398 | A = str(input())
B = str(input())
C = str(input())
turn = "A"
while True:
if turn = "A":
turn = A[0].upper()
if len(A) == 1:
print(A)
break
A = A[1:len(A)]
if turn = "B":
turn = B[0].upper()
if len(B) == 1:
print(B)
break
B = B[1:len(B)]
if turn = "C":
turn = C[0].upper()
if len(C) == 1:
print(C)
break
C = C[1:len(C)] |
s541279263 | p03998 | u870518235 | 1587762344 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 334 | Sa = str(input())
Sb = str(input())
Sc = str(input())
turn = Sa.pop(0)
while Sa <> [] or Sb <> [] or Sc <> []:
if turn == "a":
turn += Sa.pop(0)
elif turn == "b":
turn += Sb.pop(0)
elif turn == "c":
turn += Sc.pop(0)
if Sa == []:
print("A")
elif Sb == []:
print("B")
else:
print("C") |
s149215241 | p03998 | u724687935 | 1587717482 | Python | PyPy3 (2.4.0) | py | Runtime Error | 166 | 38256 | 258 | from collections import deque
Q = [deque() for _ in range(3)]
for i in range(3):
for s in list(input()):
Q[i].append(ord(s) - ord('a'))
k = Q[0].popleft()
while True:
k = Q[k].popleft()
if len(Q[k]) == 0:
break
print('ABC'[k])
|
s266334991 | p03998 | u068750695 | 1587692140 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 420 | a=input()
b=input()
c=input()
s=[a[0]]
a=a[1:]
for i in range(len(a)+len(b)+len(c)):
if s[-1]=="a":
s.append(a[0])
a=a[1:]
elif s[-1]=="b":
s.append(b[0])
b=b[1:]
else:
s.append(c[0])
c=c[1:]
if (not a and not b) or (not a and not c) or (not b and not c):
break
if s[-1]=="a":
print("A")
elif s[-1]=="b":
print("B")
else:
print("C") |
s956480717 | p03998 | u623349537 | 1587605131 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 501 | S = ["" for i in range(3)]
abc = "ABC"
for i in range(3):
S[i] = input()
turn = 0
zero_card = False
while True:
if len(S[turn]) == 1 and zero_card:
print(abc[turn])
break
else:
if len(S[turn]) == 1:
zero_card = True
next_turn = 0
if S[turn][0] == "a":
next_turn = 0
elif S[turn][0] == "b":
next_turn = 1
else:
next_turn = 2
S[turn] = S[turn][1:]
turn = next_turn |
s290274913 | p03998 | u281610856 | 1587605044 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 948 | from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
from math import pi, gcd, ceil, floor
import numpy as np
from collections import defaultdict, deque
from operator import itemgetter
from bisect import bisect_left, bisect_right, insort_left, insort_right
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10 ** 6)
# MOD = 10 ** 9 + 7
# INF = float("inf")
def main():
qa = deque(input())
qb = deque(input())
qc = deque(input())
s = qa.popleft()
while qa or qb or qc:
if s == 'a':
s = qa.popleft()
if not qa:
print('A')
exit()
elif s == 'b':
s = qb.popleft()
if not qb:
print('B')
exit()
else:
s = qc.popleft()
if not qc:
print('C')
exit()
if __name__ == '__main__':
main() |
s899463497 | p03998 | u094191970 | 1587604832 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 290 | sa=input()
sb=input()
sc=input()
t='a'
while True:
if t=='a':
if sa=='':
print('A')
exit()
t=sa[0]
sa=sa[1:]
if t=='b':
if sb=='':
print('B')
t=sb[0]
sb=sb[1:]
if t=='c':
if sc=='':
print('C')
exit()
t=sc[0]
sc=sc[1:] |
s846864730 | p03998 | u838486870 | 1587339093 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 258 | SA = list(str(input()))
SB = list(str(input()))
SC = list(str(input()))
list=[SA,SB,SC]
a=0
list[0].pop(0)
while True:
a=ord(list[a][0])-97
list[a].pop(0)
if len(list[0])==0 or len(list[1])==0 or len(list[2])==0:
break
print(chr(a+65)) |
s501990581 | p03998 | u581603131 | 1587334570 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 358 | while True:
if len(SA)==0:
print('A')
break
elif len(SB)==0:
print('B')
break
elif len(SC)==0:
print('C')
break
if card == 'a':
SA = SA[1:]
card = SA[0]
elif card == 'b':
SB = SB[1:]
card = SB[0]
elif card == 'c':
SC =SC[1:]
card = SC[0] |
s222865882 | p03998 | u581603131 | 1587334395 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 497 | SA = list(str(input()))
SB = list(str(input()))
SC = list(str(input()))
card = 'a'
for i in range(400):
if card == 'a':
SA = SA[1:]
card = SA[0]
elif card == 'b':
SB = SB[1:]
card = SB[0]
elif card == 'c':
SC =SC[1:]
card = SC[0]
if len(SA)==1 and card=='a':
print('A')
break
elif len(SB)==1 and card=='b':
print('B')
break
elif len(SC)==1 and card=='c':
print('C')
break |
s290313171 | p03998 | u581603131 | 1587334377 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 410 | for i in range(400):
if card == 'a':
SA = SA[1:]
card = SA[0]
elif card == 'b':
SB = SB[1:]
card = SB[0]
elif card == 'c':
SC =SC[1:]
card = SC[0]
if len(SA)==1 and card=='a':
print('A')
break
elif len(SB)==1 and card=='b':
print('B')
break
elif len(SC)==1 and card=='c':
print('C')
break |
s076772099 | p03998 | u396961814 | 1586906475 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 585 | SA = input()
SB = input()
SC = input()
WIN = [0, 0, 0]
card = SA[0]
SA_CNT = 1
SB_CNT = 0
SC_CNT = 0
while True:
if card == 'a':
SA_CNT += 1
if SA_CNT == len (SA):
print('A')
break
else:
card = SA[SA_CNT]
if card == 'b':
SB_CNT += 1
if SB_CNT == len(SB):
print('B')
break
else:
card = SB[SB_CNT]
if card == 'c':
SC_CNT += 1
if SC_CNT == len (SC):
print('C')
break
else:
card = SC[SC_CNT] |
s877996121 | p03998 | u396961814 | 1586906389 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 585 | SA = input()
SB = input()
SC = input()
WIN = [0, 0, 0]
card = SA[0]
SA_CNT = 1
SB_CNT = 0
SC_CNT = 0
while True:
if card == 'a':
SA_CNT += 1
if SA_CNT == len (SA):
print('A')
break
else:
card = SA[SA_CNT]
if card == 'b':
SB_CNT += 1
if SB_CNT == len(SB):
print('B')
break
else:
card = SB[SA_CNT]
if card == 'c':
SC_CNT += 1
if SC_CNT == len (SC):
print('C')
break
else:
card = SC[SA_CNT] |
s883232793 | p03998 | u289162337 | 1586806903 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 471 | a = input()
b = input()
c = input()
Sa = [a[i] for i in range(len(a))]
Sb = [b[i] for i in range(len(b))]
Sc = [c[i] for i in range(len(c))]
turn = "a"
while True:
if turn == "a":
if len(Sa) == 0:
print("A")
break
else:
turn = Sa.pop(0)
elif turn == "b":
if len(Sb) == 0:
print("B")
break
else:
turn = Sb.pop(0)
elif: turn == "c":
if len(Sc) == 0:
print("C")
break
else:
turn = Sc.pop(0) |
s507283471 | p03998 | u289162337 | 1586806752 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 443 | a = input()
b = input()
c = input()
Sa = [a[i] for i in range(a)]
Sb = [b[i] for i in range(b)]
Sc = [c[i] for i in range(c)]
turn = "a"
while True:
if turn == "a":
if len(Sa) == 0:
print("A")
break
else:
turn = Sa.pop(0)
elif turn == "b":
if len(Sb) == 0:
print("B")
break
else:
turn = Sb.pop(0)
else:
if len(Sc) == 0:
print("C")
break
else:
turn = Sc.pop(0) |
s974968251 | p03998 | u000770457 | 1586618086 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 452 | #include<iostream>
using namespace std;
int main(){
string s[3];
cin >> s[0] >> s[1] >> s[2];
int turn=0;
while(!s[turn].empty()){
char tmp=s[turn][0];
s[turn].erase(0,1);
if(tmp=='a'){
turn=0;
}else if(tmp=='b'){
turn=1;
}else{
turn=2;
}
}
if(turn==0){
cout << 'A';
}else if(turn==1){
cout << 'B';
}else{
cout << 'C';
}
return 0;
} |
s702217075 | p03998 | u982591663 | 1586575265 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 471 | SA = list(input())
SB = list(input())
SC = list(input())
turn = SA.pop(0)
while True:
if turn == "a":
turn = SA.pop(0)
elif turn == "b":
turn = SB.pop(0)
elif turn == "c":
turn = SC.pop(0)
if turn == "a":
if not SA:
print("A")
break
elif turn == "b":
if not SB:
print("B")
break
elif turn == "c":
if not SC:
print("C")
break
|
s968617862 | p03998 | u731448038 | 1586559885 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 308 | A = input()
B = input()
C = input()
next = A.popleft()
while 1:
if len(A)==0:
print('A')
break
elif len(B)==0:
print('B')
break
elif len(C)==0:
print('C')
break
if next=='a':
next = A.popleft()
elif next=='b':
next = B.popleft()
else:
next = C.popleft() |
s039377199 | p03998 | u235210692 | 1586450561 | Python | Python (3.4.3) | py | Runtime Error | 35 | 3284 | 297 | a=list(input()+"A")[::-1]
b=list(input()+"B")[::-1]
c=list(input()+"C")[::-1]
turn=a
def game(turn):
card=turn.pop()
if len(turn)==0:
print(card)
if card=="a":
turn=a
elif card=="b":
turn=b
else:
turn=c
game(turn)
game(turn) |
s406826037 | p03998 | u502731482 | 1586324432 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3316 | 355 | from collections import defaultdict
data = defaultdict()
for i in range(3):
s = input()
data[chr(ord("a") + i)] = s
cnt = defaultdict(int)
turn = "a"
while 1:
if cnt[turn] == len(data[chr(ord(turn))]):
ans = ord(turn) - (ord("a") - ord("A"))
break
cnt[turn] += 1
turn = data[chr(ord(turn))][cnt[turn]]
print(chr(ans)) |
s064501615 | p03998 | u485319545 | 1586311117 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 453 | s_a = list(input())
s_b = list(input())
s_c = list(input())
S=[s_a,s_b,s_c]
order=0
while true:
if S[order][0]=='a':
del S[0][0]
order=0
elif S[order][0]=='b':
del S[1][0]
order=1
else:
del S[2][0]
order=2
if len(S[order]==0:
print('A')
exit(0)
elif len(S[order])==0:
print('B')
exit(0)
elif len(S[order])==0:
print('C')
exit(0)
|
s568855772 | p03998 | u870841038 | 1586300249 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 552 | h = list(input() for i in range(3))
a, b, c = h[0], h[1], h[2]
#nは文字列
n = a
#neはnextで、1文字
ne = 'a'
while True:
if n == a:
ne = a[0]
a[1:]
if not a:
print('A')
break
elif n == b:
ne = b[0]
b[1:]
if not b:
print('B')
break
else n == c:
ne = c[0]
c[1:]
if not c:
print('C')
break
if ne == 'a':
n == a
if ne == 'b':
n == b
if ne == 'c':
n == c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.