Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
	string s;
	cin >> s;
	bool isValid = s[0] == 'A' 
		&& count(s.begin()+2, s.end()-1, 'C') == 1
		&& all_of(s.begin()+1, s.end(), [](char c) { c == 'C' || (c < 'z' && c > 'a'); })
		&& s[1] != 'C' && s.back() != 'C';
	cout << (isValid ? "AC" : "WA") << endl;
	return 0;
}


Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_negate<_Predicate>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >; _Predicate = main()::<lambda(char)>]':
/usr/include/c++/14/bits/stl_algobase.h:2107:14:   required from '_RandomAccessIterator std::__find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate, random_access_iterator_tag) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Predicate = __gnu_cxx::__ops::_Iter_negate<main()::<lambda(char)> >]'
 2107 |           if (__pred(__first))
      |               ~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:112:28:   required from '_InputIterator std::__find_if_not(_InputIterator, _InputIterator, _Predicate) [with _InputIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Predicate = __gnu_cxx::__ops::_Iter_pred<main()::<lambda(char)> >]'
  112 |       return std::__find_if(__first, __last,
      |              ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  113 |                             __gnu_cxx::__ops::__negate(__pred),
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  114 |                             std::__iterator_category(__first));
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:471:32:   required from '_IIter std::find_if_not(_IIter, _IIter, _Predicate) [with _IIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Predicate = main()::<lambda(char)>]'
  471 |       return std::__find_if_not(__first, __last,
      |              ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  472 |                                 __gnu_cxx::__ops::__pred_iter(__pred));
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:411:40:   required from 'bool std::all_of(_IIter, _IIter, _Predicate) [with _IIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Predicate = main()::<lambda(char)>]'
  411 |     { return __last == std::find_if_not(__first, __last, __pred); }
      |                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:11:12:   required from here
   11 |                 && all_of(s.begin()+1, s.end(), [](char c) { c == 'C' || (c < 'z' && c > 'a'); })
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:395:31: error: void value not ignored as it ought to be
  395 |         { return !bool(_M_pred(*__it)); }
      |                        ~~~~~~~^~~~~~~