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: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import logging
import time


class Solver:
    def __init__(self):
        self.s = ''

    def input_value(self):
        # self.n = int(input())
        # self.A, self.B = map(int, input().split())
        # self.A = list(map(int, input().split()))
        # self.a, self.b, self.c = map(int, [input() for i in range(4)])
        # self.t = [None] * self.n
        self.s = input()

    @staticmethod
    def run(s):
        if s[0] == 'A':
            s_a = s[1]
            s_b = s[2:-1]
            s_c = s[-1]
            if s_b.count('C') == 1:
                s_b = s_b.strip('C')
            else:
                return 'WA'
            # logging.debug(s_a + s_b + s_c)
            if (s_a + s_b + s_c).islower():
                return 'AC'
        return 'WA'

    @staticmethod
    def test():
        start_time = time.time()

        assert Solver.run('AtCoder') == 'AC', 'Error.'
        assert Solver.run('ACoder') == 'WA', 'Error.'
        assert Solver.run('AcycliC') == 'WA', 'Error.'
        assert Solver.run('AtCoCo') == 'WA', 'Error.'
        assert Solver.run('Atcoder') == 'WA', 'Error.'
        assert Solver.run('AbCbbbbbDd') == 'WA', 'Error.'
        assert Solver.run('atcoderrCr') == 'AC', 'Error.'

        elapsed_time = time.time() - start_time
        logging.debug('elapsed_time: {0}'.format(elapsed_time) + '[sec]')


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)

    solver = Solver()

    # Solver.test()

    solver.input_value()
    ans = solver.run(solver.s)
    # print(str(ans))
    print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import logging
import time


class Solver:
    def __init__(self):
        self.s = ''

    # 入力
    def input_value(self):
        # self.n = int(input())
        # self.A, self.B = map(int, input().split())
        # self.A = list(map(int, input().split()))
        # self.a, self.b, self.c = map(int, [input() for i in range(4)])
        # self.t = [None] * self.n
        self.s = input()

    @staticmethod
    def run(s):
        if s[0] == 'A':
            s_a = s[1]
            s_b = s[2:-1]
            s_c = s[-1:]
            if s_b.count('C') == 1:
                s_b = s_b.strip('C')
            else:
                return 'WA'
            if (s_a + s_b + s_c).islower():
                return 'AC'
        return 'WA'

    @staticmethod
    def test():
        start_time = time.time()

        assert Solver.run('AtCoder') == 'AC', 'Error.'
        assert Solver.run('ACoder') == 'WA', 'Error.'
        assert Solver.run('AcycliC') == 'WA', 'Error.'
        assert Solver.run('AtCoCo') == 'WA', 'Error.'
        assert Solver.run('Atcoder') == 'WA', 'Error.'
        assert Solver.run('AtCo') == 'AC', 'Error.'

        elapsed_time = time.time() - start_time
        logging.debug('elapsed_time: {0}'.format(elapsed_time) + '[sec]')


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)

    solver = Solver()

    # Solver.test()

    solver.input_value()
    ans = solver.run(solver.s)
    # print(str(ans))
    print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import logging
import time


class Solver:
    def __init__(self):
        self.s = ''

    # 入力
    def input_value(self):
        # self.n = int(input())
        # self.A, self.B = map(int, input().split())
        # self.A = list(map(int, input().split()))
        # self.a, self.b, self.c = map(int, [input() for i in range(4)])
        # self.t = [None] * self.n
        self.s = input()

    @staticmethod
    def run(s):
        if s[0] == 'A':
            s_b = s[2:-1]
            s_c = s[-1:]
            if s_b.count('C') == 1:
                s_b = s_b.strip('C')
            else:
                return 'WA'
            if (s_b + s_c).islower():
                return 'AC'
        return 'WA'

    @staticmethod
    def test():
        start_time = time.time()

        assert Solver.run('AtCoder') == 'AC', 'Error.'
        assert Solver.run('ACoder') == 'WA', 'Error.'
        assert Solver.run('AcycliC') == 'WA', 'Error.'
        assert Solver.run('AtCoCo') == 'WA', 'Error.'
        assert Solver.run('Atcoder') == 'WA', 'Error.'

        elapsed_time = time.time() - start_time
        logging.debug('elapsed_time: {0}'.format(elapsed_time) + '[sec]')


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)

    solver = Solver()

    # Solver.test()

    solver.input_value()
    ans = solver.run(solver.s)
    # print(str(ans))
    print(ans)

Submission status: Wrong Answer

Solution code:
def checker():
    s = input()
    if s[0] != "A":
        return 0
    if s[2:-1].count("C") != 1:
        return 0
    return 1

l = ["WA", "AC"]

print(l[checker()])

Submission status: Wrong Answer

Solution code:
def checker():
    s = input()
    if s[0] != "A":
        return 0
    if "C" not in s[2:-1]:
        return 0
    return 1

l = ["WA", "AC"]

print(l[checker()])

Submission status: Wrong Answer

Solution code:
def checker():
    s = input()
    if s[0] != "A":
        return 0
    if "C" not in s[2:-1]:
        return 0
    return 1

l = ["AC", "WA"]

print(l[checker()])

Submission status: Wrong Answer

Solution code:
# encoding: utf-8
S = input()

state = ""

for i, char in enumerate(S):
    print(char,state)
    # error path
    if state == "":
        if char == "A": state = "A"
        else: state = "WA"
    elif state == "A":
        if char == "C" and i < 2: state = "WA"
        elif char == "C": state = "C"
        elif char.isupper(): state = "WA"
        else: continue
    elif state == "C":
        if char == "C": state = "WA"
        elif char.isupper(): state = "WA"
        else: state = "AC"
    else: # AC
        if char.isupper(): state = "WA"
    
else:
    if state == "AC": print("AC")
    else: print("WA")

Submission status: Wrong Answer

Solution code:
# encoding: utf-8
S = input()
abc = "abcdefghijklmnopqrstuvwxyz"

state = ""

for i, char in enumerate(S):
    # error path
    if state == "" and char != "A": state = "WA"
    elif state == "A" and char == "C" and i < 2: state = "WA"
    elif state == "C" and char == "C": state = "WA"
    # main path
    elif state == "" and char == "A": state = "A"
    elif state == "A" and char == "C" and i > 1: state = "C"
    elif state == "C" and char in abc: state = "AC"
    # escape
    if state in ("WA",):
        print(state)
        break
    else: continue
    
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
# encoding: utf-8
S = input()
abc = "abcdefghijklmnopqrstuvwxyz"

state = ""

for i, char in enumerate(S):
    # error path
    if state == "" and char != "A": state = "WA"
    elif state == "A" and char == "C" and i < 2: state = "WA"
    elif state == "C" and char == "C": state = "WA"
    # main path
    elif state == "" and char == "A": state = "A"
    elif state == "A" and char == "C" and i > 1: state = "C"
    elif state == "C" and char in abc: state = "AC"
    # escape
    if state in ("AC", "WA"):
        print(state)
        break
    else: continue
    
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
import re

S = input()

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

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

if re.match(r'A[a-z]+C[a-z]+', S) == None:
  print('WA')
  exit()

Submission status: Wrong Answer

Solution code:
import re

S = input()

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

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

if re.match('A[a-z]+C[a-z]?', S) == None:
  print('WA')
  exit()

print('AC')

Submission status: Wrong Answer

Solution code:
def check(s):
    if s[0] != 'A':
        return False

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

    if count != 1:
        return False

    for i in range(1, len(s)-1):
        if i == C_index:
            continue

        if not ('a' <= s[i] and s[i] <= 'z'):
            return False

    return True

if __name__ == '__main__':
    s = input()
    is_ac = check(s)

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

Submission status: Wrong Answer

Solution code:
def check(s):
    if s[0] != 'A':
        return False

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

    if(count == 0 or count > 1):
        return False

    for i in range(1, len(s)-1):
        if i == C_index:
            continue

        if not ('a' <= s[i] and s[i] <= 'z'):
            return False

    return True

if __name__ == '__main__':
    s = input()
    is_ac = check(s)

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

Submission status: Wrong Answer

Solution code:
S = input()
Ccount = 0
j = 0
hantei = False

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

if S[0] == "A":
    char_S = list(S)
    del char_S[j]
    del char_S[0]
    S = "".join(char_S)
    hantei = True

if (Ccount == 1) and (S.islower()) and hantei:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
Ccount = 0
j = 0
hantei = False

for i in range(2, len(S)-3):
    if S[i] == "C":
        j = i
        Ccount += 1

if S[0] == "A":
    char_S = list(S)
    del char_S[j]
    del char_S[0]
    S = "".join(char_S)
    hantei = True

if (Ccount == 1) and (S.islower()) and hantei:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
import re
print("AC"if re.match("/^A[a-z]+C[a-z]+$/",input())else"WA")

Submission status: Wrong Answer

Solution code:
# encoding: utf-8
S = input()
abc = "abcdefghijklmnopqrstuvwxyz"

state = ""

for i, char in enumerate(S):
    # error path
    if state == "" and char != "A": state = "WA"
    elif state == "A" and char == "C" and i < 2: state = "WA"
    # main path
    elif state == "" and char == "A": state = "A"
    elif state == "A" and char == "C" and i > 1: state = "C"
    elif state == "C" and char in abc: state = "AC"
    # escape
    if state in ("AC", "WA"):
        print(state)
        break
    else: continue
    
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
l=str(input())
len_l=len(l)
if l[0:1] !="A":
    print("No")
elif l.count("C")==1 and l[2:len_l-2].count("C")==1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin

S = stdin.readline().rstrip()

cond1 = S[0] == 'A'
cond2 = S.count('C', 2, -2) == 1
cond3 = S.replace('A', '').replace('C', '').islower()

if cond1 and cond2 and cond3:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
l = len(S)
cnt = 0
cnt2 = 0
for i in range(l):
	if (S[i] != 'A' and i == 0):
		print("WA")
		exit(0)

	if (2 <= i and i < l and S[i] == 'C'):
		cnt += 1

	if S[i].isupper():
		cnt2 += 1


if (cnt != 1 or cnt2 != 2):
	print("WA")
	exit(0)

print("AC")

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] != 'A':
    print('WA')
elif S.count('C') != 1:
    print('WA')
elif S[2] != 'C':
    print('WA')
else:
    upper = 0
    for c in S:
        if c.isupper():
            upper += 1
    print('AC' if upper == 2 else 'WA')

Submission status: Wrong Answer

Solution code:
x = list(input())
#print(len(x))

if x[0]=="A" :
	for i in range(2,len(x)-1):
		if x[i]=="C" :
#			print(x)
			del	x[i]
			del x[0]
			y="".join(x)
			#print(y)
			if y.islower():
				print("AC")
				break
			else:
				print("WA")
				break
		else:
			print("WA")
			break
else:
	print("WA")

#print(x)

Submission status: Wrong Answer

Solution code:
x = list(input())
#print(len(x))

if x[0]=="A" :
	for i in range(2,len(x)-1):
		if x[i]=="C" :
#			print(x)
			del	x[i]
			del x[0]
			break
else:
	print("WA")

#print(x)
y="".join(x)
#print(y)
if y.islower():
	print("AC")
else:
	print("WA")

Submission status: Wrong Answer

Solution code:
#B
S=input()
ok=0
ALF='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
if S[0]=='A':
    C=(S[2:-1]).find('C')+2
    if C>1:
        S=S[2:C]+S[C+1:]
        for i in ALF:
            if i in S:
                break
            elif i=='Z':
                ok=1
                print('AC')
if ok==0:
    print('WA')

Submission status: Wrong Answer

Solution code:
# coding: utf-8

def pHead(S):
    if S[0] != "A": return False
    return True

def getMid(S):
    return S[2:-1]

def pMid(S):
    mid = getMid(S)
    if "C" not in mid: return False
    if mid.count("C") > 1: return False
    return True

def getRest(S):
    mid = getMid(S)
    tmp = S[1] + mid.replace("C", "") + S[-1]
    return tmp

def solve(S):
    if not pHead(S):
        return "WA"
    if not pMid(S):
        return "WA"
    if not getRest(S).islower():
        return "Wa"
    return "AC"

if __name__ == "__main__":
    S = input()
    print(solve(S))

Submission status: Wrong Answer

Solution code:
def solved(s):
    for i in range(len(s)):
        if i == 0:
            if s[i] != 'A':
                return False
        elif i == 2:
            if s[i] != 'C':
                return False
        elif s[i].isupper():
            return False
    return True

if __name__ == '__main__':
    s = input()
    if solved(s) is True:
        print('AC')
    else:
        print('WA')

Submission status: Wrong Answer

Solution code:
def solved(s):
    if s[0] != 'A' or s[2] != 'C' or s[1].isupper():
        return False
    else:
        for i in s[3:]:
            if i.isupper():
                return False
    return True

if __name__ == '__main__':
    s = input()
    if solved(s) is True:
        print('AC')
    else:
        print('WA')

Submission status: Wrong Answer

Solution code:
def solved(s):
    if s[0] != 'A' or s[2] != 'C' or s[1].isupper():
        return False
    else:
        for i in s[3:]:
            if i.isupper():
                return False
    return True

if __name__ == '__main__':
    s = input()
    if solved(s) is True:
        print('AC')
    else:
        print('WQ')

Submission status: Wrong Answer

Solution code:
s = input()

if s[0] is not 'A':
    print("WA")

if s[2:-2].count('C') is not 1:
    print("WA")

if s[2:-2].replace('C', '').islower() is False:
     print("WA")

if s[1].islower() is False:
    print("WA")

if s[-1].islower() is False:
    print("WA")

print("AC")

Submission status: Wrong Answer

Solution code:
s = input()

if s[0] is not 'A':
    print("WA")

if s[2:-2].count('C') is not 1:
    print("WA")

if s[2:-2].replace('C', '').islower() is False:
     print("WA")

print("AC")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-                                                                                                                                                                  
s = str(input())
j1 = (s[0]=='A')
j2 = ('c' in s[2:len(s)-1])
j3 = (s[1:].islower())

if j1 is j2 is j3 is True:
    print ('AC')
else:
    print ('WA')

Submission status: Wrong Answer

Solution code:
str = input()
ans = 'WA'
if str[0] == 'A':
    cPlc = str.find('C')
    if cPlc >= 2 and cPlc <= len(str) - 2 and str.find('C',cPlc + 1) == -1:
        AllLower = True
        for i in range(1, len(str)):
            if str[i].isupper() and i != cPlc: AllLower = False
            if AllLower: ans = 'AC'
print(ans)

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    s = S()
    if s[0] != 'A':
        return 'WA'
    c = collections.Counter(s)
    if c['A'] != 1 or c['C'] != 1:
        return 'WA'
    if c['B'] > 0:
        return 'WA'
    for t in string.ascii_uppercase[3:]:
        if c[t] > 0:
            return 'WA'
    if 'C' not in s[2:-2]:
        return 'WA'
    return 'AC'


print(main())

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    s = S()
    if s[0] != 'A':
        return 'WA'
    c = collections.Counter(s)
    if c['A'] != 1 or c['C'] != 1:
        return 'WA'
    if c['B'] > 0:
        return 'WA'
    for t in string.ascii_uppercase[3:]:
        if c[t] > 0:
            return 'WA'
    if 'C' not in s[2:-3]:
        return 'WA'
    return 'AC'


print(main())

Submission status: Wrong Answer

Solution code:
def check(n):
    q1 = True if n[0] == 'A' else False
    q2 = True if 'C' in n[2:-1] and n[2:-1].count('C') == 1 else False
    global q3

    if q1 and q2:
        l = list(n)
        w = len(l)
        for x in range(w):
            if l[x] == 'C' and 3 > x > w - 1:
                q3 = False
            elif l[x] != 'A' and l[x] != 'C' and not l[x].islower():
                q3 = False
            else:
                q3 = True

    if q1 and q2 and q3:
        return 'AC'
    else:
        return 'WA'


if __name__ == '__main__':
    N = input()
    print(check(N))

Submission status: Wrong Answer

Solution code:
def check(n):
    global q3
    q1 = True if n[0] == 'A' else False
    q2 = True if 'C' in n[2:-1] and n[2:-1].count('C') == 1 else False

    if q1 and q2:
        w = list(n)
        s = len(w)
        for x in range(s):
            if w[x] == 'C' and 2 < x < s-2:
                del w[x]
                break
        del w[0]
        ans = ''.join(map(str, w))
        if ans.islower:
            q3 = True
        else:
            q3 = False

    if q1 and q2 and q3:
        return 'AC'
    else:
        return 'WA'


if __name__ == '__main__':
    N = input()
    print(check(N))

Submission status: Wrong Answer

Solution code:
def check(n):
    q1 = True if n[0] == 'A' else False
    q2 = True if 'C' in n[2:-1] and n[2:-1].count('C') == 1 else False

    if q1 and q2:
        w = list(n)
        s = len(w)
        for x in range(s):
            if w[x] == 'C' and 2 < x < s-2:
                del w[x]
                break
        del w[0]
        ans = ''.join(map(str, w))
        if ans.islower:
            q3 = True
        else:
            q3 = False

    if q1 and q2 and q3:
        return 'AC'
    else:
        return 'WA'


if __name__ == '__main__':
    N = input()
    print(check(N))

Submission status: Wrong Answer

Solution code:
S = input()

flag = False

if S[0] == 'A' and S[2:-2].count('C') == 1 :
  if S.count('A') == 1 and S.count('C') == 1:
    if S.replace('A', 'a').replace('C','c').islower():
      flag = True

log = 'AC' if flag else 'WA'
print(log)

Submission status: Wrong Answer

Solution code:
S = input()
n = len(S)
countc = 0
counta = 0
for m in range (3, n-1):
    if S[m-1] == 'C':
        countc = countc + 1
        S = S[:m-1] + 'c' + S[m:]
if S[1-1] == 'A':
    counta = 1
    S = 'a' + S[1:]
if(countc == 1 and counta == 1 and S.islower()):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
flag = False

if S[0] != 'A':
  print('A')
  flag = True

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

if not S.replace('A', '').replace('C', '').islower():
  print('C')
  flag = True

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

Submission status: Wrong Answer

Solution code:
S = input()

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

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

if not S.replace('A', '').replace('C', '').islower():
  print('WA')
  
print('AC')

Submission status: Wrong Answer

Solution code:
S=input()

T=S.count("C")

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

elif "C" in S[2:-1] and T==1 :
    S2=S.replace("A", "")
    S2=S2.replace("C" , "")
    if S2.islower() :
        print("AC")
    
else:
    print("WA")

Submission status: Wrong Answer

Solution code:

#B - AcCepted
S=str(input())
#print(S[0].isupper())
#print(S[1])
length=len(S)
cnt=0
flg=1
ans="WA"
if S[0]=='A' and S.count('C')==1:
    #S[0].replace('A','a')

    ans="AC"
    for i in range(1,length):
        if S[i].isupper() and S[i]!='C':
            ans="WA"
            break
        elif S[i]=='C':
            if i<1 or i>(length-2):
                ans="WA"
                break
print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())

ans = 'AC'
cnt = 0

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

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'
    elif s[i] == 'C':
        cnt += 1

if cnt != 1:
    ans = 'WA'

print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())

ans = 'AC'
cnt = 0

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

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'
    else:
        cnt += 1

if cnt != 1:
    ans = 'WA'

print(ans)

Submission status: Wrong Answer

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


s = str(input())

ans = 'AC'
cnt = 0

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

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'
else:
    cnt += 1

if cnt != 1:
    ans ='WA'

print(ans)

Submission status: Wrong Answer

Solution code:
import re
s = input()
ci = s.find("C")
if s.find("A") == 0 and 2 <= ci < len(s) - 2:
  tmp = list(s)
  del tmp[0]
  del tmp[ci - 1]
  if re.match("^[a-z]*$", "".join(tmp)):
    print("AC")
    exit()
print("WA")

Submission status: Wrong Answer

Solution code:
import re
s = input()
print("AC" if re.match("^A[a-z]C[a-z]*$", s) else "WA")

Submission status: Wrong Answer

Solution code:
import re
s = input()
print("AC" if re.match("$A[a-z]C[a-z]*^", s) else "WA")

Submission status: Wrong Answer

Solution code:
import re
s = input()
print("AC" if re.match("A[a-z]C[a-z]*", s) else "WA")

Submission status: Wrong Answer

Solution code:
import re
s = input()
print("AC" if re.match("A.C.*", s) else "WA")

Submission status: Wrong Answer

Solution code:
import re
s = input()
print("AC" if re.match(s, "A.C.*") else "WA")

Submission status: Wrong Answer

Solution code:
import sys
S = list(input())
# S = "Atcoder"
# S = list(S)

if S[0] != "A":
    print("WA")
    sys.exit()
elif S[1].isupper():
    print("WA")
    sys.exit()
elif S[-1].isupper():
    print("WA")
    sys.exit()
else:
    SS = S[2:-1]

if "C" in SS:
    SS.remove("C")
    SS = str(SS)
    if SS.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
import sys
# S = list(input())
S = "AtCoder"
S = list(S)

if S[0] != "A":
    print("WA")
    sys.exit()
elif S[1].isupper():
    print("WA")
    sys.exit()
elif S[-1].isupper():
    print("WA")
    sys.exit()
else:
    SS = S[2:-1]

if "C" in SS:
    SS.remove("C")
    SS = str(SS)
    if SS.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
import sys
S = list(input())
# S = "AtCoder"
# S = list(S)

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

SS = S[2:-1]
if "C" in SS:
    SS.remove("C")
    SS = str(SS)
    if SS.islower():
        print("AC")
    else:
        print("WA")

else:
    print("WA")

Submission status: Wrong Answer

Solution code:
import sys
S = list(input())

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

SS = S[2:-2]
if "C" in SS:
    SS.remove("C")
    SS = str(SS)
    if SS.islower():
        print("AC")
    else:
        print("WA")

else:
    print("WA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a = str(input())
b = "AC"
if (a[0:1] != 'A'): b = 'WA'
if (not a[1:2].islower()): b = 'WA'
if (a[2:-1].count('C') != 1): b = 'WA'
if (not a[2:-1].replace('C', '').islower()): b = 'WA'
if (not a[-1].islower()): b = 'WA'

print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re
p = re.compile(r'A[a-z]{1,}C[a-z]{1,}')

S = input()
if bool(p.match(S)):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
str=list(input())
if(str[0]=='A' and 'C' in str[2:len(str)-1:1] and str.count('C')==1):
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
ans = 'WA'
if S[0]=='A':
    if S[2:-1].count('C')==1:
        S = S.replace('A','')
        S = S.replace('C','')
        for c in S:
            if c<'a' or 'z'<c:
                ans = 'WA'
            else:
                ans = 'AC'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
if s[0] !="A":
    print("WA")
else:
    s = s.replace(s[0],"a",1)
    index1 = s.find("C")
    s = s.replace(s[index1],"c",1)
    index2 = s.find("C")
    if index1 ==-1 or index2 != -1 or (index1 < 2 or index1 > l-3):
        print("WA")
    else:
        s_lower = s.lower()
        if s != s_lower:
            print("WA")
        else:
            print("AC")

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
if s[0] !="A":
    print("WA")
else:
    s = s.replace(s[0],"a",1)
    index1 = s.find("C")
    s = s.replace(s[index1],"c",1)
    index2 = s.find("C")
    if index2 != -1 or (index1 < 2 or index1 > l-3):
        print("WA")
    else:
        s_lower = s.lower()
        if s != s_lower:
            print("WA")
        else:
            print("AC")

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
if s[0] !="A":
    print("WA")
else:
    s = s.replace(s[0],"a")
    index1 = s.find("C")
    s = s.replace(s[index1],"c")
    index2 = s.find("C")

    if index2 != -1 or (index1 < 2 or index1 > l-3):
        print("WA")
    else:
        s_lower = s.lower()

        if s != s_lower:
            print("WA")
        else:
            print("AC")

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
if s[0] !="A":
    print("WA")
else:
    s = s.replace(s[0],"a")
    index1 = s.find("C")
    s = s.replace(s[index1],"c")
    index2 = s.find("C")

    if index2 != -1 or (index1 < 2 or index1 > l-3):
        print("WA")
    else:
        s_lower = s.lower()

        print(s)

        if s != s_lower:
            print("WA")
        else:
            print("AC")

Submission status: Wrong Answer

Solution code:
str=list(input())

count1=0
count2=0
if str[0]=="A":
  for i in range(len(str)-3):
    if str[i+2]=="C":
      count1 += 1
  for i in range(len(str)):
    if str[i]==str[i].capitalize():
      count2 += 1
  if count1 == 1 and count2 !=0 :
    print("AC")
  else:
    print("WA")
else:
  print("WA")

Submission status: Wrong Answer

Solution code:
S = list(input())
if S[0] != 'A':
	print("WC")
	exit()
c_count = 0
upper_count = 0
for i in range(len(S)):
	if S[i] == 'C':
		if (i < 2) | (i > (len(S)-1)):
			print("WC")
			exit()
		else:
			if c_count == 0 :
				c_count += 1
			else:
				print("WA")
				exit()
	if S[i].isupper():
		upper_count += 1

if (c_count == 1) & (upper_count == 2):
	print("AC")

Submission status: Wrong Answer

Solution code:
def main19():
    strbuf = input('');
    num = len(strbuf);
    boo = False;
    for i in range(num-3):
        if strbuf[2+i] == 'C':
            if boo == False:
                boo = True;
            else:
                boo = False;
                break;
    if strbuf[0] == 'A' and boo:
        print("AC");
    else:
        print("WA");




if __name__ == '__main__':
    main19()

Submission status: Wrong Answer

Solution code:
def main19():
    strbuf = input('');
    num = len(strbuf);
    boo = False;
    for i in range(num-3):
        if strbuf[2+i] == 'C':
            boo = True;
    if strbuf[0] == 'A' and boo:
        print("AC");
    else:
        print("WA");




if __name__ == '__main__':
    main19()

Submission status: Wrong Answer

Solution code:
import re

s = input()

if not s.startswith('A'):
    print('WA')
elif s[2:len(s) - 3].count('C') == 1:
    print('WA')
elif len(re.findall('[A-Z]', s)) != 2:
    print('WC')
else:
    print('AC')

Submission status: Wrong Answer

Solution code:
s = input()

if not s.startswith('A'):
    print('WA')
elif s[2:len(s) - 3].count('C') == 1:
    print('WA')
else:
    print('AC')

Submission status: Wrong Answer

Solution code:
S = input()

a = S.startswith('A')
b = 'C' in S[2:-2]
idx = S.find('C', 2, -2)
c = (S[1:idx] + S[(idx + 1) :]).islower()

if a and b and c:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def main():
    s = input()

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

    count = 0
    for c in s[2:-2]:
        if c == 'C':
            count += 1

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

    s = s[1:]
    s = s.replace('C', '')
    if s.islower() == False:
        print("WA")
        return

    print("AC")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)

if s[0] == 'A':
  if s[3:l - 1].count('C') == 1:
    idx = s[2:l - 1].index('C') + 2
    if s[1:idx].islower() and s[idx + 1:].islower():
      print('AC')
      quit()
print('WA')

Submission status: Wrong Answer

Solution code:
import random as r;print(r.choice(["AC","WA"]))