Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
　　int n;
　　cin>>n;
　　vector<string> s(n);
　　for(int i=0;i<n;i++){
　　  cin>>s.at(i);
　　}
　　int counter=0;
　　for(int i=0;i<n;i++){
　　　　for(int j=0;j<s.at(i).size()-1;j++){
　　　　　　if(s.at(i).at(j)=='A'&&s.at(i).at(j+1)=='B'){
　　　　　　counter++;
　　　　　　}
　　　　}
　　}
　　int ab=0,a=0,b=0;
　　for(int k=0;k<n;k++){
　　　　if(s.at(k).at(s.at(k).size()-1)=='A'){
　　　　　　if(s.at(k).at(0)=='B')ab++;
　　　　　　else a++;
　　　　}
　　　　else if(s.at(k).at(0)=='B')b++;
　　}
  if(a==b&&0==a){
    cout<<counter+max(0,a-1+ab)<<endl;
　　}
　　if(a==b&&1<=a){
　　cout<<counter+max(0,a-1+ab+2)<<endl;
　　}
　　else cout<<counter+min(a,b)+ab<<endl;
}

Compiler output:
a.cc:4:1: error: extended character 　 is not valid in an identifier
    4 | 　　int n;
      | ^
a.cc:4:1: error: extended character 　 is not valid in an identifier
a.cc:5:1: error: extended character 　 is not valid in an identifier
    5 | 　　cin>>n;
      | ^
a.cc:5:1: error: extended character 　 is not valid in an identifier
a.cc:6:1: error: extended character 　 is not valid in an identifier
    6 | 　　vector<string> s(n);
      | ^
a.cc:6:1: error: extended character 　 is not valid in an identifier
a.cc:7:1: error: extended character 　 is not valid in an identifier
    7 | 　　for(int i=0;i<n;i++){
      | ^
a.cc:7:1: error: extended character 　 is not valid in an identifier
a.cc:8:1: error: extended character 　 is not valid in an identifier
    8 | 　　  cin>>s.at(i);
      | ^
a.cc:8:1: error: extended character 　 is not valid in an identifier
a.cc:9:1: error: extended character 　 is not valid in an identifier
    9 | 　　}
      | ^
a.cc:9:1: error: extended character 　 is not valid in an identifier
a.cc:10:1: error: extended character 　 is not valid in an identifier
   10 | 　　int counter=0;
      | ^
a.cc:10:1: error: extended character 　 is not valid in an identifier
a.cc:11:1: error: extended character 　 is not valid in an identifier
   11 | 　　for(int i=0;i<n;i++){
      | ^
a.cc:11:1: error: extended character 　 is not valid in an identifier
a.cc:12:1: error: extended character 　 is not valid in an identifier
   12 | 　　　　for(int j=0;j<s.at(i).size()-1;j++){
      | ^
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc:13:1: error: extended character 　 is not valid in an identifier
   13 | 　　　　　　if(s.at(i).at(j)=='A'&&s.at(i).at(j+1)=='B'){
      | ^
a.cc:13:1: error: extended character 　 is not valid in an identifier
a.cc:13:1: error: extended character 　 is not valid in an identifier
a.cc:13:1: error: extended character 　 is not valid in an identifier
a.cc:13:1: error: extended character 　 is not valid in an identifier
a.cc:13:1: error: extended character 　 is not valid in an identifier
a.cc:14:1: error: extended character 　 is not valid in an identifier
   14 | 　　　　　　counter++;
      | ^
a.cc:14:1: error: extended character 　 is not valid in an identifier
a.cc:14:1: error: extended character 　 is not valid in an identifier
a.cc:14:1: error: extended character 　 is not valid in an identifier
a.cc:14:1: error: extended character 　 is not valid in an identifier
a.cc:14:1: error: extended character 　 is not valid in an identifier
a.cc:15:1: error: extended character 　 is not valid in an identifier
   15 | 　　　　　　}
      | ^
a.cc:15:1: error: extended character 　 is not valid in an identifier
a.cc:15:1: error: extended character 　 is not valid in an identifier
a.cc:15:1: error: extended character 　 is not valid in an identifier
a.cc:15:1: error: extended character 　 is not valid in an identifier
a.cc:15:1: error: extended character 　 is not valid in an identifier
a.cc:16:1: error: extended character 　 is not valid in an identifier
   16 | 　　　　}
      | ^
a.cc:16:1: error: extended character 　 is not valid in an identifier
a.cc:16:1: error: extended character 　 is not valid in an identifier
a.cc:16:1: error: extended character 　 is not valid in an identifier
a.cc:17:1: error: extended character 　 is not valid in an identifier
   17 | 　　}
      | ^
a.cc:17:1: error: extended character 　 is not valid in an identifier
a.cc:18:1: error: extended character 　 is not valid in an identifier
   18 | 　　int ab=0,a=0,b=0;
      | ^
a.cc:18:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
   19 | 　　for(int k=0;k<n;k++){
      | ^
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:20:1: error: extended character 　 is not valid in an identifier
   20 | 　　　　if(s.at(k).at(s.at(k).size()-1)=='A'){
      | ^
a.cc:20:1: error: extended character 　 is not valid in an identifier
a.cc:20:1: error: extended character 　 is not valid in an identifier
a.cc:20:1: error: extended character 　 is not valid in an identifier
a.cc:21:1: error: extended character 　 is not valid in an identifier
   21 | 　　　　　　if(s.at(k).at(0)=='B')ab++;
      | ^
a.cc:21:1: error: extended character 　 is not valid in an identifier
a.cc:21:1: error: extended character 　 is not valid in an identifier
a.cc:21:1: error: extended character 　 is not valid in an identifier
a.cc:21:1: error: extended character 　 is not valid in an identifier
a.cc:21:1: error: extended character 　 is not valid in an identifier
a.cc:22:1: error: extended character 　 is not valid in an identifier
   22 | 　　　　　　else a++;
      | ^
a.cc:22:1: error: extended character 　 is not valid in an identifier
a.cc:22:1: error: extended character 　 is not valid in an identifier
a.cc:22:1: error: extended character 　 is not valid in an identifier
a.cc:22:1: error: extended character 　 is not valid in an identifier
a.cc:22:1: error: extended character 　 is not valid in an identifier
a.cc:23:1: error: extended character 　 is not valid in an identifier
   23 | 　　　　}
      | ^
a.cc:23:1: error: extended character 　 is not valid in an identifier
a.cc:23:1: error: extended character 　 is not valid in an identifier
a.cc:23:1: error: extended character 　 is not valid in an identifier
a.cc:24:1: error: extended character 　 is not valid in an identifier
   24 | 　　　　else if(s.at(k).at(0)=='B')b++;
      | ^
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc:24:1: error: extended character 　 is not valid in an identifier
a.cc:25:1: error: extended character 　 is not valid in an identifier
   25 | 　　}
      | ^
a.cc:25:1: error: extended character 　 is not valid in an identifier
a.cc:28:1: error: extended character 　 is not valid in an identifier
   28 | 　　}
      | ^
a.cc:28:1: error: extended character 　 is not valid in an identifier
a.cc:29:1: error: extended character 　 is not valid in an identifier
   29 | 　　if(a==b&&1<=a){
      | ^
a.cc:29:1: error: extended character 　 is not valid in an identifier
a.cc:30:1: error: extended character 　 is not valid in an identifier
   30 | 　　cout<<counter+max(0,a-1+ab+2)<<endl;
      | ^
a.cc:30:1: error: extended character 　 is not valid in an identifier
a.cc:31:1: error: extended character 　 is not valid in an identifier
   31 | 　　}
      | ^
a.cc:31:1: error: extended character 　 is not valid in an identifier
a.cc:32:1: error: extended character 　 is not valid in an identifier
   32 | 　　else cout<<counter+min(a,b)+ab<<endl;
      | ^
a.cc:32:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:4:1: error: '\U00003000\U00003000int' was not declared in this scope
    4 | 　　int n;
      | ^~~~~~~
a.cc:5:1: error: '\U00003000\U00003000cin' was not declared in this scope
    5 | 　　cin>>n;
      | ^~~~~~~
a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 | 　　cin>>n;
      |          ^
      |          yn
a.cc:6:1: error: '\U00003000\U00003000vector' was not declared in this scope
    6 | 　　vector<string> s(n);
      | ^~~~~~~~~~
a.cc:6:18: error: expected primary-expression before '>' token
    6 | 　　vector<string> s(n);
      |                  ^
a.cc:6:20: error: 's' was not declared in this scope
    6 | 　　vector<string> s(n);
      |                    ^
a.cc:7:9: error: expected primary-expression before 'int'
    7 | 　　for(int i=0;i<n;i++){
      |         ^~~
a.cc:7:17: error: 'i' was not declared in this scope
    7 | 　　for(int i=0;i<n;i++){
      |                 ^
a.cc:10:8: error: expected ';' before 'counter'
   10 | 　　int counter=0;
      |        ^~~~~~~~
      |        ;
a.cc:11:9: error: expected primary-expression before 'int'
   11 | 　　for(int i=0;i<n;i++){
      |         ^~~
a.cc:18:8: error: expected ';' before 'ab'
   18 | 　　int ab=0,a=0,b=0;
      |        ^~~
      |        ;
a.cc:19:9: error: expected primary-expression before 'int'
   19 | 　　for(int k=0;k<n;k++){
      |         ^~~
a.cc:19:17: error: 'k' was not declared in this scope
   19 | 　　for(int k=0;k<n;k++){
      |                 ^
a.cc:26:6: error: 'a' was not declared in this scope
   26 |   if(a==b&&0==a){
      |      ^
a.cc:26:9: error: 'b' was not declared in this scope
   26 |   if(a==b&&0==a){
      |         ^
a.cc:27:11: error: 'counter' was not declared in this scope
   27 |     cout<<counter+max(0,a-1+ab)<<endl;
      |           ^~~~~~~
a.cc:27:29: error: 'ab' was not declared in this scope; did you mean 'abs'?
   27 |     cout<<counter+max(0,a-1+ab)<<endl;
      |                             ^~
      |                             abs
a.cc:28:1: error: '\U00003000\U00003000' was not declared in this scope
   28 | 　　}
      | ^~~~
a.cc:29:8: error: 'a' was not declared in this scope
   29 | 　　if(a==b&&1<=a){
      |        ^
a.cc:29:11: error: 'b' was not declared in this scope
   29 | 　　if(a==b&&1<=a){
      |           ^
a.cc:29:1: error: '\U00003000\U00003000if' was not declared in this scope
   29 | 　　if(a==b&&1<=a){
      | ^~~~~~
a.cc:32:1: error: '\U00003000\U00003000else' was not declared in this scope
   32 | 　　else cout<<counter+min(a,b)+ab<<endl;
      | ^~~~~~~~