Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
int t; cin>>t;
while (t--)
{
ll n, k; cin >> n >> k;
string s; cin >> s;
vector<ll> a(n), b(n);
if(s[0]=='?'){
s[0]='A';
}
if(s[n-1]=='?'){
s[n-1]='B';
}
for(int i=0; i<n/2; i++)
{ if(s[i]=='?'){
s[i]='A';
}
}
for(int i=n/2; i<n; i++)
{ if(s[i]=='?'){
s[i]='B';
}
}
ll cta=count(s.begin(),s.end(),'A');
ll ctb=count(s.begin(),s.end(),'B');
cout<<cta*ctb<<endl;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1110 Subsequence of AB
- Contest
- LU IUJPC : Sylhet Division 2024, Mock Round
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-12-07 11:41:10
- Judged At
- 2024-12-07 11:41:10
- Judged By
- Score
- 1
- Total Time
- 19ms
- Peak Memory
- 556.0 KiB