Problem:


Score : 200 points

Problem Statement

You are given a string S. Each character of S is uppercase or lowercase English letter.
Determine if S satisfies all of the following conditions:

The initial character of S is an uppercase A.

There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).

All letters except the A and C mentioned above are lowercase.

Constraints

4 ≤ |S| ≤ 10 (|S| is the length of the string S.)

Each character of S is uppercase or lowercase English letter.

Input

Input is given from Standard Input in the following format:

S

Output

If S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.

Sample Input 1

AtCoder

Sample Output 1

AC

The first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.

Sample Input 2

ACoder

Sample Output 2

WA

The second letter should not be C.

Sample Input 3

AcycliC

Sample Output 3

WA

The last letter should not be C, either.

Sample Input 4

AtCoCo

Sample Output 4

WA

There should not be two or more occurrences of C.

Sample Input 5

Atcoder

Sample Output 5

WA

The number of C should not be zero, either.



Sample input:
AtCoder


Sample output:
AC

Submission status: Accepted

Solution code:
s = input()
ans = "WA"
if s[0] == "A":
    cnt = 0
    for i in s[2:-1]:
        if i == "C":
            cnt += 1
    if cnt == 1:
        upper_cnt = 0
        for j in s:
            if j.isupper():
                upper_cnt += 1
        if upper_cnt == 2:
            ans = "AC"

print(ans)

Submission status: Accepted

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-08 18:39:24(JST)
### modules
## from standard library
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
## from external libraries
# import scipy.special   # if use comb function on AtCoder, 
# import scipy.misc      # select scipy.misc.comb (old version)  
# imort numpy as np 

def main():
    s = sys.stdin.readline().rstrip()
    
    if s[0] == 'A':
        s = s[1:]
        if 'C' in s[1:-1] and s.count('C') == 1:
            s = s.replace('C', 'a')
            if s.lower() == s:
                print('AC')
                exit()

    print('WA')
 
if __name__ == "__main__":
    # execute only if run as a script
    main()

Submission status: Accepted

Solution code:
inp = input()
count = 0
index = 0
for i in range(len(inp[2:-1])):
  if inp[2:-1][i] == "C":
      count += 1
      index = i
if inp[0] == "A" and count == 1 and (inp[1:2+index]+inp[3+index:]).islower():
  print("AC")
else: 
  print("WA")

Submission status: Accepted

Solution code:
s = input()
def BFunc(s):
    s = list(s)
    if s[0] != 'A':
        return False
    s.pop(0)
    c_cnt = 0
    for i in range(1, len(s) - 1):
        if s[i] is 'C':
            c_cnt += 1
            if c_cnt > 1:
                return False
            s.pop(i)
    if c_cnt != 1:
        return False
    for i in range(len(s)):
        if not s[i].islower():
#             print(s)
            return False
    return True
if BFunc(s):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
if s[0]=="A" and (s[2:-1]).count("C")==1 and ((s[1]+s[-1])+s[2:-1].replace("C", "")).islower():
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
s = input()
print('AC' if s[0] == 'A' and s[2:-1].count('C') == 1
      and s[1:].replace('C','').islower() else 'WA')

Submission status: Accepted

Solution code:
s = input()
if s[0] == 'A':
  if s[2:-1].count('C') == 1:
    s = s.replace('A','')
    s = s.replace('C','')
    if s[:].islower():
      print('AC')
      exit()
print('WA')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import re

S = input()
flag = 0
if(S[0] == 'A'):
  if(len(re.findall('C', S[2:-1])) == 1):
    index = S[2:-1].find('C') + 2
    ss = 'a' + S[1:index] + 'c' + S[index+1:]
    if(S.lower() == ss):
      flag = 1

if(flag == 1):
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
s = input()
if s[0] == "A" and s[2:-1].count("C") == 1 and sum("a" <= i <= "z" for i in s[1:]) == len(s)-2:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()

print("AC" if s[0] == "A" and "C" in s[2:-1] and s[1:].replace("C","",1).islower() else "WA")

Submission status: Accepted

Solution code:
import sys

s = input()
if s[0] == "A" and s.count("C") == 1 and "C" in s[2:-1]:
    ss = set(s)
    ss.remove("A")
    ss.remove("C")
    SS = set([i.upper() for i in ss])
    if len(ss & SS) == 0:
        print("AC")
        sys.exit()

print("WA")

Submission status: Accepted

Solution code:
S = str(input())
hantei = True
if S[0]!='A':
  hantei = False
if S[2:-1].count('C') != 1:
  hantei = False
if S[1:].replace('C','') != (S[1:].replace('C','')).lower():
  hantei = False
print('AC' if hantei else'WA')

Submission status: Accepted

Solution code:
s = list(input())
ans = 'WA'

if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        s.remove('C')
        if str(s[1:]).islower():
            ans = 'AC'

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# input
S = input()

# solve
ans = False
if S[0] == 'A' and S[1] != 'C' and S[2:len(S) - 1].count('C') == 1 and S.replace('A', '').replace('C', '').islower():
    ans = True

# output
print('AC' if ans else 'WA')

Submission status: Accepted

Solution code:
def main():
    s = input()

    if s[0] != 'A':
        print("WA")
        return

    margin = s[2:len(s) - 1]
    count = 0

    for i in margin:
        if i == "C":
            count += 1
        if count >= 2:
            print("WA")
            return

    if count != 1:
        print("WA")
        return
    s = s[1:]
    s = s[:s.find("C")] + s[s.find("C")+1:]
    if s.islower():
        print("AC")
        return
    else:
        print("WA")
        return


main()

Submission status: Accepted

Solution code:
S = input()
if not S[0] is "A":
  print("WA")
  exit()

subS = S[2:-1]
if not (("C" in subS) and (subS.count('C') == 1)):
  print("WA")
  exit()

subS = S.replace('A', '').replace('C','')
if not subS.islower():
  print("WA")
  exit()

print("AC")

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    S = input()[:-1]
    
    if S[:1]!="A":
        print("WA")
        return
    if S[2:len(S)-1].count("C")!=1:
        print("WA")
        return
    for i in range(1, len(S)):
        if S[i:i+1].isupper() and S[i:i+1] not in "AC":
            print("WA")
            return
    
    print("AC")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = list(input())
ans = "AC"
if S[0] != "A":
    ans = "WA"
else:
    count = 0
    for i in S[2:-1]:
        if i == "C":
            count += 1
    if count != 1:
        ans = "WA"
    else:
        for i in S:
            if i not in ["A","C"] and str.islower(i) != True:
                ans = "WA"
print(ans)

Submission status: Accepted

Solution code:
S = input()

count = 0

if S[0] == "A":
    count += 1
    
count_c = 0
for i in range(2, len(S)-1):
    if S[i] == "C":
        count_c += 1
if count_c == 1:
    count += 1
    
count_upper = 0
for i in range(len(S)):
    if S[i].isupper() == True:
        count_upper += 1
if count_upper == 2:
    count += 1
    
if count == 3:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
def is_upper_case(s):
  return not (ord('a') <= ord(s) <= ord('z'))

S = input()

if S[0] != 'A':
  print("WA")
  exit()

if S[2:-1].count('C') != 1:
  print("WA")
  exit()

upper_num = list(map(is_upper_case, S)).count(True)

if upper_num != 2: # expected only 'A', 'C'
  print("WA")
  exit()

print("AC")

Submission status: Accepted

Solution code:
def isNotLower(s):
  return not (ord('a') <= ord(s) <= ord('z'))

S = input()

if S[0] != 'A':
  print("WA")
  exit()

if S[2:-1].count('C') != 1:
  print("WA")
  exit()

upper_num = 0
for s in S:
  if isNotLower(s):
    upper_num += 1

if upper_num != 2: # expected only 'A', 'C'
  print("WA")
  exit()

print("AC")

Submission status: Accepted

Solution code:
def isNotLower(s):
  return not (ord('a') <= ord(s) <= ord('z'))

S = input()

if S[0] != 'A':
  print("WA")
  exit()

if S[2:-1].count('C') != 1:
  print("WA")
  exit()

upper_limit = 2 # only 'A', 'C'
for s in S:
  if isNotLower(s):
    upper_limit -= 1

  if upper_limit < 0:
    print("WA")
    exit()

print("AC")

Submission status: Accepted

Solution code:
s=input()

a=s[2:-1]
b=s.replace("A","").replace("C","")
ans=False
if s[0] == 'A':
    if a.count('C') == 1:
        if b.islower():
            ans=True

if ans:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
t = s[2] + s[-1]
if s[0] == "A" and str(s[1]+s[-1]).islower()==True and s[2:len(s)-1].count("C")==1:
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
s  = input()

t  = s[2:-1]
count  = 0
k = 0
for i in range(len(t)):
  if t[i] == "C":
    count += 1
    k = i
s = list(s)
s.pop(k+2)
if s[0] == "A":
  s.pop(0)
  if str(s).islower() and count == 1:
    print("AC")
    exit()
    
print("WA")

Submission status: Accepted

Solution code:
s = input()

flg = True
if s[0] != 'A':
    flg = False
elif 'C' not in s[2:-1]:
    flg = False
elif s[2:-1].count('C') > 1:
    flg = False
elif not  s[1:].replace('C','').islower():
    flg = False
else:
    pass

print('AC' if flg else 'WA')

Submission status: Accepted

Solution code:
s = list(input())
count = 0
flag = 1
if s[0] == "A":
    s[0] = s[0].lower()
else:
    flag = 0
for i in range(2, len(s)-1):
    if s[i] == "C":
        s[i] = s[i].lower()
        count += 1
ss = "".join(s)
if not(ss.islower()) or count != 1:
    flag = 0
if flag == 1: print("AC")
else: print("WA")

Submission status: Accepted

Solution code:
s = list(input())
count = 0
flag = 1
if s[0] == "A":
    s[0] = s[0].lower()
    for i in range(len(s)):
        if (i >= 2 and i <= len(s)-2) and s[i] == "C":
            s[i] = s[i].lower()
            count += 1
    for i in s:
        if str(i).isupper():
            flag = 0
            break
    if count != 1:
        flag = 0
else:
    flag = 0
if flag == 1: print("AC")
else: print("WA")

Submission status: Accepted

Solution code:
s=input()
print("AC" if s[0]=="A" and "C" in s[2:-1] and s[1:].replace("C","",1).islower() else "WA")

Submission status: Accepted

Solution code:
s = input()

if s[0] == "A" and s[1].islower():
    if s[2:].count("C") == 1:
        idx = s.index("C")
        if s[1:idx].islower() and s[idx + 1 :].islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
#2019/10/22

#s = open(0).read()
s = input()
#print(s)
print("AC" if "C" in s[2:-1] and "A" in s[0] and s[1:].replace("C","",1).islower() else "WA")

Submission status: Accepted

Solution code:
#2019/10/22

#s = open(0).read()
s = input()
#print(s)
print("AC" if "C" in s[2:-1] and "A" in s and s[1:].replace("C","",1).islower() else "WA")

Submission status: Accepted

Solution code:
s = input()
if s[0] == 'A' and 'C' in s[2:-1] and s.count('C') == 1:
    s = s[1:].replace('C','')
    if s == s.lower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
S=input()
abc=[chr(i) for i in range(97,97+26)]
f=True

if S[0]=='A':
    S=S[1:]
else:
    f=False

if 'C' in S[1:-1]:
    S=S.replace('C','',1)
else:
    f=False

for c in S:
    if c not in abc:
        f=False
        break

print('AC' if f else 'WA')

Submission status: Accepted

Solution code:
S=input()
flag=1

if S[0]!='A':
    flag=0

if S[2:-1].count('C')!=1:
    flag=0

S=S.replace('A','a')
S=S.replace('C','c')

if S!=S.lower():
    flag=0

print('WAAC'[flag::2])

Submission status: Accepted

Solution code:
S = list(input())
ans = True
if S[0] != "A":
    ans = False
if sum(S[i] == "C" for i in range(2, len(S)-1)) != 1:
    ans = False
if sum(s.lower() != s for s in S) != 2:
    ans = False
print("AC" if ans else "WA")

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = list(readline().rstrip().decode('utf-8'))

bl = S[0] == 'A'
bl &= ('C' in S[2:-1])

if bl:
    S.remove('A'); S.remove('C')

bl &= all('a'<=x<='z' for x in S)

answer = 'AC' if bl else 'WA'
print(answer)

Submission status: Accepted

Solution code:
#104b
S = str(input())

#Sが次の条件すべてを満たすか判定してください。
#・Sの先頭の文字は大文字の A である。
#・Sの先頭から 3 文字目と末尾から 2 文字目の間（両端含む）に大文字の C がちょうど 1個含まれる。
#・以上の A, C を除く Sのすべての文字は小文字である。

#Sが問題文中の条件すべてを満たすなら AC、そうでなければ WA と出力せよ。

#0A1t2C3o4d5e6r7

C_check = 0

if S[0]=="A":
    for i in range(1,len(S)):
        if S[i].isupper() == True:
            if i>=2 and i<=len(S)-2 and C_check==0 and S[i]=="C":
                C_check=1
            else:
                print("WA")
                break
    else:
        if C_check == 1:
            print("AC")
        else:
            print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()

if s[0] != "A":
    print("WA")
    quit()

if s[2:-1].count("C") != 1:
    print("WA")
    quit()

if s[0:2].count("C") != 0 and s[-2:].count("C") != 0:
    print("WA")
    quit()

for _s in s:
    if _s == "A" or _s == "C":
        continue

    if not _s.islower():
        print("WA")
        quit()

print("AC")

Submission status: Accepted

Solution code:
S = list(input())

ac = False
if S[0] == "A":
    if S[2:len(S)-1].count("C") == 1:
        ac = True

upper = False
count = 0
for i in S:
    if i.isupper():
        count += 1

if count == 2:
    upper = True

if ac and upper:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()

ans_1 = 1 if S[0] == "A" else 0

count_c = 0
c_i = 0
for i in range(2, len(S)-1):
    if S[i] == "C":
        count_c += 1
        c_i = i


ans_2 = 1 if count_c == 1 else 0

check_str = S[1:c_i] + S[c_i+1:]
#print(check_str)
ans_3 = 1 if check_str.islower() == 1 else 0

#print(ans_1)
#print(ans_2)
#print(ans_3)
print( "AC" if ans_1 and ans_2 and ans_3 else "WA")

Submission status: Accepted

Solution code:
s = input()
Ccnt = 0
cnt = 0
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
b = s[2:-1]
for i in range(len(b)):
    if b[i] == 'C':
        Ccnt += 1
for i in range(len(s)):
    if s[i] in a:
        cnt += 1
if s[0] == 'A' and Ccnt == 1 and cnt == 2:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()

if S[0] == "A" and S[2:-1].count("C") == 1:
    ans = "AC"
    for s in S:
        if s not in "AC" and s.isupper():
            ans = "WA"
            break
else:
    ans = "WA"

print(ans)

Submission status: Accepted

Solution code:
S = input()

ret = 'WA'

if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        n = S.find('C')
        S = list(S)
        S[n] = 'c'
        S = "".join(S)
        komoji = S[1:]
        s = S[1:].lower()

        if komoji == s:
            ret = 'AC'

print(ret)

Submission status: Accepted

Solution code:
s = list(input())

if s[0] != "A":
    print("WA")
    exit()

if s[2:-1].count("C") != 1:
    print("WA")
    exit()

s.remove("A")
s.remove("C")
s_in = "".join(s)

if not s_in.islower():
    print("WA")
    exit()

print("AC")

Submission status: Accepted

Solution code:
# ord("A") → 65
# ord("C") → 67
# ord("Z") → 90
# ord("a") → 97

S=list(input())
S_int=list(map(lambda x:ord(x),S))

flg=False

if S[0]=="A":
    if S[2:-1].count("C")==1:
        remove_omoji=[x for x in S_int if x>96]
        if len(S_int)-2==len(remove_omoji): flg=True

print("AC" if flg else "WA")

Submission status: Accepted

Solution code:
s = input()

if s[0] == 'A' and 'C' in s[2:-1] and s.count('C') == 1:
    s = s[1:].replace('C', '')
    if s == s.lower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
s=list(input())
c=0
if s[0]=="A" and "C" in s[2:-1]:
    s.remove("A")
    s.remove("C")
    for i in s:
        if i in "abcdefghijklmnopqrstuvwxyz":c+=1
        else:print("WA");break
    if c==len(s):print("AC")
    else:("WA")
else:print("WA")

Submission status: Accepted

Solution code:
s = input()

if s[0] == 'A' and 'C' in s[2:-1] and s.count('C') == 1:
    s = s[1:].replace('C', '')
    if s == s.lower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = list(input())

A = []
for i in S:
    if i != 'A' and i != 'C':
        A.append(i)
A=''.join(A)

B= list(S[2:-1])
#print(B)

if S[0] == 'A':
    if B.count('C') == 1:
        if A.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()

ac = True

if S[0] != "A":
    ac = False

cnt = 0
for s in S[2:-1]:
    if s == "C":
        cnt += 1
if cnt != 1:
    ac = False

for s in S[1:]:
    if s != "C" and s.isupper():
        ac = False

if ac:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
print("AC" if s[0]=="A" and "C" in s[2:-1] and s[1:].replace("C","",1).islower() else "WA")

Submission status: Accepted

Solution code:
S=list(input())

if S[0]!='A':
    print('WA')
    exit()

if S[2:len(S)-1].count('C')!=1:
    print('WA')
    exit()

S.remove('C')
S.remove('A')

for i in S:
    if i not in 'abcdefghizklmnopqrstuvwxyz':
        print('WA')
        exit()


print('AC')

Submission status: Accepted

Solution code:
def solve(s):
    if(s[0] == "A"):
        v = s[1:]
        i = v.find("C")
        if(i >= 1 and i < len(v)-1):
            k = v[:i] + v[i+1:]
            if(k.islower()):
                return "AC"
    return "WA"
 
s = input()
print(solve(s))

Submission status: Accepted

Solution code:
S=input()
r='AC'
if S[0]!='A':
    r='WA'
count=0
for s in S:
    if str(s).isupper():
        count+=1
if count!=2:
    r='WA'
if 'C' not in S[2:-1]:
    r='WA'
print(r)

Submission status: Accepted

Solution code:
import re
S = input()

if S[0] == "A":
    if S[2:-1].count("C") == 1:
        if len(re.findall("[A-Z]", S)) == 2:
            print("AC")
            exit()
            
print("WA")

Submission status: Accepted

Solution code:
S = input()

ans = True

tmp_S1 = ""
tmp_S2 = ""
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C":
        continue
    tmp_S1 += S[i]
    tmp_S2 += S[i]

if tmp_S1.lower() != tmp_S2:
    ans = False

if S[0] != "A":
    ans = False

cnt = 0
for i in range(2, len(S)-1):
    if S[i] == "C":
        cnt += 1
if cnt != 1:
    ans = False

if ans is True:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s=list(input())
count=0
if s[0]!='A':
    count+=2
for i in range(2,len(s)-1):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') #str.islower():全部小文字ならTrue

else:
    print('WA')

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    s = str(input().rstrip('\n'))
    cnt = 0
    for i in range(len(s)):
        if i == 0:
            if s[i] != "A":
                print("WA")
                exit()
        elif 2 <= i <= len(s) - 2:
            if s[i] == "C":
                cnt += 1
            else:
                if s[i] != s[i].lower():
                    print("WA")
                    exit()
        else:
            if s[i] != s[i].lower():
                print("WA")
                exit()
    if cnt == 1:
        print("AC")
    else:
        print("WA")


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
s = input()
if "C" in s[2:-1] and "A" in s and s[1:].replace("C","",1).islower():
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
import re
s = input()
c = r'A[a-z]+C[a-z]+$'
print('AC' if re.match(c,s) else 'WA')

Submission status: Accepted

Solution code:
s = input()
if s[0] =='A':
  if s[2:-1].count('C') ==1:
    if len([i for i in s if i.islower()]) == (len(s)-2):
      print('AC')
      exit()
print('WA')

Submission status: Accepted

Solution code:
def main():
    S = input()

    rule1 = S[0] == 'A'
    rule2 = S[2:len(S)-1].count('C') == 1
    rule3 = S[1:].replace('C','').islower()

    if(rule1 and rule2 and rule3):
        print('AC')
    else:
        print('WA')

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
print("AC" if s[0]=="A" and s[2:-1].count("C")==1 and s[1:].replace("C","").islower() else "WA")

Submission status: Accepted

Solution code:
s = input()

if s[0] != 'A':
    print('WA')
    exit()

cntC = 0
for i in range(2,len(s)-1):
    if s[i] == 'C':
        cntC += 1

if cntC != 1:
    print('WA')
    exit()

cntL = 0
for i in range(len(s)):
    if s[i].islower():
        cntL+=1

if cntL != len(s)-2:
    print('WA')
    exit()

print('AC')

Submission status: Accepted

Solution code:
import sys
S = input()
if S[0] != 'A' or S[2:-1].count('C') != 1:
    print('WA')
    sys.exit(0)

cnt = 0
for c in S:
    if('a' <= c <= 'z'):
        cnt+=1

if(cnt == len(S)-2):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
import sys
S = input()

if S[0] != 'A':
    print('WA')
    sys.exit()

ccnt = 0
for i in range(2,len(S)-1):
    if S[i] == 'C':
        ccnt += 1
if ccnt != 1:
    print('WA')
    sys.exit()

csml = 0
for i in range(len(S)):
    if S[i].isalpha() and S[i].islower():
        csml += 1
if csml == len(S)-2:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = list(input())
f1 = f2 = f3 = False
if S[0] == 'A':
    f1 = True
    del S[0]
if S[1:-1].count('C') == 1:
    f2 = True
    del S[S[1:-1].index('C')+1]
if ''.join(S).islower():
    f3 = True

if f1 and f2 and f3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = list(input())
#print(s)
if s[0]!='A':
    print('WA')
    exit()
else:
    del s[0]
    for i in range(len(s)-1):
        if s[i] =='C' and 0<i:
            del s[i]
            if not str.islower(str(s)):
                print('WA')
                exit()
            else:
                print('AC')
                exit()
        else:
            continue
    print('WA')
    exit()

Submission status: Accepted

Solution code:
S = input()

bool_list = []
if S[0] == 'A':
    bool_list.append(True)
    if S[2: -1].count('C') == 1:
        bool_list.append(True)
        C_index = S.index('C')
        if 'a' + S[1:C_index] + 'c' + S[C_index + 1:] == S.lower():
            bool_list.append(True)
        else:
            bool_list.append(False)
    else:
        bool_list.append(False)
else:
    bool_list.append(False)

if all(bool_list) is True:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()

def check() :
    if S[0] != 'A' or S[2:-1].count('C') != 1 :
        return 'WA'
    
    ret = 0
    for s in S :
        if ord(s) < 97 or 122 < ord(s) :
            ret += 1
            
    if ret != 2 :
        return 'WA'
        
    return 'AC'
    
print(check())

Submission status: Accepted

Solution code:
s = input()
ans = 'AC'

if s[0] != 'A':
  ans = 'WA'

if 'C' not in s[2:-1]:
  ans = 'WA'
  
if s[2:-1].count('C') != 1:
  ans = 'WA'
  
if not s.replace('A', '').replace('C', '').islower():
  ans = 'WA'
  
print(ans)

Submission status: Accepted

Solution code:
s=input()
if s[0] == 'A':
  if s[2:-1].count('C') == 1:
    if len([i for i in s if i.islower()]) == (len(s)-2):
      print('AC')
      exit()
print('WA')

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def judg(s):
    if s[0] != "A":
        return False
    if "C" not in s[2:-1] and s[2:-1].count("C") != 1:
        return False
    del s[s.index("C")]
    s = "".join(s[1:])
    if s.lower() != s:
        return False
    return True


def main():
    s = list(input().strip())

    if judg(s):
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
if not s[0] == "A":
  print("WA")
  exit()
elif not "C" in s[2:-1]:
  print("WA")
  exit()
ig = 2+s[2:-1].index("C")
for i in range(1,len(s)):
  if i == ig:
    continue
  if s[i].isupper():
    print("WA")
    exit()
print("AC")

Submission status: Accepted

Solution code:
S=input()

# 条件1：S の先頭の文字は大文字の A
if S[0]=='A':
    
    # 条件2：S の3文字目〜最後から2番目の文字の間に C が1つ含まれる
    if len([s for s in S[2:len(S)-1] if s=='C'])==1:

        # 条件3：以上の A, C を除く全ては小文字
        s=S[1:S.index('C')]+S[S.index('C')+1:]
        if s==s.lower():
            print("AC")
        
        else:
            print("WA")

    else:
        print("WA")

else:
    print("WA")

Submission status: Accepted

Solution code:
n=input()
wa=0
#print(n[2:len(n)-1])
#print(n[len(n)])
if n[0]=="A" and n[2:len(n)-1].count("C")==1 and n[1]!="C" and n[len(n)-1]!="C":
    wa+=0
    import re
    a=re.sub('[AC ]', '',n)
else:
    wa+=1
    a=n
for i in range(len(a)):
    if 0<= ord(a[i]) - ord('a') <= 26:
        wa+=0
    else:
        wa+=1
if wa==0:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
count = 0

if s[0] != "A" or s[1].isupper() or s[-1].isupper():
    print("WA")
    exit()

for i in range(2, len(s) - 1):
    if s[i] == "C":
        count += 1

    elif s[i].isupper():
        print("WA")
        exit()

if count != 1:
    print("WA")

elif count == 1:
    print("AC")

Submission status: Accepted

Solution code:
import sys
S = list(input())
N = len(S)
if S[0] == "A":
    s = 0
    for i in S[2:len(S)-1]:
        if i == "C":
            s += 1
    if s == 1:
        c = 0
        for i in S:
            if i.islower():
                 c += 1
        if c == N-2:
            print("AC")
            sys.exit()
print("WA")

Submission status: Accepted

Solution code:
S = input()

cnt = 0
if S[0] != 'A' or S[-1] == 'C' or S[1] == 'C':
    cnt += 1

A = S.replace('A', '')
A = A.replace('C', '')
if len(S) -2 != len(A) or A.islower() == False:
    cnt += 1
if cnt > 0:
    print('WA')
else:
    print('AC')

Submission status: Accepted

Solution code:
s = input()

a = s[0] == "A" and ("C" in s[2:-1]) and s[2:-1].count("C") == 1

s = list(s)
if "A" in s:
    s.remove("A")
else:
    print("WA")
    exit()
if "C" in s:
    s.remove("C")
else:
    print("WA")
    exit()

b = all(i.islower() for i in s)

if a and b:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
def is_target_string(S):
    if S[0] != 'A':
        return False
    C_cnt = 0
    C_index = -1
    for i in range(2, len(S)-1):
        if S[i] == 'C':
            C_cnt += 1
            C_index = i
    if C_cnt != 1:
        return False

    for i in range(len(S)):
        if i != 0 and i != C_index:
            if S[i].isupper():
                return False

    return True

S = input()

print('AC' if is_target_string(S) else 'WA')

Submission status: Accepted

Solution code:
s=input()
if s[0]=='A' and s[2:-1].count('C')==1:
    for i in range(len(s[2:-1])):
        if s[2:-1][i]=='C':
            ind=i+2
    ss=s[1:ind]+s[ind+1:]
    if ss==ss.lower():
        print('AC')
        exit()
print('WA')

Submission status: Accepted

Solution code:
s = input()
if s[0] == 'A':
    if s.count('C') == 1 and 2 <= s.find('C') <= len(s)-2:
        s_tmp = s[1:s.find('C')]+s[s.find('C')+1:]
        if s_tmp.islower() == True:
            print("AC")
            exit()

print("WA")

Submission status: Accepted

Solution code:
S = input()
cnt = 0
for i in range(len(S)):
  if i==0 and S[i]!="A":
    print("WA")
    exit()
  if 2<=i<=len(S)-2 and S[i]=="C":
    cnt+=1
    if cnt>1:
      print("WA")
      exit()
  if 1<=i<=len(S)-1:
    if S[i]!="C" and S[i].isupper():
      print("WA")
      exit()
if cnt<1:
  print("WA")
  exit()
print("AC")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    import re
    pattern="^A[a-z]+C[a-z]+$"
    print("AC" if re.match(pattern,input()) else "WA")
resolve()

Submission status: Accepted

Solution code:
S = input().strip()
if S[0]=="A" and S[2:-1].count("C")==1:
    for i in range(2,len(S)-1):
        if S[i]=="C":
            ind = i
            break
    res = 0
    for i in range(1,len(S)):
        if i!=ind and not(97<=ord(S[i])<=122):
            res = 1
            break
    if res==0:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()

if S[0] == 'A' and S[2:-1].count('C') == 1:  
    S1 = S.replace('A','a').replace('C','c')
    S2 = S.lower()
    if S1 == S2:
        print('AC') 
        exit()

print('WA')

Submission status: Accepted

Solution code:
S = input()
if S[0] == "A":
    flag = False
    for i, x in enumerate(S[2:-1]):
        if x == "C":
            if flag:
                flag = False
                break
            else:
                flag = True
                index = i+2
    if flag:

        if (len(S[1:index]) == 0 or S[1:index].islower()) and (len(S[index+1:]) == 0 or S[index+1:].islower()):
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()

if s[0] != "A":
    print("WA")
    exit()

if s[2:-1].count("C") != 1:
    print("WA")
    exit()

if s[1:].replace("C", "").lower() == s[1:].replace("C", ""):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()

if s[0] != "A":
    print("WA")
    exit()

if len(s[2:-1]) - len(s[2:-1].replace("C", "")) != 1:
    print("WA")
    exit()

if s[1:].replace("C", "").lower() == s[1:].replace("C", ""):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s=input()
ans=[]
if s[0]=='A' and s[2:len(s)-1].count('C')==1:
    ans.append('a')
    ans.append(s[1])
    ans.append(s[2:len(s)-1].replace('C','c'))
    ans.append(s[-1])
    if ''.join(ans).islower(): print('AC')
    else:
        print('WA')
else: print('WA')

Submission status: Accepted

Solution code:
S = input()
if S.startswith('A') and S[2:-1].find('C') == S[2:-1].rfind('C') != -1 and S[1:].replace('C','') == S[1:].replace('C','').lower(): print('AC')
else: print('WA')

Submission status: Accepted

Solution code:
s=input()
c=0
l=['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']
if s[0]=='A':c+=1
if s[2:-1].count('C')==1:c+=1
x=0
for i in range(len(s)):
    x+=l.count(s[i])
if x==len(s)-2:c+=1
if c==3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
import string

s = input()

if s[0] != "A":
    print("WA")
    exit()

l_case = string.ascii_lowercase
if s[2:-1].count('C') == 1:
    c_index = s[2:].index('C') + 2
    if all(map(lambda x: x in l_case, s[1:c_index] + s[c_index + 1:])):
        print("AC")
    else:
        print("WA")
else:
    print("WA")