QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#745678#5596. I Could Have WonpannedWA 0ms3592kbC++14506b2024-11-14 11:03:522024-11-14 11:03:53

Judging History

你现在查看的是最新测评结果

  • [2024-11-14 11:03:53]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3592kb
  • [2024-11-14 11:03:52]
  • 提交

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'