problem_id stringclasses 100
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 6 806 |
|---|---|---|---|
p03289 | s110083427 | Accepted | s = input()
if s[0] == "A" and s[2:-1].count("C")==1:
c = s[2:-1].index('C')
if (s[1]+s[2:c+2]+s[c+3:]).islower():
print('AC')
else:
print('WA')
else:
print('WA') |
p03289 | s562964193 | Accepted | s = list(input())
j= 2
count = 0
if not s[0] == 'A':
print('WA')
exit()
for i in s[2:-1]:
if i == 'C':
count += 1
tmp = j
j += 1
if not count == 1:
print('WA')
exit()
del s[0]
del s[tmp-1]
s = ''.join(s)
if s.islower():
print('AC')
exit()
print('WA') |
p03289 | s442443133 | Accepted | S = input()
sl = []
ans = 'AC'
for i in S:
sl.append(i)
if S[0] != 'A':
ans = 'WA'
if S[2:-1].count('C') != 1:
ans = 'WA'
if S[1:].replace("C","c",1).islower() == False:
ans = 'WA'
#print(sl)
print(ans) |
p03289 | s646208172 | Accepted | S = input()
flag = True
cflag = False
for i, c in enumerate(S):
if i == 0:
if c == "A":
continue
else:
flag = False
break
if c == "C" and 2 <= i < len(S)-1:
if cflag:
flag = False
cflag = True
elif not (97 <= ord(c) <= 122):
flag = False
if flag and cflag:
print("AC")
else:
print("WA")
|
p03289 | s554668150 | Accepted | S = input()
if S[0] == "A":
S_1 = S[1:]
if S[2:-1].count("C") == 1:
S_1 = S_1.replace("C", "", 1)
if S_1.islower():
print("AC")
exit()
print("WA") |
p03289 | s300194108 | Accepted | import string
S = input()
re_S = set(S)-set("AC")
bl = S[0] == "A"
bl &= (S[2:-1].count("C") == 1)
bl &= (re_S <= set(string.ascii_lowercase ))
print("AC" if bl else "WA")
|
p03289 | s234958874 | Accepted | s = input()
if not s[0]=="A":
print("WA")
elif not s[1].islower():
print("WA")
else:
cnC = 0
for i in range(2,len(s)-1):
if s[i]=="C":
cnC += 1
elif s[i].isupper():
print("WA")
quit()
if cnC==1 and s[len(s)-1].islower():
print("AC")
else:
print("WA") |
p03289 | s242563850 | Accepted | import sys
S = input()
count = 0
for i in range(len(S)):
if i == 0 and S[i] != "A":
print("WA")
sys.exit()
if i == len(S)-1 and count != 1:
print("WA")
sys.exit()
if i != 0 and i != len(S)-2 and S[i].isupper() and S[i] != "C":
print("WA")
sys.exit()
if i >= 2 and i <= len(S)-2 and S[i] == "C":
count += 1
print("AC")
|
p03289 | s061928294 | Accepted | import sys
S=input()
first=S[0]
second=S[1]
last=S[len(S)-1]
cnt=0
moji=[i for i in "abcdefghijklmnopqrstuvwxyz"]
# print(len(moji))
if first=="A":
for i in range(2,len(S)-1):
if S[i]=="C":
cnt+=1
else:
if (S[i] in moji)==False:
print("WA")
sys.exit()
if cnt==1 and ((last in moji)==True) and ((second in moji)==True):
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s666715872 | Accepted | A=input()
if A[0] != "A":
print("WA")
quit()
if A[2:-1].count("C") != 1:
print("WA")
quit()
for i in range(1,len(A)):
if A[i] !="C" and not A[i].islower():
print("WA")
break
else:
print("AC") |
p03289 | s260791104 | Accepted | S=list(input())
ans = 'AC'
#条件1
if S[0] != 'A':
ans = 'WA'
#条件2
C_cnt=0
for s in S[2:-1]:
if s=='C':
C_cnt+=1
if C_cnt != 1:
ans = 'WA'
#条件3
Up_cnt=0
for s in S:
if s.isupper()==True:
Up_cnt+=1
if Up_cnt != 2:
ans = 'WA'
print(ans) |
p03289 | s035014423 | Accepted | S = list(input())
if S[0] != "A":
print("WA")
elif S[2:-1].count("C") != 1:
print("WA")
else:
S.remove("A")
S.remove("C")
S = "".join(S)
if S.islower():
print("AC")
else:
print("WA") |
p03289 | s371834644 | Accepted | def main():
S = input()
if S[0] == 'A':
count = 0
for i in range(2, 2+len(S[2:-1])):
if S[i] == 'C':
count += 1
index = i
if count == 1:
S = S[1:index]+S[index+1:]
if S.islower():
print('AC')
return
print('WA')
if __name__ == '__main__':
main()
|
p03289 | s197003472 | Accepted | S=input()
if S[0]=="A":
c=0
d=0
for x in range(2,len(S)-1):
if S[x].islower():
d+=1
if S[x]=="C":
c+=1
if c==1 and d==len(S)-4 and S[1].islower() and S[len(S)-1].islower():
print("AC")
else:
print("WA")
else:
print("WA")
|
p03289 | s428458134 | Accepted | import sys
s = input()
ans = 'AC'
c = 0
if s[0] != 'A':
ans = "WA"
for i in range(2,len(s)-1):
if "C" == s[i]:
c += 1
if c != 1:
ans = "WA"
c = 0
for i in range(len(s)):
a = ord(s[i])
if 65 <= a and a <= 96:
c += 1
if c != 2:
ans = "WA"
print(ans) |
p03289 | s791292880 | Accepted | import re
s = input()
s1 = re.fullmatch(r"A([a-z]+)C([a-z]+)", s)
if s1 == None:
print("WA")
else:
print("AC")
|
p03289 | s273966910 | Accepted | s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 and (s[1:s.find('C')]+s[s.find('C')+1:]).islower():
print('AC')
else:
print('WA') |
p03289 | s975780856 | Accepted | s=input()
n=len(s)
if n==4:
x=s[2]
else:
x=s[2:n-1]
if s[0]!='A':
print('WA')
elif x.count('C')!=1:
print('WA')
else:
i=x.find('C')
s=list(s)
s.pop(i+2)
s.pop(0)
s=''.join(s)
if s.islower()==True:
print('AC')
else:
print('WA') |
p03289 | s427287418 | Accepted | s = input()
if (s[0] != 'A'):
print('WA')
exit()
t = s[2:-1]
if ('C' not in t or t.count('C') > 1):
print('WA')
exit()
s = s[1:]
s = s.replace('C', '')
for x in s:
if (x.islower() == False):
print('WA')
exit()
print('AC')
|
p03289 | s835178279 | Accepted | S = input()
print("AC" if(S[0] == "A" and 'C' in S[2:-1]
and S[1:].replace("C", '', 1).islower()) else "WA")
|
p03289 | s291456981 | Accepted | s=input()
print('AC' if s[0] == 'A' and s[2:-1].count('C') ==1 and s[1:].replace('C','',1).islower() else 'WA')
|
p03289 | s566065714 | Accepted | import re
def answer(s: str) -> str:
pattern = r'^A[a-z]+C[a-z]+$'
return 'AC' if re.match(pattern, s) else 'WA'
def main():
s = input()
print(answer(s))
if __name__ == '__main__':
main()
|
p03289 | s210906383 | Accepted | s=input()
AC="AC"
if not s[0]=="A":
AC="WA"
s=s[1:]
if not s[1:-1].count("C")==1:
AC="WA"
s=s.replace("C","c")
if not s.islower():
AC="WA"
print(AC) |
p03289 | s995614493 | Accepted | S = input()
if S[0] == "A" and "C" in S[2:-1] and S.count("C") == 1 and len([s for s in S if s.isupper()]) == 2:
print("AC")
else:
print("WA")
|
p03289 | s143709191 | Accepted | S = input()
if S[0] == "A":
if S[2:-1].count("C") == 1:
S2 = S.replace("A","")
S3 = S2.replace("C","")
if S3.islower() == True:
ac = True
else:
ac = False
else:
ac = False
else:
ac = False
if ac == True:
print("AC")
else:
print("WA") |
p03289 | s308309198 | Accepted | s = input()
cnt = 0
if s[0] == "A" and s[2:-1].count("C") == 1:
for i in range(len(s)):
if ord(s[i])<=90:
cnt += 1
if cnt != 2:
print("WA")
quit()
else:
print("AC")
else:
print("WA")
|
p03289 | s539985922 | Accepted | S = input()
flag = 1
c_count = 0
ans = 'AC'
if S[0] != 'A':
ans = 'WA'
for i in range(1,len(S)):
if (i == 1 or i == len(S)-1) and S[i].islower() == False:
ans = 'WA'
elif 2 <= i <= len(S)-2:
if S[i] == 'C':
c_count += 1
if c_count != 1:
ans = 'WA'
print(ans) |
p03289 | s583140207 | Accepted | s = list(input())
#chr(ord('a')
ans = True
if s[0] != "A":
print("WA")
elif s[2:-1].count("C") != 1:
print("WA")
else:
s.remove("A")
s.remove("C")
if not str(s).islower():
print("WA")
else:
print("AC") |
p03289 | s614419164 | Accepted | s = input()
def cntUpper(s):
cnt = 0
for a in s:
if a.isupper():
cnt += 1
return cnt
print('AC') if s[0] == 'A' and 'C' in s[2:-1] and cntUpper(s) == 2 else print('WA') |
p03289 | s515065201 | Accepted | #abc104 b
s=input()
x=s[2:-1]
flag=True
if s[0]!="A" or s[1].isupper() or s[-1].isupper():
flag=False
cnt=0
for i in range(len(x)):
if x[i]=="C":
cnt+=1
else:
if x[i].islower()==False:
flag=False
if cnt!=1:
flag=False
if flag:
print("AC")
else:
print("WA")
|
p03289 | s579120014 | Accepted | S = input()
ans = "WA"
if S[0] == "A":
tmp = S[2:len(S)-1]
if tmp.count("C") == 1:
c = tmp.index("C")
count = 0
for i in range(1,len(S)):
tmp2 = S[i]
if tmp2.islower():
count += 1
if count == len(S) - 2:
ans = "AC"
print(ans) |
p03289 | s835157268 | Accepted | s = input()
def check(w):
if w[0] != 'A':
return False
n = len(w)
count = 0
for a in range(2, n-1):
if w[a] == 'C':
count += 1
if count != 1:
return False
upper = 0
for a in range(0, n):
if w[a] >= 'A' and w[a] <= 'Z':
upper += 1
if upper != 2:
return False
return True
if check(s):
print('AC')
else:
print('WA')
|
p03289 | s654513978 | Accepted | s=(input())
k=s[2:-1]
m=k.replace('C', 'c')
t=s[-1]
t1=s[1]
if k.count('C')==1 and s[0]=='A' and m==k.lower() and t==s[-1].lower() and s[1]==t1.lower():
print('AC')
else:
print('WA') |
p03289 | s134631271 | Accepted | S = input()
n =len(S)
s = S.lower()
if S[0] != 'A':
print('WA')
exit()
else:
for i in range(2, n-1):
if S[i] != 'C':
if S[i] != s[i]:
print('WA')
exit()
if S[n-1] != s[n-1] or S[1] != s[1]:
print('WA')
exit()
if S.count('C') != 1:
print('WA')
exit()
print('AC') |
p03289 | s896600820 | Accepted | s = input()
is_a = False
cnt_c = s[2:-1].count("C")
cnt_l = 0
if s[0] == "A":
is_a = True
else:
pass
for letter in s:
if letter.isupper():
cnt_l += 1
else:
continue
if is_a == True and cnt_c == 1 and cnt_l == 2:
print("AC")
else:
print("WA") |
p03289 | s892331459 | Accepted | S = input()
ans = "WA"
if S[0] == "A" and S[2:-1].count("C") == 1:
if S[1:].replace("C", "").islower():
ans = "AC"
print(ans)
|
p03289 | s570975338 | Accepted | s = input()
if s[0] == "A" and s[2:-1].count("C") == 1:
tmp = s.replace("A","").replace("C","")
if tmp.islower():
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s739885493 | Accepted | import sys
input = sys.stdin.readline
MOD = 1000000007
S = input()[:-1]
S = list(S)
if S[0] == 'A':
if 'C' in S[2:-1] and S.count('C') == 1:
x = []
for i in range(1,len(S)):
if S[i] == 'C':
continue
x.append(S[i])
#print(x)
if str(x).islower():
print("AC")
exit()
print("WA")
|
p03289 | s248803606 | Accepted | import re
S = input()
print('AC' if S.startswith('A') and (S[2:-1]).count('C') == 1 and len(re.findall('[A-Z]', S)) == 2 else 'WA')
|
p03289 | s745921729 | Accepted | s = input()
def has_A(x):
if x[0] == 'A': return True
return False
def has_C(x):
if x[2:-1].count('C') == 1: return True
return False
def is_lower_this_case(x):
i = x.index('C')
if x[1:i].islower() and x[i+1:].islower():
return True
return False
if has_A(s) and has_C(s) and is_lower_this_case(s):
print('AC')
else:
print('WA') |
p03289 | s021775905 | Accepted | s = list(input())
flg = 'WA'
if s[0] == 'A':
if 'C'in s[2:len(s)-1]:
s.remove('A')
s.remove('C')
s = ''.join(s)
if s.islower() == True:
flg = 'AC'
print(flg) |
p03289 | s149395281 | Accepted | s = input()
a = s.lower()
l = len(s)
c = 0
n = 0
if s[0] == 'A':
for i in range(2 , l-1):
if s[i] == 'C':
c += 1
if c == 1:
for i in range(1,l):
if s[i] != a[i]:
n += 1
if n == 1:
print('AC')
exit()
print('WA') |
p03289 | s761547318 | Accepted | S = input()
if S[0] != "A":
print("WA")
elif "C" in S:
a = S.index("C")
if 2 <= a <= len(S)-2:
S = S.replace("A", "", 1).replace("C", "", 1)
if S.islower():
print("AC")
else:
print("WA")
else:
print("WA")
else:
print("WA") |
p03289 | s458578409 | Accepted | import re
print('AC' if re.match('^A[a-z]+C[a-z]+$', input()) else 'WA') |
p03289 | s893076966 | Accepted | S = input()
if S[0]=="A" and S[2:-1].count("C") == 1 and S[1:].replace("C","c").islower():
print("AC")
else:
print("WA") |
p03289 | s457957173 | Accepted | def resolve():
s = input()
if s[0] != 'A':
print('WA')
return
cnt = False
for i in s[2:-1]:
if i == 'C':
cnt += 1
if cnt != 1:
print('WA')
return
for i in s:
if i == 'A' or i == 'C':
continue
if i.isupper():
print('WA')
return
print('AC')
resolve() |
p03289 | s460512884 | Accepted | S=input()
if S[0]=='A' and S[2:-1].count('C')==1:
s=list(S)
s.remove('C')
S=''.join(s)
if S.istitle()==True:
print('AC')
exit()
print('WA') |
p03289 | s847206494 | Accepted | def isAC(S):
if S[0] != 'A':
return False
if S[2:-1].count('C') != 1:
return False
S = S[1:].replace('C', '')
if not all('a' <= x <= 'z' for x in S):
return False
return True
print('AC' if isAC(input()) else 'WA') |
p03289 | s011509145 | Accepted | list_S = list(input())
ans = "WA"
if list_S[0] == "A":
list_S.remove("A")
if "C" in list_S[1:-1]:
list_S.remove("C")
for c in list_S:
if c not in ["q","a","z","w","s","x","e","d","c","r","f","v","t","g","b","y","h","n","u","j","m","i","k","o","l","p"]:
ans = "WA"
break
else:
ans = "AC"
print(ans)
|
p03289 | s794373658 | Accepted | import fileinput
s = list(input())
if s[0] != "A" or s[1].isupper() or s[len(s) - 1].isupper():
print("WA")
exit()
cc = False
for i in range(2, len(s) - 1):
if s[i] == "C" and not cc:
cc = True
continue
if s[i] == "C" and cc:
print("WA")
exit()
if s[i].isupper() and s[i] != "C":
print("WA")
exit()
if cc:
print("AC")
else:
print("WA")
|
p03289 | s259851772 | Accepted | s = input()
if s[0]!='A' or s[2:-1].count('C')!=1:
print('WA')
else:
cnt = 0
for i in s:
if i<'a' or 'z'<i:
cnt += 1
if cnt==2:
print('AC')
else:
print('WA') |
p03289 | s538691999 | Accepted | s=list(input())
if s[0]=="A" and s[2:len(s)-1].count("C")==1:
s[0]="a"
s[s.index("C")]="c"
if "".join(s).islower():
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s077135930 | Accepted | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
S = sr()
bl = True
if S[0] != 'A':
bl = False
if S[2:-1].count('C') != 1:
bl = False
if S.count('C') != 1:
bl = False
for s in S[1:]:
if s == 'C':
continue
if not s.islower():
bl = False
print('AC' if bl else 'WA')
|
p03289 | s577272687 | Accepted | s = input()
length = len(s)
count = 0
count_large = 0
sep = s[2:length-1]
if s[0] == 'A':
count += 1
if sep.count('C') == 1:
count += 1
for i in range(length):
if s[i].isupper():
count_large += 1
if count_large == 2:
count += 1
if count == 3:
print('AC')
else:
print('WA')
|
p03289 | s687451816 | Accepted | S = input()
cnt = 0
if S[0] == "A":
for i in S[2: len(S) - 1]:
if i == "C":
cnt += 1
sr = S.replace("A", "")
src = sr.replace("C", "")
if src.islower() and cnt == 1:
print("AC")
else:
print("WA") |
p03289 | s790366746 | Accepted | s=input()
print('AC' if s[0]=='A' and s[2:-1].count('C')==1 and s[1].islower() and s[1:].replace('C','',1).islower() else 'WA')
|
p03289 | s457513650 | Accepted | s = input()
print("AC" if 'C' in s[2:-1] and 'A' in s and s[1:].replace('C', '', 1).islower() else "WA") |
p03289 | s386932531 | Accepted | S = input()
if S[0] == "A":
count = 0
S2 = S[2:-1]
for i in S2:
if i == "C":
count += 1
if count == 1:
S3 = S[1:].replace("C","")
if S3.islower():
print("AC")
exit()
print("WA") |
p03289 | s689278084 | Accepted | S = input()
if S[0] != "A":
print("WA")
exit()
elif S[2:-1].count("C") != 1 or S[:2].count("C") != 0 or S[-1:].count("C") != 0:
print("WA")
exit()
else:
S = S[1:].replace("C", "")
if S.islower():
print("AC")
else:
print("WA") |
p03289 | s762449229 | Accepted | S = input()
if S[0] == "A":
S_cpy = S.lstrip("A")
else:
print("WA")
exit()
if S[2:-1].count("C") == 1:
S_cpy = S_cpy.replace("C", "")
else:
print("WA")
exit()
if S_cpy.islower():
print("AC")
else:
print("WA") |
p03289 | s394821659 | Accepted | import re
S=input()
good = True
if S[0] != 'A':
print('WA')
exit()
n = 0
iC = -1
for i in range(2,len(S)-1):
if S[i] == 'C':
n += 1
iC = i
if n != 1:
print('WA')
exit()
for i in range(1,len(S)):
if i == iC:
continue
if not re.match(r'[a-z]', S[i]):
print('WA')
exit()
print('AC')
|
p03289 | s539463574 | Accepted | strs=input()
che=True
c=True
coun=False
for i in range(0,len(strs)) :
if(i==0):
c=True if strs[i]=="A" else False
else :
if(strs[i].isupper()):
if( (not coun) and i>=2 and i<=len(strs)-2 and strs[i]=='C'):
coun=True
else:
che=False
print("AC") if che and coun and c else print("WA")
|
p03289 | s015395252 | Accepted | s = list(input())
if s[0]=='A':
s.remove(s[0]); l = len(s)
for i in range(l):
if s[1:l-1].__contains__('C'):
s.remove('C')
print('AC' if str(s) == str(s).lower() else 'WA'); break
else:
print('WA'); break
else:
print('WA') |
p03289 | s856089629 | Accepted | import re
def solve():
S = input()
print('AC' if re.match(r'^A[a-z]+C[a-z]+$', S) else 'WA')
if __name__ == "__main__":
solve() |
p03289 | s722906535 | Accepted | s = input()
l = []
for i in s:
l.append(i)
if l[0] != "A":
print("WA")
else:
if len(l) == 3:
if l[1].islower() and l[2] == "C":
print("AC")
else:
print("WA")
else:
l.remove("A")
if "C" not in l[1:len(l)-1]:
print("WA")
else:
l.remove("C")
s = "".join(l)
if s.islower():
print("AC")
else:
print("WA") |
p03289 | s443459280 | Accepted | s=input()
x=0
if s[0]=="A" and s[1]!="C" and s[-1]!="C":
for i in range(len(s)):
if s.count("C")==1:
if s[i].isupper():
x+=1
else:
print("WA")
exit()
if x==2:
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s799439521 | Accepted | # solution
import io
data=input()
if data[0]=="A"and data[2:-1].count("C")==1\
and data[1:].replace("C","c",1).islower()==True:
print("AC")
else:print("WA") |
p03289 | s454175243 | Accepted | S = input()
if S[0]=='A' and (S[2:len(S)-1].count('C')==1) and S[1:2].islower() and S[len(S)-1:].islower():
print('AC')
else:
print('WA') |
p03289 | s040311606 | Accepted | s=list(input())
swi=1
if s[0]=="A":
if "C" in s[2:-1]:
s=s[1:]
s.remove("C")
swi=0
for i in range(len(s)):
if not s[i].islower():
swi=1
print("AC" if swi==0 else "WA") |
p03289 | s795993365 | Accepted | s = input()
a = -1
c = -1
lower = 0
for i in range(len(s)):
if s[i] == 'A':
a = i
if s[i] == 'C':
c = i
if 'a' <= s[i] <= 'z':
lower += 1
if a == 0 and 2 <= c <= len(s) - 2 and lower == len(s) - 2:
print('AC')
else:
print('WA')
|
p03289 | s436149833 | Accepted | s = input()
if s[0] == "A":
if s[2:-1].count("C") == 1:
if s[1:].replace("C","").islower():
print("AC")
exit()
print("WA") |
p03289 | s734187981 | Accepted | s = list(input())
flag = 1
if s[0] == "A" :
if s[2:-1].count("C") == 1 :
for i in range(1,len(s)) :
if i != s[2:-1].index("C") + 2 :
if s[i] != s[i].lower() :
flag = 0
break
else :
flag = 0
else :
flag = 0
print("AC" if flag ==1 else "WA")
|
p03289 | s599153351 | Accepted | """
1. The initial character of S is an uppercase A.
2. There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).
3. All letters except the A and C mentioned above are lowercase.
"""
import collections
def a(r): return r[0] == 'A'
def b(r): return collections.Counter(r[2:-1])['C'] == 1
def c(r): return all([l in set(['A', 'C']) or l.lower() ==l for l in r ])
def f(r): return a(r) and b(r) and c(r)
print 'AC' if f(raw_input()) else 'WA' |
p03289 | s661955269 | Accepted | S=input()
if S[0]=='A' and S.count('C')==1 and 'C' in S[2:-1]:
for c in S[1:len(S)]:
if not (c.islower() or c=='C'):
print("WA")
break
else:
print("AC")
else:
print("WA")
|
p03289 | s308351495 | Accepted | import numpy as np
def main():
test = input()
if test[0] != "A":
print("WA")
return
if test[:-1][2:].count("C") != 1:
print("WA")
return
for i in range(len(test)):
if i == 0 and test[i] == "A": continue
if 2 <= i <= len(test) - 2 and test[i] == "C": continue
if test[i].lower() != test[i]:
print("WA")
return
print("AC")
if __name__ == "__main__":
main() |
p03289 | s485879372 | Accepted | s=input()
ans=0
count=0
t=""
if s[0]=="A":
ans+=1
for i in range(2,len(s)-1):
# print(s[i])
if s[i]=="C":
count+=1
t=s[1:i]+s[i+1:]
# print(t)
if t.islower()==True and ans==1 and count==1:
print("AC")
else:
print("WA") |
p03289 | s486631253 | Accepted | S = input()
f = True
if S[0] != 'A':
f = False
elif S[2:-1].count('C') != 1:
f = False
else:
for s in S[1:]:
if s not in 'Cabcdefghijklmnopqrstuvwxyz':
f = False
break
print('AC' if f else 'WA') |
p03289 | s587890322 | Accepted | S = list(input())
if S[0] != "A":
print("WA")
elif S[2:-1].count("C") != 1:
print("WA")
elif sum([s.islower() for s in S])+2 != len(S):
print("WA")
else:
print("AC") |
p03289 | s264284129 | Accepted | import re
print ('AC' if re.match(r'\AA[a-z](?:[a-z]*C[a-z]*)[a-z]\Z', input()) else 'WA')
|
p03289 | s595628378 | Accepted | S = str(input())
a=0
b=0
c=0
if S[0]=='A':
a=1
cnt=0
for i in S[2:-1]:
if i=='C':
cnt+=1
if cnt==1:
b=1
s=S[1:]
s=s.replace('C','')
if s.islower()==True:
c=1
if a==1 and b==1 and c==1:
print('AC')
else:
print('WA') |
p03289 | s585645370 | Accepted | s=input()
if s[0] !="A":
print("WA")
exit()
cnt=0
for i in range(2,len(s)-1):
if s[i] == "C":
cnt+=1
if cnt!=1:
print("WA")
exit()
for i in range(1,len(s)):
if s[i] == "C" and 2<=i<len(s)-1:
continue
if not s[i].islower():
print("WA")
exit()
print("AC") |
p03289 | s168844018 | Accepted | s=input()
cnt=0
if s[0] != 'A':
print('WA')
exit()
if s[2:len(s)-1].count('C') != 1:
print('WA')
exit()
else:
for i in range(1,len(s)):
if s[i]=='C':
continue
if s[i].isupper():
print('WA')
exit()
print('AC') |
p03289 | s641174877 | Accepted | # coding: utf-8
s = input().rstrip()
def isValid(s:str):
if s[0] != "A":
return False
if s[1] == s[1].upper():
return False
sub = s[2:-1]
if len([i for i in sub if i == "C"]) != 1:
return False
sub2 = s[1] + sub.replace("C", "") + s[-1]
if sub2 != sub2.lower():
return False
return True
ans = "AC"
if not isValid(s):
ans = "WA"
print(ans)
|
p03289 | s122085092 | Accepted | s = list(map(str,input()))
if s[0] != "A":
print("WA")
elif s[2:-1].count("C") != 1:
print("WA")
else:
del s[0]
s.remove("C")
if "".join(s).islower():
print("AC")
else:
print("WA") |
p03289 | s927387008 | Accepted | s=input()
a=s.lower()
l=len(s)
count=0
dif=0
if s[0]=='A':
for i in range(2,l-1):
if s[i]=='C':
count+=1
if count==1:
for i in range(1,l):
if s[i]!=a[i]:
dif+=1
if dif==1:
print('AC')
exit()
print('WA') |
p03289 | s795970156 | Accepted | s = input()
flag = False
if s[0]=="A":
if s[2:-1].count("C")==1:
if (s[1:s.index("C")].islower() and s[s.index("C")+1:].islower()):
flag = True
print("AC" if flag else "WA")
|
p03289 | s141874330 | Accepted | S = input()
ans_1 = S[0]=="A"
ans_2 = S[2:-1].count("C")==1
S = S[1:].replace("C", "")
ans_3 = S.islower()
print("AC") if ans_1 & ans_2 & ans_3 else print("WA") |
p03289 | s842839171 | Accepted | def resolve():
S = input()
if S[0] == "A" and S[2:-1].count("C") == 1:
if S.count("A") == 1 and S.count("C") == 1:
S = S.replace("A", "").replace("C", "")
if S == S.lower():
print("AC")
return
print("WA")
resolve()
|
p03289 | s814912817 | Accepted | s = input()
flg1 = s[0] == "A"
flg2 = s[2:-1].count("C") == 1
s = s.replace("A", "")
s = s.replace("C", "")
flg3 = s.islower()
print(["WA", "AC"][flg1 and flg2 and flg3]) |
p03289 | s908972787 | Accepted | A= input()
if A[0]=="A" and A[2:-1].count("C")==1:
pass
else:
print("WA")
exit()
B=A[1:]
B=B.replace("C","")
if B.islower()==True:
print("AC")
else:
print("WA") |
p03289 | s341188624 | Accepted | S = input()
count=0
if S[0]=="A":
for i in range(2,max([len(S)-1,3]),1):
if S[i]=="C":
count+=1
idx=i
if count==1:
s=S[1:idx]+S[idx+1:]
if s==s.lower():
print("AC")
else:
print("WA")
else:
print("WA")
else:
print("WA") |
p03289 | s562244661 | Accepted | s=input()
res="AC"
if s[0]!="A":res="WA"
elif s[2:-1].count("C")!=1:res="WA"
else:
li=list(s)
li.remove("A")
li.remove("C")
for i in li:
if i!=i.lower():
res="WA"
print(res) |
p03289 | s167042934 | Accepted | s = input()
if s[0] != 'A':
print('WA')
exit()
sho = ord('a')
ok = 0
for i in s[2: len(s) - 1]:
if ord(i) < sho:
if ord(i) == ord("C"):
ok += 1
else:
print("WA")
exit()
if ord(s[1]) < sho or ord(s[len(s) - 1]) < sho:
print("WA")
exit()
if ok == 1:
print("AC")
else:
print("WA") |
p03289 | s527235844 | Accepted | S = input()
ans = "WA"
if S[0] != "A":
print(ans)
else:
if S[2:len(S) - 1].count("C") != 1:
print(ans)
else:
s = S.index("C")
SS = S[1:s] + S[s + 1:]
if SS.islower() == False:
print(ans)
else:
print("AC")
|
p03289 | s206256940 | Accepted | s = input().strip()
a = (s[0] == "A")
c_cnt = 0
for e in s[2:(-1)]:
if e == "C":
c_cnt += 1
if a and c_cnt == 1 and s[1:].replace("C", "").islower():
print("AC")
else:
print("WA")
|
p03289 | s291270394 | Accepted | import sys
s=input()
c_count=0
flag=False
for ss in s:
if ss.isupper():
if ss!='A' and ss!='C':
print('WA')
sys.exit()
if s[0]=='A':
for i in range(2,len(s)-1):
if s[i]=='C':
c_count+=1
if c_count==1:
flag=True
if flag:
print("AC")
else:
print("WA")
|
p03289 | s450132608 | Accepted | S = input()
check = False
if S[0] == "A" and "C" in S[2:-1]:
i = list(S).index("C")
T = S[1:i] + S[i+1:]
if T == T.lower():
check = True
print("AC" if check else "WA") |
p03289 | s731195851 | Accepted | S = list(map(str, input()))
flg = 1
if S[0] != "A":
flg = 0
ctr = 0
for i in range(2, len(S) - 1):
if S[i] == "C":
ctr += 1
if ctr != 1:
flg = 0
ctr = 0
for s in S:
if ord(s) <= 90:
ctr += 1
if ctr != 2:
flg = 0
if flg:
print("AC")
else:
print("WA") |
p03289 | s386329065 | Accepted | S = input()
Flag = False
if (S[0]=='A') and S[2:len(S)-1].count('C')==1:
ReS = S.replace('C','')[1:]
if ReS.islower():
Flag = True
if Flag:
print('AC')
else:
print('WA')
|
p03289 | s070230989 | Accepted | S = input()
if S[0] == 'A':
if S[1] != 'C' and S[-1] != 'C':
if S.count('C') == 1:
S = S.lstrip('A')
S = S.replace('C','c')
if S.islower():
print("AC")
exit(0)
print('WA') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.