problem_id stringclasses 100
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 6 806 |
|---|---|---|---|
p03289 | s307758732 | Accepted | S = input()
answer = 'WA'
if S[0] == 'A':
sKiridashi = S[2:-1]
if sKiridashi.count('C') == 1:
cIndex = sKiridashi.find('C') + 2
otherStr = S[1:cIndex] + S[cIndex+1:]
if otherStr.islower():
answer = 'AC'
print(answer) |
p03289 | s872009820 | Accepted | S = list(input())
c = S[2:-1].count('C')
u = 0
for char in S:
if char.isupper():
u += 1
if S[0]=='A' and c == 1 and u == 2:
print('AC')
else:
print('WA') |
p03289 | s164062891 | Accepted | S = input()
if S[0] != 'A':
print('WA')
exit()
index = S[2:-1].find('C')
if index == -1:
print('WA')
exit()
index = S[2:-1].find('C',index+1)
if index >= 0:
print('WA')
exit()
index = S.find('C')
S=S[1:index] + S[index + 1:len(S)]
if S != S.lower():
print('WA')
exit()
print('AC') |
p03289 | s175069926 | Accepted | s = list(input())
if s[0] == "A" and s[2:-1].count("C") == 1:
s.remove("A")
s.remove("C")
if "".join(s).lower() == "".join(s):
print("AC")
else:
print("WA")
else:
print("WA")
|
p03289 | s855764492 | Accepted | S = input()
Ssl = S[2:-1]
Srp = S.replace("A", "")
Srp = Srp.replace("C", "")
cnt = Ssl.count("C")
if S[0] == "A" and cnt == 1 and Srp.islower():
print("AC")
else:
print("WA") |
p03289 | s788466215 | Accepted | S = input()
N = len(S)
f = True
if S[0] != 'A':
f = False
if S[2:N-1].count('C') != 1:
f = False
for s in S:
if s != 'A' and s != 'C' and s.isupper():
f = False
print('AC' if f else 'WA') |
p03289 | s176632643 | Accepted | S = input()
ans = 0
num = 0
cnum = 0
if S[0] == "A":
ans += 1
for i in range(2,len(S)-1):
if S[i] == "C":
cnum += 1
if cnum == 1:
ans +=1
for j in range(len(S)):
if S[j].islower() == True:
num += 1
if num == len(S)-2:
ans +=1
if ans ==3:
print("AC")
else:
print("WA") |
p03289 | s770574346 | Accepted | s = input()
ans = 'AC'
if s[0] != 'A':
print('WA')
exit()
else:
s = s[1:]
if 'C' not in s[1:-1]:
print('WA')
exit()
else:
if s.count('C') != 1:
print('WA')
exit()
else:
ss = s.replace('C','')
if ss.islower():
print('AC')
else:
print('WA')
|
p03289 | s914993369 | Accepted | s = input()
if s[0] == "A" and s[2:-1].count("C") == 1:
idx = s.index("C")
if s[1:idx] == s[1:idx].lower() and s[idx+1:] == s[idx+1:].lower():
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s021904276 | Accepted | s = input()
ans = 'AC'
if s[0] != "A":
ans = "WA"
count = 0
for i in range(1,len(s)):
if s[i].isupper():
if i == 1 or i == len(s)-1 or s[i] != "C":
ans = "WA"
count += 1
if count != 1:
ans = "WA"
print(ans) |
p03289 | s188894100 | Accepted | s = input()
count = 0
for i in range(0, len(s)):
if i == 0 and s[i] == 'A': continue
if i == 1 and 97 <= ord(s[i]) <= 122: continue
if 2 <= i <= len(s) - 2:
if s[i] == 'C':
count += 1
continue
elif 97 <= ord(s[i]) <= 122: continue
if count == 0 or count >= 2: break
if i == len(s) - 1 and 97 <= ord(s[i]) <= 122:
print("AC")
exit()
print("WA") |
p03289 | s536186101 | Accepted | def f(s):
u = 0
for c in s:
if c.isupper():
u += 1
return u == 1
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 and f(s[1:]):
print('AC')
else:
print('WA')
|
p03289 | s585045028 | Accepted | import sys
input = sys.stdin.readline
def main():
S = input().rstrip()
ans = "AC"
if not S[0] == "A":
ans = "WA"
if not S[2:-1].count("C") == 1:
ans = "WA"
else:
count = 0
for s in S:
if s.isupper():
count += 1
if count != 2:
ans = "WA"
print(ans)
if __name__ == "__main__":
main()
|
p03289 | s819256257 | Accepted | s = input()
if s[0] != 'A':
print('WA')
exit()
if s.count('C', 2, -1) != 1:
print('WA')
exit()
s2 = s[1:].replace('C', '')
if not s2.islower():
print('WA')
exit()
print('AC')
|
p03289 | s766346389 | Accepted | s = input()
if s[0]=="A" and s[2:-1].count("C") == 1 and s[1:].replace("C", "").islower():
print("AC")
else:
print("WA") |
p03289 | s535146183 | Accepted | s = input()
if s[0] !='A':
print('WA')
exit()
if 'C' not in s[2:len(s)-1]:
print('WA')
exit()
cnt = 0
for i in s:
if i.isupper():
cnt +=1
if cnt !=2:
print('WA')
exit()
print('AC')
|
p03289 | s907962685 | Accepted | s=input()
p=len(s)
fir=s[0]=="A"
sec=s.count("C",2,-1)
thi=sum(map(lambda x:x.islower(), s))==p-2
if fir and sec and thi:
print("AC")
else:
print("WA") |
p03289 | s579311649 | Accepted | import sys
def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし
S = LS2()
if not (S.count('C') == 1 and S[0] == 'A' and S[1] != 'C' and S[-1] != 'C'):
print('WA')
exit()
else:
for i in range(1,len(S)):
if not (S[i] == 'C' or S[i].islower()):
print('WA')
exit()
print('AC')
|
p03289 | s014170050 | Accepted | S = input()
ans = 'AC'
if S[0] != 'A':
ans = 'WA'
if S[2:-1:1].count('C') != 1:
ans = 'WA'
S = S.replace('A', 'a').replace('C', 'c')
if S.islower() == False:
ans = 'WA'
print(ans)
|
p03289 | s277302791 | Accepted | S = str(input())
alp = "ABDEFGHIJKLMNOPQRSTUVWXYZ"
if S[0] == 'A' and S.count('C') == 1 and S[2:-1].count('C') == 1:
for i in range(1,len(S)):
if S[i] in alp:
print("WA")
exit()
print("AC")
else:
print("WA") |
p03289 | s732371510 | Accepted | s=input()
ans="WA"
if s[0]=="A":
if s[2:-1].count("C")==1:
s=list(s)
s.remove("A")
s.remove("C")
for j in range(len(s)):
if ord(s[j])<ord("a"):
break
else:
ans="AC"
print(ans) |
p03289 | s071924063 | Accepted | #104
s=input()
if s[0]!="A":
print("WA")
elif "C" not in s[2:-1] or s[2:-1].count("C")!=1:
print("WA")
elif s[1]==str.upper(s[1]):
print("WA")
elif (s[1:2]+s[-1]).strip("C")==str.lower((s[1:2]+s[-1]).strip("C")):
print("AC")
else:
print("WA") |
p03289 | s339302491 | Accepted | S=input()
print('WAAC'[S[0]=='A' and S.count('C',2,-1)==1 and len(list(filter(lambda x: x.isupper(),list(S))))==2::2]) |
p03289 | s095565413 | Accepted | S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
S = S[1] + S[2:-1].replace('C', '') + S[-1]
if S == S.lower():
print('AC')
exit()
print('WA') |
p03289 | s515113807 | Accepted | s = input()
ans = 'WA'
a = []
if s[0] == 'A' and s[2:-1].count('C') == 1:
a = list(s)
a.remove('A')
a.remove('C')
a = str(a)
if a.islower() == True:
ans = 'AC'
print(ans) |
p03289 | s383162860 | Accepted | S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
chk = S.replace('A', '').replace('C', '')
l = len(chk)
cnt = 0
for s in chk:
if s.islower():
cnt += 1
if cnt == l:
print('AC')
exit()
print('WA') |
p03289 | s544937834 | Accepted | S = input()
if S[0] == "A":
if S[2:-1].count("C") == 1:
idx = S[2:-1].index("C") + 2
S = S[1:idx] + S[idx+1:]
if S == S.lower():
print("AC")
exit()
print("WA") |
p03289 | s776749092 | Accepted | S = input()
if S[0] != "A":
print("WA")
exit()
if S[2:-1].count("C") != 1:
print("WA")
exit()
if (S[1:S.index("C",2)] + S[S.index("C",2)+1:]).islower():
print("AC")
else:
print("WA") |
p03289 | s964768080 | Accepted | S=str(input())
cnt=0
for i in range(2,len(S)-1):
if S[i] =='C':
cnt+=1
if cnt==1:
if S[0]=='A':
T = S.replace("C","").replace("A","")
if T.islower():
print("AC")
exit()
print("WA") |
p03289 | s489955677 | Accepted | S = input()
if S.startswith("A") and S[2:-1].count("C") == 1 and S[1:].replace("C","c").islower():
print("AC")
else:
print("WA") |
p03289 | s528685221 | Accepted | S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
S_ = S.replace('A', '').replace('C', '')
if S_.islower():
print('AC')
else:
print('WA')
else:
print('WA')
|
p03289 | s914523922 | Accepted | s=input()
flag=0
if s[0]=="A":
if s[2:-1].count("C")==1:
if s[1:].replace("C","c").islower():
print("AC")
flag=1
if flag==0:
print("WA")
|
p03289 | s545754682 | Accepted | S = str(input())
if S[0] == "A":
next = S[2:-1]
if next.count("C") == 1:
next = list(S[1:])
next.remove("C")
next = str(next)
if next.islower():
print("AC")
exit()
print("WA")
|
p03289 | s221905828 | Accepted | s=input();print('WAAC'['A'==s[0] and s[2:-1].count('C')==1 and s.replace('A','').replace('C','').islower()::2]) |
p03289 | s682808035 | Accepted | s = input()
if s[0] == "A":
if s[2: -1].count("C") == 1:
if s.count("C") == 1:
s = s.replace("C", "c")
if s[1:].islower() == True:
print("AC")
exit()
print("WA") |
p03289 | s447706759 | Accepted | S = input()
ans = 0
if S[0]=="A":
S = S[1:]
if 1<=S.find("C")<=len(S)-2:
S = S[:S.find("C")]+S[S.find("C")+1:]
for s in S:
if 97<=ord(s)<=122:
ans+=1
if ans == len(S):
print("AC")
exit()
print("WA") |
p03289 | s982372334 | Accepted | s = input()
flag = True
flag = flag and s[0] == 'A'
Ccount = 0
for i in range(1,len(s)):
if ord('a') <= ord(s[i]) and ord(s[i]) <= ord('z'): continue
if s[i] == 'C' and 2 <= i and i <= len(s)-2:
Ccount += 1
else:
flag = False
print("AC" if flag and Ccount == 1 else "WA")
|
p03289 | s393238549 | Accepted | s = input()
if s[0]=='A' and 'C' in s[2:-1]:
s = s.replace('A','',1).replace('C','',1)
if s == s.lower():
exit(print('AC'))
print('WA') |
p03289 | s435955943 | Accepted | s = input()
ok = True
ok = ok and s[0] == 'A'
cs = 0
for i in range(2, len(s)-1):
if s[i] == 'C':
cs += 1
ok = ok and cs == 1
for i in range(1, len(s)):
if s[i].islower():
continue
if s[i] == 'C':
continue
ok = False
print('AC' if ok else 'WA')
|
p03289 | s062960371 | Accepted | if __name__ == '__main__':
s = input()
flg = False
if s[0] == "A":
tmp = s[2:-1]
if tmp.count("C") == 1:
tmp2 = s.replace("A","")
tmp2 = tmp2.replace("C","")
if tmp2.islower() == True:
flg = True
if flg == True:print("AC")
else: print("WA")
|
p03289 | s321219661 | Accepted | import sys
s = str(input())
if s[0] != 'A':
print('WA')
sys.exit()
test_st = s[2:-1]
#print(test_st)
test_stx =''
for i in range(len(test_st)):
if test_st[i] == 'C':
test_stx = s[1]+test_st[:i] + test_st[i+1:]+s[-1]
#print(test_stx)
if test_stx.islower() and len(test_stx) >0:
print('AC')
else:
print('WA')
|
p03289 | s130796699 | Accepted | import sys
S = input()
if S[0] != "A":
print("WA")
sys.exit()
if S[1:].count('C') != 1:
print("WA")
sys.exit()
Cindex = S.find("C")
if Cindex < 2 or Cindex > len(S)-2:
print("WA")
sys.exit()
T = 'a' + S[1:]
T = T[0:Cindex] + "c" + T[Cindex+1:]
if T.islower():
print("AC")
else:
print("WA") |
p03289 | s028047720 | Accepted | s=input()
cnt_1=0
cnt_2=0
for i in range(1,len(s)):
if i!=1 and i!=len(s)-1 and s[i]=="C":
cnt_2+=1
if s[i].islower():
cnt_1+=1
if s[0]=="A" and cnt_2==1 and cnt_1==len(s)-2:
print("AC")
else:
print("WA") |
p03289 | s194381599 | Accepted | import re
print("AC" if re.match("^A[a-z]+C[a-z]+$",input()) else "WA") |
p03289 | s846043129 | Accepted | s=input()
#print(s[1]+s[2:2+s[2:-1].index("C")]+s[s[2:-1].index("C")+1:])
if s[0]=="A" and s[2:-1].count("C")==1:
if (s[1]+s[2:2+s[2:-1].index("C")]+s[s[2:-1].index("C")+3:]).islower():
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s995338561 | Accepted | import sys
from collections import deque
def input(): return sys.stdin.readline().strip()
def main():
S = input()
if S[0] != 'A' or ord('A') <= ord(S[1]) <= ord('Z') or ord('A') <= ord(S[-1]) <= ord('Z'):
print("WA")
return
capital = []
for i in range(2, len(S) - 1):
if ord('a') <= ord(S[i]) <= ord('z'): continue
capital.append(S[i])
if capital == ['C']:
print("AC")
else:
print("WA")
if __name__ == "__main__":
main()
|
p03289 | s787428682 | Accepted | s = input()
n = len(s)
alp = [chr(ord('a')+i)for i in range(26)]
a = s[0] == 'A'
b = s.count('C') == 1 and s.index('C') >=2 and s.index('C')<= n-2
c = True
for i in range(n):
if i == 0:continue
if s[i] == 'C':continue
if s[i] not in alp:
c = False
ok = a and b and c
if ok:print('AC')
else:print('WA') |
p03289 | s812448538 | Accepted | s=input()
if s[0]=="A" and s[2:-1].count("C")==1:
c=s[2:-1].index("C")
if s[1:c+2].islower() and s[c+3:].islower():
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s566139258 | Accepted | s=input()
flag = "AC"
if s[0] != "A":
flag = "WA"
else:
if not "C" in s[2:-1]:
flag = "WA"
else:
ls = [c for c in s]
ls.remove("A")
ls.remove("C")
if not "".join(ls).islower():
flag = "WA"
#for c in ls:
#if c.isupper():
#flag = "WA"
print(flag) |
p03289 | s466779438 | Accepted | s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
t = s[1:].replace('C', '')
ans = 'AC' if t.lower() == t else 'WA'
else:
ans = 'WA'
print(ans) |
p03289 | s457827720 | Accepted | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
S = input()
if S[0] == "A" and S[2:-1].count("C") == 1 and S.count("A") == 1 and S.count("C") == 1:
S = S.replace("A", "")
S = S.replace("C", "")
if S == S.lower():
print('AC')
quit()
print('WA')
|
p03289 | s951265714 | Accepted | S = input()
def stringChecker(S):
if S[0] != 'A':
return False
cnt = 0
for l in S[2:-1]:
if l == 'C':
cnt += 1
if cnt != 1:
return False
lower_cnt = 0
for l in S:
if l.islower():
lower_cnt += 1
if lower_cnt != len(S) - 2:
return False
return True
if stringChecker(S):
print('AC')
else :
print('WA') |
p03289 | s956971974 | Accepted | s=input()
s_len=len(s)
ans="WA"
t=""
if s[0]!="A":
print(ans)
else:
t+=s[0].lower()
t+=s[1]
count=0
for i in range(2,s_len-1):
if s[i]=="C":
count+=1
t+=s[i].lower()
else:
t+=s[i]
t+=s[s_len-1]
if count!=1 or t!=s.lower():
print(ans)
else:
print("AC") |
p03289 | s975267176 | Accepted | S = list(input())
ans = 'AC'
if not S[0] == 'A':
ans = 'WA'
if not 'C' in (S[2:-1]):
ans = 'WA'
if ans == 'AC':
S.remove('A')
S.remove('C')
if not S == [s.lower() for s in S]:
ans = ('WA')
print(ans)
|
p03289 | s803805580 | Accepted | s=input()
if s[0]=="A" and s[2:len(s)-1].count("C")==1 and s[1:].replace("C","c").islower():
print("AC")
else:
print("WA") |
p03289 | s258454667 | Accepted | s = input()
if s[0] == "A" and s[2:-1].count("C") == 1 and s.replace("A","").replace("C","").islower():
print("AC")
else:
print("WA") |
p03289 | s405610402 | Accepted | #ABC104
s = input()
if s[0] == "A" and s[2:-1].count("C") == 1:
k = s[2:-1].index("C") + 2
if str.islower(s[1:k] + s[k+1:]):
print("AC")
else:
print("WA")
else:
print("WA")
|
p03289 | s149235070 | Accepted | S = list(input())
C = S[2:-1]
if S[0] == "A" and "C" in C and C.count("C") == 1:
S.remove("A")
S.remove("C")
T="".join(S)
Y=T.lower()
if T == Y:
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s308349154 | Accepted | import re
S = input()
if('A' in S[0]):
if('C' in S[2:-1]):
if(len(re.findall('[A-Z]',S)) == 2):
print('AC')
else:
print('WA')
else:
print('WA')
else:
print('WA')
|
p03289 | s239053152 | Accepted | S = input()
flag = True
c_count = 0
for i in range(0, len(S)):
if i == 0:
if S[i] != "A":
flag = False
break
elif i >= 2 and i <= (len(S) - 2):
if S[i] == "C":
c_count += 1
if ord("A") <= ord(S[i]) and ord(S[i]) <= ord("Z"):
if ord("A") != ord(S[i]) and ord("C") != ord(S[i]):
flag = False
break
if flag and c_count == 1:
print("AC")
else:
print("WA") |
p03289 | s202368097 | Accepted | word=input()
cflg=True
if word[0]!='A':
cflg=False
elif word[2:-1].count('C')!=1:
cflg=False
cnt=0
for l in word[1:]:
if l.isupper():
cnt+=1
else:
if cnt!=1:
cflg=False
if cflg:
print('AC')
else:
print('WA')
|
p03289 | s989725517 | Accepted | s = input()
if s[0] != 'A':
print('WA')
elif s[2:-1:].count('C') != 1:
print('WA')
else:
l = list(s[1::])
l.remove('C')
st = ''.join(l)
if st == st.lower():
print('AC')
else:
print('WA') |
p03289 | s021973041 | Accepted | s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
for i in s:
if i.islower() == True:
continue
elif i == 'A' or i == 'C':
continue
else:
print('WA')
exit()
else:
print('WA')
exit()
print('AC') |
p03289 | s620389313 | Accepted | import re
S = input()
if S[0] != "A" or len(re.findall("C", S[2:-1])) != 1:
print("WA")
exit()
if len(re.findall("[A-Z]", S)) != 2:
print("WA")
else:
print("AC") |
p03289 | s515076099 | Accepted | s = input()
if s[0] == "A":
cnt = 0
for i in range(2, len(s)-1):
if s[i] == "C":
cnt += 1
if cnt == 1:
s = list(s)
s.remove("A")
s.remove("C")
a = ",".join(s)
if a.islower() == True:
print("AC")
else:
print("WA")
else:
print("WA")
else:
print("WA") |
p03289 | s991637434 | 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 | s333943111 | Accepted | import sys
def main():
s = list(input())
if s[0] != 'A' or s[2:-1].count("C") != 1:
print("WA")
else:
for i in range(1, len(s)):
if ord(s[i]) < ord('a') and i != s.index('C'):
print("WA")
sys.exit(0)
print("AC")
if __name__ == "__main__":
main()
|
p03289 | s790482304 | Accepted | s=input()
n=len(s)
f=True
if s[0]!='A':
f=False
if s[2:n-1].count('C')!=1:
f=False
for ss in s:
if ss!='A' and ss!='C' and ss.isupper():
f=False
print('AC' if f else 'WA') |
p03289 | s858962110 | Accepted | def main():
s = input()
len_s = len(s)
if s[0] == "A" and \
s[2:-1].count("C") == 1 and \
sum(s[i].islower() for i in range(len_s)) == len_s - 2:
print("AC")
else:
print("WA")
main() |
p03289 | s128818750 | Accepted | s=input()
if s[0]!="A":
ans="WA"
else:
c_cnt=s.count("C",2,len(s)-1)
cnt=s.count("C")
if c_cnt!=1 or c_cnt!=cnt:
ans="WA"
else:
s=s.replace("C","c")
if s[1:].islower():
ans="AC"
else:
ans="WA"
print(ans) |
p03289 | s510523851 | Accepted | S = input()
rs = 'WA'
if S[0] == 'A' and S[2:-1].count('C')==1:
S = S[1:2]+S[2:-1].replace('C', '')+S[-1:]
if S.islower():
rs = 'AC'
print(rs) |
p03289 | s969555369 | 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 | s310111964 | Accepted | S = input()
ans = 0
if S[0] == 'A':
ans += 1
cnt = 0
for i in range(2, len(S)-1):
if S[i] == 'C':
cnt += 1
if cnt == 1:
ans += 1
cnt = 0
for i in range(len(S)):
if S[i].isupper():
cnt += 1
if cnt == 2:
ans += 1
if ans == 3:
print('AC')
else:
print('WA')
|
p03289 | s283312633 | Accepted |
def solve():
s = list(input())
if (s[0] == "A") and (s[2:-1].count("C") == 1):
s.remove("A")
s.remove('C')
if str(s).islower():
print("AC")
else:
print('WA')
else:
print('WA')
if __name__ == "__main__":
solve()
|
p03289 | s557682714 | Accepted | s = input()
ans = 1
if s[0] == "A":
ans += 1
part = s[2:-1]
if part.count("C") == 1:
ans += 1
for i in range(len(s)):
if 65 < ord(s[i]) <91 and ord(s[i]) != 67:
ans -= 1
print("AWCA"[ans<3::2]) |
p03289 | s109100360 | Accepted | S = input()
N = len(S)
out = "AC"
if S[0]!="A":
out = "WA"
cnt = 0
for i in range(2,N-1):
if S[i]=="C":
cnt+=1
if cnt!=1:
out = "WA"
al=[chr(ord('a') + i) for i in range(26)]
for i in range(1,N-1):
if S[i]!="C" and S[i] not in al:
out = "WA"
if S[N-1] not in al:
out = "WA"
print(out)
|
p03289 | s596512404 | Accepted | S = input()
if (S[0] == "A")and (S[2:len(S)-1].count("C") ==1):
if S.replace("A","",1).replace("C","",1).islower() == True:
print("AC")
else:
print("WA")
else:
print("WA")
|
p03289 | s685448291 | Accepted | S = input()
ans = 'AC'
if S[0] != 'A':
ans = 'WA'
cnt = 0
for i in range(1,len(S)):
if S[i].isupper():
if i == 1 or i == len(S)-1 or S[i] != 'C':
ans = 'WA'
cnt+=1
if cnt != 1:
ans = 'WA'
print(ans) |
p03289 | s224572301 | Accepted | #!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()
# flagで複数条件の管理をした方が頭がバグらない
flag = 1
if s[0] != "A": flag = 0
if s[2:-1].count("C") != 1: flag = 0
for i in range(len(s)):
if s[i] in "AC": pass
elif 97 <= ord(s[i]) <= 122: pass
else: flag = 0
print("AC" if flag else "WA") |
p03289 | s937203410 | Accepted | S=input()
if S[0]=="A" and S[2:-1].count("C")==1 and S[1].islower() and S[-1].islower():
for s in S[2:]:
if s!="C":
if s.islower():
print("AC")
exit()
print("WA")
|
p03289 | s991212928 | Accepted | s = str(input())
num = 0
if s[0] == "A":
if "C" in s[2:len(s)-1]:
for i in s:
if i.isupper():
num += 1
if num == 2:
print("AC")
exit(0)
print("WA") |
p03289 | s788477211 | Accepted | S = input()
if S[0] == "A" and S.count("A") == 1 and S.count("C") == 1:
p = S.find("C")
b = S.replace("A","").replace("C","")
if p > 1 and p < len(S) - 1 and b.islower():
print("AC")
else:
print("WA")
else:
print("WA")
|
p03289 | s399548722 | Accepted | s = list(input())
if s[0] != "A" or s.count("A") != 1 or s.count("C") != 1 or s[2:-1].count("C") != 1:
print("WA")
exit()
s.sort()
for i in range(2, len(s)):
if s[i].isupper():
print("WA")
exit()
print("AC")
|
p03289 | s475106133 | Accepted | S=input()
p='AC'
o=0
u=0
for i in range(len(S)):
if i==0 and S[i]!='A':
p='WA'
break
if 2<=i<=len(S)-2:
if S[i]=='C':
o+=1
if len(S)-2<i and o!=1:
p='WA'
break
if ord(S[i])<97:
if i==0 or 2<=i<=len(S)-2:
continue
else:
p='WA'
break
print(p) |
p03289 | s054215464 | Accepted | S = input()
N = len(S)
if S[0] == "A" and S[2:N-1].count("C") == 1 and sum(s.islower() for s in S) == N-2:
print("AC")
else:
print("WA") |
p03289 | s128738988 | Accepted | s=input()
if s[1]==s[1].upper() or s[-1]==s[-1].upper():
print("WA")
exit()
if s[0]=="A":
count=0
for i in range(2,len(s)-1):
if s[i]=="C":
count+=1
else:
if s[i]==s[i].upper():
print("WA")
exit()
if count==1:
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s064931314 | Accepted | s = input()
n = len(s)
if s[0] == "A" and s[2:n-1].count("C") == 1 and len(set(s.upper()) & set(s)) == 2:
print("AC")
else:
print("WA") |
p03289 | s861909902 | Accepted | s = input()
S = s[1]+s[2:-1].replace("C","c")+s[-1]
if s[0]=="A" and s[2:-1].count("C")==1 and s[-1]!="C" and S.islower():
print("AC")
else:
print("WA") |
p03289 | s264194949 | 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 | s828925757 | Accepted | s=input()
yn=0
if s[0]=="A" and ord(s[1])>95 and ord(s[len(s)-1])>95 and s.count("C")==1:
for i in range(len(s)-3):
if s[i+2]!="C" and ord(s[i+2])<92:
yn=1
if yn==1:
print("WA")
else:
print("AC")
else:
print("WA")
|
p03289 | s581362379 | Accepted | s=input()
if s[0]=="A" and s[2:-1].count("C") == 1 and s[1:].replace("C","c").islower():
print("AC")
exit()
print("WA") |
p03289 | s604974285 | Accepted | S = input()
if ord(S[0]) != 65:
print('WA')
else:
b = 0
c = 0
for i in range(1, len(S)):
if i != 1 and i != len(S) - 1 and ord(S[i]) == 67:
b += 1
elif ord(S[i]) <= 96 or 123 <= ord(S[i]):
c = 1
if b == 1 and c == 0:
print('AC')
else:
print('WA') |
p03289 | s980125432 | Accepted | S = list(input())
if S[0] == 'A':
isC = 0
for i in S[2:len(S)-1]:
if i == 'C':
isC += 1
else:
if isC == 1:
for i in range(len(S)):
if S[i] == 'A' or S[i] =='C' or S[i].islower():
pass
else:
print('WA')
break
else:
print('AC')
else:
print('WA')
else:
print('WA') |
p03289 | s379576199 | Accepted | S = input()
cond1 = (S[0]=="A")
cond2 = (S[2:len(S)-1].count("C") == 1)
flag = True
if not cond1:
flag = False
else:
if not cond2:
flag = False
else:
idx = S[2: len(S)-1].index("C") + 2
new = S[1:idx] + S[idx+1:]
if new != new.lower():
flag = False
if flag:
print("AC")
else:
print("WA")
|
p03289 | s948916753 | Accepted | a = input()
print('AC' if a[0] == 'A' and 'C' in a[2:-1] and a[1:].replace('C', '', 1).islower() else 'WA') |
p03289 | s851725640 | Accepted | s = input()
if s[0] != 'A':
print('WA')
exit()
if s[2:-1].count('C') != 1:
print('WA')
exit()
s = s[1:2] + s[2:-1].replace('C', '') + s[-1:]
if s.islower():
print('AC')
else:
print('WA')
|
p03289 | s997794583 | Accepted | def main():
S = input()
L, R = 2, len(S) - 2
if S[0] != 'A':
print('WA')
exit()
cnt = 0
for i in range(1, len(S)):
if S[i] == 'C' and L <= i <= R:
cnt += 1
continue
if S[i].isupper():
print('WA')
exit()
if cnt != 1:
print('WA')
else:
print('AC')
if __name__ == '__main__':
main()
|
p03289 | s065350051 | Accepted | s = input()
ans = 'WA'
if s[0] == 'A':
s = s[1:]
a = s[1:-1]
if a.count('C') == 1:
s = s.replace('C' , '' , 1)
if s.islower():
ans = 'AC'
print(ans) |
p03289 | s448962287 | Accepted | s = input()
ok = True
ok &= s[0] == 'A'
ok &= s[1].islower()
ok &= s[2:-1].count('C') == 1
ok &= all(c.islower() for c in s[2:-1] if c != 'C')
ok &= s[-1].islower()
print('AC' if ok else 'WA')
|
p03289 | s071554490 | Accepted | s = input()
if s[0]!="A":
print("WA")
exit()
ss = ""
count = 0
for i in range(2, len(s)-1):
if s[i] == "C":
count += 1
else:
ss += s[i]
sss = s[1]+ss+s[-1]
if count==1:
if sss.islower():
print("AC")
else:
print("WA")
else:
print("WA")
exit() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.