QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#745678 | #5596. I Could Have Won | panned | WA | 0ms | 3592kb | C++14 | 506b | 2024-11-14 11:03:52 | 2024-11-14 11:03:53 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define YES cout << "YES\n"
#define NO cout << "NO\n"
void SOLVE() {
string s;
cin >> s;
int countA = 0;
int countB = 0;
int count = 0;
set<int> win;
for(int i=0; i<s.length();i++){
if(s[i]=='A'){
countA++;
}else{
countB++;
}
if(countA>countB){
win.insert(countA);
}
}
cout << win.size() << "\n";
for(int wi: win){
cout << wi << " ";
}
}
int main(){
SOLVE();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3592kb
input:
BBAAABABBAAABB
output:
4 3 4 6 7
result:
wrong answer 1st lines differ - expected: '3', found: '4'