problem_id stringclasses 100
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 6 806 |
|---|---|---|---|
p03289 | s359026562 | Accepted | S = input()
Cflag = 0
if S[0] == 'A':
for i in range(1, len(S)):
if S[i] == 'C' and Cflag == 0 and 2 <= i < len(S)-1:
Cflag = 1
elif S[i] == 'C' and Cflag != 0:
print('WA')
exit()
elif ord(S[i]) < 97:
print('WA')
exit()
if Cflag == 1:
print('AC')
else:
print('WA')
else:
print('WA')
|
p03289 | s445467224 | Accepted | def check(s):
if s[0]!="A":
return 0
c = 0
for i in range(1,len(s)):
if s[1].isupper() or s[-1].isupper():
return 0
if s[i].isupper():
if c!=0:
return 0
if s[i]=="C":
c=1
else:
return 0
if c==0:
return 0
return 1
s = list(input())
if check(s):
print("AC")
else:
print("WA") |
p03289 | s262357368 | Accepted | s = input()
s_len = len(s)
if s[0] == "A":
if s[2:s_len-1].count("C") == 1:
dum = s.index("C")
s = s[1:dum]+s[dum+1:s_len]
if s == s.lower():
print("AC")
else:
print("WA")
else:
print("WA")
else:
print("WA") |
p03289 | s397341486 | Accepted | S="abcdefghijklmnopqrstuvwxyz"
s=input()
n=len(s)
flag=0
if s[0]!="A":
flag=1
cut=s[2:n-1]
if cut.count("C")!=1:
flag=1
else:
cut=s[1:]
for c in cut:
if ((not c in S) and c!="C"):
flag=1
break
if flag:
print("WA")
else:
print("AC") |
p03289 | s169631708 | Accepted | # -*- coding: utf-8 -*-
# 標準入力を取得
S = input()
# 求解処理
ans = "AC"
if S[0] != "A":
ans = "WA"
if S[2:-1].count("C") != 1:
ans = "WA"
else:
index = 2 + S[2:-1].index("C")
if not (S[1:index] + S[index + 1:]).islower():
ans = "WA"
# 結果出力
print(ans)
|
p03289 | s607265600 | Accepted | s = input()
n = len(s)
f = False
ans = s[0] == 'A'
for i in range(1,n):
if 'a' <= s[i] <= 'z': continue
if not f and i>1 and i<n-1 and s[i] == 'C':
f = True
continue
ans = False
break
if ans and f:
print('AC')
else:
print('WA')
|
p03289 | s137447478 | Accepted | import sys
def resolve(in_):
S = next(in_).strip()
if S[0] != 'A':
return False
if S.count('C', 2, -1) != 1:
return False
i = S.find('C')
a = S[1:i]
b = S[i + 1:]
if not (a.islower() and b.islower()):
return False
return True
def main():
answer = resolve(sys.stdin)
print('AC' if answer else 'WA')
if __name__ == '__main__':
main()
|
p03289 | s623760342 | Accepted | s = input()
def WA():
print('WA')
exit()
if s[0] != 'A':
WA()
if ord(s[-1]) < ord('a') or ord('z') < ord(s[-1]):
WA()
if ord(s[1]) < ord('a') or ord('z') < ord(s[1]):
WA()
s = s[1:]
ccnt = 0
for i in s[1:-1]:
if i == 'C':
ccnt += 1
elif ord(i) < ord('a') or ord('z') < ord(i):
print('WA')
exit()
if ccnt != 1:
print('WA')
exit()
else:
print('AC') |
p03289 | s775377717 | Accepted | s = list(input())
if s[0] == 'A' and s[2:-1].count('C') == 1 and s.count('C') == 1:
s.remove('A')
s.remove('C')
if (''.join(s)).islower() == True:
print('AC')
else:
print('WA')
else:
print('WA') |
p03289 | s375448247 | Accepted | S=input()
ans = "WA"
if S[0] == "A" and ("a" <= S[1] <= "z") and ("a" <= S[-1] <= "z"):
s0 = S[2:-1]
f = 0
for i in range(len(s0)):
if s0[i] == "C":
if f != 0:
ans = "WA"
else:
ans = "AC"
f = 1
print(ans)
|
p03289 | s913855382 | Accepted | s=input()
ans="AC"
if s[0]!="A":
ans="WA"
c=0
idx=0
for i in range(2,len(s)-1):
if s[i]=="C":
c+=1
idx=i
if c!=1:
ans="WA"
small={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}
for i in range(1,len(s)):
if i!=idx:
if s[i] not in small:
ans="WA"
break
print(ans)
|
p03289 | s003055925 | Accepted | s = input()
if s[0] == "A" and "C" in s[2:-1]:
d = s[2:-1].index("C")
A = s[1:d+2] + s[d+3:]
B = [j for j in range(ord("a"), ord("z") + 1)]
t = 0
for i in A:
if ord(i) not in B:
t = 1
break
if t == 0:
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s986940702 | Accepted | s = input()
if s[0].isupper() 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 | s215728009 | Accepted | S=list(map(lambda x:x,input()))
F=(S[0]=="A")
F&=(S[2:-1].count("C")==1)
if F:
S.remove("A")
S.remove("C")
for s in S:
F&=(s==s.lower())
if F:
print("AC")
else:
print("WA")
|
p03289 | s187089262 | Accepted | S=input()
if (S[0]=='A' and S[2:-1].count('C')==1):
pos=S.index("C")
check=S[1:pos]+S[pos+1:]
if check.islower():
print('AC')
else:
print('WA')
else:
print('WA') |
p03289 | s634694726 | Accepted | S=input()
if S[0]!="A":
print("WA")
exit()
if "C" not in list(S[2:-1]):
print("WA")
exit()
S=list(S)
ans=0
for i in S:
if i.islower()==True:
ans+=1
if ans!=(len(S)-2):
print("WA")
exit()
print("AC") |
p03289 | s312120637 | Accepted | S = input()
if S[0] != 'A':
print('WA')
exit()
if S[2:-1].count('C') != 1:
print('WA')
exit()
for i in S[1:].split('C'):
if not i.islower():
print('WA')
exit()
print('AC')
|
p03289 | s001241637 | Accepted | s = list(input())
if s[0] == "A":
if len([True for c in s[2:-1:] if c == "C"]) == 1:
s.remove("A")
s.remove("C")
for c in s:
if not c.islower():
print("WA")
exit()
print("AC")
exit()
print("WA")
|
p03289 | s275747389 | Accepted |
s = list(input())
status = 0
c = 0
word = [chr(ord('A') + i) for i in range(26)]
if s[0] != "A":
status = 1
elif s.count("C") == 0:
status = 1
else:
if s.count("C") == 1 and 2<=s.index("C")<=len(s)-2:
del s[0]
del (s[s.index("C")])
for i in word:
if i in s:
status = 1
break
else:
status = 1
if status == 0:
print("AC")
else:
print("WA")
|
p03289 | s223144217 | Accepted | s = input()
ac = True
c = True
if s[0] != "A":
ac = False
if not ord("a") <= ord(s[1]) <= ord("z"):
ac = False
if not ord("a") <= ord(s[-1]) <= ord("z"):
ac = False
for i in range(2, len(s)-1):
if s[i] == "C":
if c:
c = False
else:
ac = False
else:
if not ord("a") <= ord(s[i]) <= ord("z"):
ac = False
if c:
ac = False
if ac:
print("AC")
else:
print("WA")
|
p03289 | s840511106 | Accepted | #!/usr/bin/env python3
s=input()
if s[0] == 'A' and 1 < s.find('C') < len(s) - 1 and (s[1:s.index('C')]+s[s.index('C')+1:]).islower():
print("AC")
else:
print('WA')
|
p03289 | s228781586 | Accepted | s=input()
if s[0]=="A" and "C" in s[2:-1] and s[1:].replace("C","",1).islower():
print("AC")
else:
print("WA")
|
p03289 | s753313646 | Accepted | s = input()
s1 = s[0]
s2 = s[2:-1]
s = s.replace('A','')
s = s.replace('C','')
t = s.lower()
if(s1 == 'A' and s2.count('C') == 1 and t == s):
print('AC')
else:
print('WA') |
p03289 | s971672471 | Accepted | s = input()
ans = 'AC'
if s[0] != 'A':
ans = 'WA'
if not('C' in s[2:-1]):
ans = 'WA'
s = s.replace('A','')
s = s.replace('C','',1)
for i in s:
if ord(i) < ord('a') or ord(i) > ord('z'):
ans = 'WA'
print(ans)
|
p03289 | s458894668 | Accepted | s = str(input())
if s[0] == 'A' and s[2:len(s)-1].count('C') == 1:
j = s.index('C')
w = s[1:j] + s[j+1:]
if w.lower() == w:
print('AC')
else:
print('WA')
else:
print('WA') |
p03289 | s953201789 | Accepted | s = input()
ans = 'AC'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(s)):
if i == 0:
if s[i] != 'A':
ans = 'WA'
if i == 1 or i == len(s)-1:
if s[i] not in ascii_lowercase:
ans = 'WA'
if s[2:-1].count('C') != 1:
ans = 'WA'
print(ans) |
p03289 | s738670925 | Accepted | S = input()
charset = set(list(S))
if 'A' in charset:
charset.remove('A')
if 'C' in charset:
charset.remove('C')
# print(f'S:{S} charset:{charset}', file=sys.stderr)
if S[0] == 'A' and S[2:-1].count('C') == 1 and ''.join(charset).islower():
print('AC')
else:
print('WA') |
p03289 | s176528358 | Accepted | s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
for i in range(1,len(s)):
if s[i].islower() == True:
continue
else:
if s[i] == 'C':
continue
else:
print('WA')
exit()
else:
print('WA')
exit()
print('AC') |
p03289 | s496198475 | Accepted | s=list(input())
cnt=0
if s[0]!='A':
print('WA')
exit()
for i in range(2,len(s)-1):
if s[i]=='C':
cnt+=1
if cnt!=1:
print('WA')
exit()
cnt=0
for i in s:
if i.isupper():
cnt+=1
if cnt!=2:
print('WA')
else:
print('AC') |
p03289 | s498333460 | Accepted | S=input()
print('AC'if'A'in S and 'C'in S[2:-1] and S[1:].replace('C','',1).islower() else'WA') |
p03289 | s104136123 | Accepted | s = input()
n = len(s)
p = list(s[2:(n-1)])
if s[0] == "A":
flag = 1
else:
print("WA")
quit()
cnt = 0
for i in range(2,n-1):
if s[i] == "C":
cnt += 1
elif s[i].isupper():
flag = 0
if flag and s[1].islower() and s[n-1].islower() and cnt==1:
print("AC")
else:
print("WA") |
p03289 | s358723117 | Accepted | s = input()
num_C = 0
for i in range(len(s)):
if i == 0:
if s[i] != 'A':
print('WA')
exit()
elif i >= 2 and i <= len(s)-2:
if s[i] == 'C': num_C += 1
else:
if ord(s[i]) < ord('a') or ord(s[i]) > ord('z'):
print('WA')
exit()
if num_C != 1:
print('WA')
exit()
print('AC') |
p03289 | s709633377 | Accepted | s = input()
if s[0]=="A" and s[2:-1].count("C")==1:
sc = s.index("C")
if (s[1:sc]+s[sc+1:]).islower():
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s713380367 | Accepted | #!/usr/bin/env python3
import collections
S = input()
a = S[0] == "A"
b = collections.Counter(S[2:-1])["C"] == 1
c = S.replace("A", "").replace("C", "").islower()
ans = "AC" if a and b and c else "WA"
print(ans)
|
p03289 | s523944783 | 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 | s796989077 | Accepted | S=str(input())
cnt=0
T = S.replace("C","").replace("A","")
for i in range(2,len(S)-1):
if S[i] =='C':cnt+=1
if cnt==1 and S[0]=='A' and T.islower():
print("AC")
exit()
print("WA") |
p03289 | s047393161 | Accepted | s = input()
if s[0] != 'A':
print('WA')
exit(0)
if s[2:-1].count('C') != 1:
print('WA')
exit(0)
for i in range(1,len(s)):
if i >= 2 and i < len(s)-1 and s[i] == 'C':
continue
if not (ord('a') <= ord(s[i]) and ord(s[i]) <= ord('z')):
print('WA')
exit(0)
print('AC') |
p03289 | s381678309 | Accepted | import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy
S = list(input())
def ok(s):
if S[0] != 'A':
return False
if S[-1] == 'C' or S[1] == 'C':
return False
if len(list(filter(lambda x : x == 'C', S[2:]))) != 1:
return False
if list(map(lambda x: x.lower() if x not in ['A', 'C'] else x, s)) != s:
return False
return True
print("AC" if ok(S) else "WA") |
p03289 | s123777062 | 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 | s511881188 | Accepted | import re
s=input()
if s[0]=="A" and "C" in s[2:-1] and len(re.findall('[A-Z]', s))==2:
print("AC")
else:
print("WA") |
p03289 | s874510733 | Accepted | import re
txt = input()
z = re.match("^A[a-z]+C[a-z]+$", txt)
print("AC" if z else "WA") |
p03289 | s256215979 | Accepted | S = input()
NG = ['B','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
ans = 'AC'
if S[2:-1].count('C') != 1:
ans = 'WA'
for i in range(len(S)):
if i == 0 and S[0] != 'A':
ans = 'WA'
break
elif i == S[2:-1].find('C'):
continue
elif S[i] in NG:
ans = 'WA'
print(ans) |
p03289 | s526736472 | Accepted | def main():
string = input()
if string[0] == "A" and string[2:-1].count("C") == 1 and string.replace("A", "").replace("C", "").islower():
print("AC")
else:
print("WA")
if __name__ == '__main__':
main() |
p03289 | s080574645 | Accepted | s = list(input())
ll = len(s)
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 == ll - 1 or s[i] != 'C':
ans = 'WA'
cnt += 1
if cnt != 1:
ans = 'WA'
print(ans) |
p03289 | s449791234 | Accepted | s=list(input())
s1=s[2:-1]
f=True
if s[0]!='A':
f=False
elif 'C' not in s1:
f=False
else:
s.remove('A')
s.remove('C')
if str(s).islower():
pass
else:
f=False
if f:
print('AC')
else:
print('WA') |
p03289 | s552343887 | Accepted | import sys
s = list(input())
if s[0] != "A":
print("WA"); sys.exit()
else:
s[0] = "a"
if "C" in s[2:-1]:
s[s[2:-1].index("C") + 2] = "c"
else:
print("WA"); sys.exit()
if all([i.islower() for i in s]):
print("AC")
else:
print("WA") |
p03289 | s994957244 | Accepted |
S=str(input())
temp=0
j=0
if S[0]!='A':
print('WA')
exit()
for i in range(2,len(S)-1):
if S[i]=='C':
temp+=1
j=i
if temp!=1:
print('WA')
exit()
for i in range(len(S)):
if i!=0 and i!=j:
if S[i].isupper():
print('WA')
exit()
print('AC')
exit() |
p03289 | s452768965 | Accepted | S=input()
chk = [False, False, False]
if S[0]=="A":
chk[0]=True
ind = 0
for i in range(2, len(S)-1):
if S[i]=="C":
chk[1]=True
ind=i
chk[2]=True
for i in range(len(S)):
if i==ind or i==0:
continue
if S[i].isupper():
chk[2]=False
if chk[0] and chk[1] and chk[2]:
print("AC")
else:
print("WA") |
p03289 | s822278516 | Accepted | word = input()
import re
dst = ""
if word[0] == "A":
if len(re.findall("C", word[2:-1])) == 1:
if len(re.findall(r"[a-z]", word)) == len(word) - 2:
dst = "AC"
if not dst:
dst = "WA"
print(dst)
|
p03289 | s832890132 | Accepted | S = input()
L = [chr(i) for i in range(97, 97+26)]
if S[0] == "A":
c = 0
for i in range(2,len(S)-1):
if S[i] == "C":
c +=1
k = i
if c == 1:
T = "AC"
for j in range(1,len(S)):
if j != k:
if not S[j] in L:
T = "WA"
break
print(T)
else:
print("WA")
else:
print("WA") |
p03289 | s963650628 | Accepted | S = input()
ans = True
if S[0] != 'A':
ans = False
if not ('a' <= S[1] and S[1] <= 'z'):
ans = False
cnt = 0
for s in S[2:-1]:
if s == 'C':
cnt += 1
else:
if not ('a' <= s and s <= 'z'):
ans = False
if cnt != 1:
ans = False
if not ('a' <= S[-1] and S[-1] <= 'z'):
ans = False
if ans:
print("AC")
else:
print("WA")
|
p03289 | s270247315 | Accepted | S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
s = S.replace('A', 'a').replace('C', 'c')
t = s.lower()
if s == t:
print('AC')
exit()
print('WA') |
p03289 | s346623758 | Accepted | s=input()
print("AC" if "C" in s[2:-1] and "A" is s[0] and s[1:].replace("C","",1).islower() else "WA") |
p03289 | s395167243 | Accepted | s=list(input())
n=len(s)
if s[0]=="A" and "C" in s[2:n-1]:
check=s[1:]
check.remove("C")
s="".join(check)
if s==s.lower():
print("AC")
else:
print("WA")
else:
print("WA") |
p03289 | s485171287 | Accepted | from collections import Counter
s = list(input())
n = len(s)
count = Counter(s[2:-1])
lower = [i for i in s if ord('a')<=ord(i)<=ord('z')]
if count.get('C'):
if count['C']==1 and s[0]=='A' and len(lower)==n-2:
print('AC')
exit()
print('WA') |
p03289 | s277182198 | Accepted | S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in range(len(S)):
if len([1 for x in letter if x==S[i]]) == 1:
count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
print('AC')
else:
print('WA')
|
p03289 | s870245065 | Accepted | s = input()
if s[0] != 'A': print('WA')
else:
c_cnt = 0
end_p = len(s)-2
for i in range(1,len(s)):
# C判定
if 2 <= i <= end_p and s[i] == 'C':
c_cnt += 1
# 小文字かどうか
elif s[i] != s[i].lower():
print('WA')
exit()
if c_cnt != 1:
print('WA')
else:
print('AC') |
p03289 | s592996780 | Accepted | s = input()
count_c = 0
if s[0] == 'A':
if s[2:-1].count('C') == 1:
for i in range(1, len(s)):
if 97 <= ord(s[i]) <= 122:
continue
else:
count_c += 1
if count_c > 1:
print("WA")
else:
print("WA")
else:
print("WA")
if count_c == 1:
print("AC")
|
p03289 | s865074027 | Accepted | import math
s=input()
x=s.find("C")
ok=True
for i in range(len(s)):
if i==0 or i==x:
continue
if not s[i].islower():
ok=False
if(s[0]=='A' and 2<=x<=len(s)-2 and ok):
print("AC")
else:
print("WA")
|
p03289 | s739012203 | Accepted | s = input()
if not s[0] == "A":
print ("WA")
exit ()
if not list(s[2:-1]).count("C") == 1:
print ("WA")
exit ()
s = (s.replace('A','')).replace('C','')
if s.islower():
print ("AC")
else:
print ("WA")
|
p03289 | s127558746 | Accepted | S=input()
if S[0]!="A":
print("WA")
else:
cnt_C=0
for i in range(2,len(S)-1):
if S[i]=="C":
cnt_C+=1
if cnt_C!=1:
print("WA")
else:
cnt_upper=0
for i in range(len(S)):
if S[i].isupper():
cnt_upper+=1
if cnt_upper!=2:
print("WA")
else:
print("AC")
|
p03289 | s539833335 | Accepted | s=input()
boo=True
if s[0]!='A':
boo=False
C=0
for i in range(2,len(s)-1):
if s[i]=='C':
C+=1
if C>1 or C<1:
boo=False
l=0
for i in range(len(s)):
if s[i].lower()!=s[i]:
l+=1
if l>2 or l<2:
boo=False
if boo:
print("AC")
else:
print("WA")
|
p03289 | s716698560 | Accepted | s=input()
flag=True
count=0
if(s[0]!='A'):
flag=False
for i in range(2,len(s)-1):
if(s[i]=='C'):
count+=1
if(count!=1):
flag=False
for i in s:
if(i.islower()==False and i!='A' and i!='C'):
flag=False
if(flag==True):
print("AC")
else:
print("WA")
|
p03289 | s955187120 | Accepted | from collections import Counter
l=input()
s=list(l)
k=0
if s[0]=='A':
for i in range(2,len(s)-1):
if s[i]=='C':
k+=1
if k==1:
if l.replace('A', 'a').replace('C', 'c') == l.lower():print('AC')
else:print('WA')
else:print('WA')
else:print('WA') |
p03289 | s276158016 | Accepted | S=input()
if S[0]=="A" and S[2:-1].count("C")==1:
SC = S.index("C")
if (S[1:SC]+S[SC+1:]).islower():
print("AC")
else:
print("WA")
else:
print("WA")
|
p03289 | s536632131 | Accepted | s = input()
flag = 1
if s[0] == "A":
tmp = s[2:-1].find("C")
if tmp >= 0:
tmp2 = s[1]
tmp2 += s[2:tmp+2]
tmp2 += s[tmp+3:]
if tmp2 == tmp2.lower():
flag = 0
if flag == 0:
print("AC")
else:
print("WA")
|
p03289 | s839127075 | Accepted | S = input()
cnt = S[2:-1].count('C')
for s in S[1:]:
if s.isupper() and s != 'C':
print('WA')
break
else:
if S[0] == 'A' and cnt == 1:
print('AC')
else:
print('WA') |
p03289 | s474734694 | Accepted | s=input()
if s[0] != 'A':
print('WA')
exit()
if s[2:len(s)-1].count('C') != 1:
print('WA')
exit()
for i in range(1,len(s)):
if s[i]=='C':
continue
if s[i].isupper() == True:
print('WA')
exit()
print('AC') |
p03289 | s578349036 | Accepted | s = list(input())
if s[0] != 'A':
print('WA')
elif s[2:-1].count('C') != 1:
print('WA')
else:
i = s.index('C')
s.pop(i)
s.pop(0)
s = ''.join(s)
if s.islower():
print('AC')
else:
print('WA') |
p03289 | s025388768 | Accepted | import sys
s = sys.stdin.readline().rstrip()
def main():
if s[0] == 'A':
if 'C' in s[2:-1]:
cnt = 0
for letter in s:
if 65 <= ord(letter) <= 90:
cnt += 1
if cnt == 2:
return 'AC'
return 'WA'
if __name__ == '__main__':
ans = main()
print(ans) |
p03289 | s727506242 | Accepted | S = input()
OK = False
# if S[0] == 'A' and S[2] == 'C':
# if S[1].islower() and S[3:].islower():
# OK = True
# # print(S[3:], S[3:].islower())
# if S[0] == 'A' and S[-2] == 'C':
# if S[1:-2].islower() and S[-1].islower():
# OK = True
for i in range(2, len(S)-1):
if S[0] == 'A' and S[i] == 'C':
if S[1:i].islower() and S[i+1:].islower():
OK = True
if OK:
print('AC')
else:
print('WA') |
p03289 | s507941040 | Accepted | s = input()
# 大文字チェック
count = 0
for c in s:
if c.isupper():
count += 1
if count != 2:
print("WA")
exit()
if s[0] != "A":
print("WA")
exit()
if s[2:len(s) - 1].count("C") != 1:
print("WA")
exit()
print("AC")
|
p03289 | s124580702 | Accepted | S = input()
if S[0] == 'A':
if S[2:-1].count('C') == 1:
S1 = S.replace('A', '')
S2 = S1.replace('C', '')
if all([x.islower() for x in S2]):
print('AC')
exit()
print('WA') |
p03289 | s399689375 | Accepted | import sys
s = list(input())
if s[0] != "A":
print("WA")
sys.exit()
c = 0
for i in range(2,len(s)-1):
if s[i] == "C":
c += 1
if c != 1:
print("WA")
sys.exit()
c = 0
for i in range(len(s)):
if ord(s[i]) >= 65 and ord(s[i]) <= 90:
c += 1
if c == 2:
print("AC")
else:
print("WA") |
p03289 | s533602811 | Accepted | s = list(input())
ans = "AC"
if s[0] == "A" and "C" in s[2:-1] and s.count("C") == 1 and s[1].islower():
for i in range(3, len(s)):
if not s[i].islower() and s[i] != "C":
ans = "WA"
break
else:
ans = "WA"
print(ans) |
p03289 | s448462881 | Accepted | s = input()
ls = len(s)
sc = s[2:-1]
big = 0
import collections
c = collections.Counter(sc)
if s[0]=="A":
if c["C"]==1:
for i in range(ls):
if s[i].isupper():
big +=1
if big ==2:
print("AC")
exit()
print("WA") |
p03289 | s443253378 | Accepted | def main():
s = input()
if s[0] != 'A':
print('WA')
exit()
if s[2:-1].count('C') != 1:
print('WA')
exit()
s = s[1:]
s = s.replace('C','')
if not s.islower():
print('WA')
exit()
print('AC')
if __name__ == '__main__':
main() |
p03289 | s142930651 | Accepted | s = input()
t = 'a'
for i in range(1, len(s)):
if s[i] == 'C':
t += 'c'
else:
t += s[i]
if s[0] == 'A' and s[2:-1].count('C') == 1 and t.islower():
print('AC')
else:
print('WA') |
p03289 | s417237393 | Accepted | import re
ans=re.match("A[a-z]+C[a-z]+$",input())
print("AC" if ans else "WA") |
p03289 | s752794498 | Accepted | s = list(input())
ans = 1
sw = 0
for i in range(len(s)):
if i == 0 :
if s[0] !="A":
ans = 0
elif 2 <= i <= len(s)-2 and s[i] == "C":
sw += 1
else:
if not(97<= ord(s[i]) <= 122):
ans = 0
if ans == 1 and sw == 1:
print("AC")
else:
print("WA") |
p03289 | s376928585 | Accepted | s = input()
if s[0] == 'A':
t = ''
c_cnt = 0
for i in range(1, len(s)):
if s[i] != 'C':
t += s[i]
else:
c_cnt += 1
if t.islower() and 'C' in s[2:-1] and c_cnt == 1:
print('AC')
else:
print('WA')
else:
print('WA')
|
p03289 | s311304342 | 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 | s270716278 | Accepted | S = input()
jdg = True
cnt = 0
for i, s in enumerate(S):
if i == 0 and s != 'A':
jdg = False
break
if (i == 1 or i == len(S) - 1) and not s in 'abcdefghijklmnopqrstuvwxyz':
jdg = False
break
if 2 <= i <= len(S) - 2 and s == 'C':
cnt += 1
if i >= 1 and not s in 'abcdefghijklmnopqrstuvwxyzC':
jdg = False
break
if cnt != 1: jdg = False
print('AC' if jdg else 'WA') |
p03289 | s843107953 | Accepted | s = input()
flag = True
if s[0] != 'A':
flag = False
cnt_second = 0
second = s[2:-1]
for x in second:
if x == 'C':
cnt_second += 1
if cnt_second != 1:
flag = False
cnt_third = 0
for x in s:
if x.isupper():
cnt_third += 1
if cnt_third != 2:
flag = False
print('AC' if flag == True else 'WA') |
p03289 | s869165444 | Accepted | S = list(input().strip())
flag = False
if S[0] == "A" and "C" in S[2:-1]:
count = 0
for s in S:
#if s < "a":
if "A" <= s <= "Z":
count += 1
if count == 2:
flag = True
if flag:
print("AC")
else:
print("WA") |
p03289 | s568967684 | Accepted | S = input()
# S = 'AaCa'
# print( S[1], S[-1], S[3:-2])
b = True
b = b and (S[0]=='A')
b = b and ( S[2:-1].count('C')==1 )
b = b and ( 'a' <= S[1] <= 'z')
b = b and ( 'a' <= S[-1] <= 'z')
for c in S[3:]:
b = b and ( ('a' <= c <= 'z') or (c=='C') )
print( "AC" if b else "WA" )
|
p03289 | s017305405 | Accepted | #!/usr/bin/env python3
s = str(input())
flag = 1
if s[0] != "A":
flag = 0
num_C = 0
for i in s[2:-1]:
if i == "C":
num_C += 1
for i in s[1:]:
if i != "C" and i.isupper():
flag = 0
if num_C != 1:
flag = 0
if flag == 0:
print("WA")
else:
print("AC")
|
p03289 | s880621998 | Accepted | s = input()
if s[0]=='A':
cnt = 0
for t in s[2:-1]:
if t=='C':
cnt += 1
s=s.replace(t,'')
if cnt==1 and s[1:].islower()==True:
print('AC')
exit()
print('WA') |
p03289 | s935449816 | 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 | s871594661 | Accepted | import sys
input = sys.stdin.readline
S = list(input().rstrip('\n'))
# print(S[2:-1])
if S[0] == 'A' and S[2:-1].count('C') == 1:
S.remove('A')
S.remove('C')
S = ''.join(S)
# print(S)
if S.islower():
print("AC")
else:
print("WA")
else:
print("WA")
|
p03289 | s635747130 | Accepted | import sys
S = input()
cnt = 1
tmp = 0
if S[0] == 'A':
for i in range(2, len(S)-1):
if S[i] == 'C':
tmp = i
cnt -= 1
if cnt == 0:
for i in range(len(S)):
if S[i].isupper() is True and i != 0 and i != tmp:
print('WA')
sys.exit()
print('AC')
else:
print('WA')
|
p03289 | s917253180 | Accepted | s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
for c in s[1:]:
if c != 'C' and c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
print('WA')
exit()
print('AC')
else:
print('WA') |
p03289 | s838812662 | Accepted | s=input()
if s[0]=="A" and s[2:-1].count("C")==1:
s=s[1:2]+s[2::].replace("C","")
if s.islower()==True:
print("AC")
exit()
print("WA") |
p03289 | s106959319 | Accepted | S = input()
if S[0]!='A':
print('WA')
exit()
else:
S_withoutA = S.replace('A','')
S_part = [i for i in S[2:-1] if i=='C']
if len(S_part) != 1:
print('WA')
exit()
else:
S_withoutAC = S_withoutA.replace('C','')
if S_withoutAC.islower():
print('AC')
else:
print('WA') |
p03289 | s393545701 | Accepted | def sol():
S = input()
if S[0] != 'A':
print('WA')
return
if S[2: -1].count('C') != 1:
print('WA')
return
for s in S[2:-1]:
if s != 'C' and s.isupper():
print('WA')
return
if S[1].isupper() or S[-1].isupper():
print('WA')
return
print('AC')
sol() |
p03289 | s408065386 | 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 | s576256365 | Accepted | def main():
s = input()
if s[0] == "A" and s.count("C", 2, -1)==1:
s = s.replace("A", "")
s = s.replace("C", "")
if s.islower() == True:
print("AC")
else:
print("WA")
else:
print("WA")
if __name__ == '__main__':
main() |
p03289 | s025626516 | Accepted | #!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()
if s[0] != "A": print("WA")
elif s[2:-1].count("C") != 1: print("WA")
else:
for i in range(len(s)):
if s[i] in "AC": pass
elif 97 <= ord(s[i]) <= 122: pass
else:
print("WA")
exit(0)
print("AC")
|
p03289 | s814679531 | Accepted | S = input()
flag = True
count = 0
if not S[0] == "A":
flag = False
for i in range(2,len(S)-1):
if S[i] == "C":
count += 1
else:
if not S[i].islower():
flag = False
if not S[1].islower():
flag = False
if not S[len(S)-1].islower():
flag = False
if not count == 1:
flag = False
if flag:
print("AC")
else:
print("WA") |
p03289 | s113390456 | Accepted | s=input()
if (s[0]=="A" and s[2:-1].count("C")==1):
pos=s.index("C")
check=s[1:pos]+s[pos+1::]
if (check.islower()):
print("AC")
else:
print("WA")
else:
print("WA") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.