QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#731355#5596. I Could Have Wonbeamishboys#WA 0ms3828kbC++23548b2024-11-10 02:24:332024-11-10 02:24:34

Judging History

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

  • [2024-11-10 02:24:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3828kb
  • [2024-11-10 02:24:33]
  • 提交

answer

#include <iostream>
#include <vector>
using namespace std;

int main() {
	string s; cin >> s;
	vector<int> out;
	for (int i = 1; i < s.size(); i++) {
		int a = 0, b = 0;
		int awon = 0, bwon = 0;
		for (int j = 0; j < s.size(); j++) {
			if (s[j] == 'A') a++;
			else b++;
			if (a == i) {
				awon++;
				a = 0;
				b = 0;
			}
			else if (b == i) {
				bwon++;
				a = 0;
				b = 0;
			}
		}
		if (awon > bwon) out.push_back(i);
	}
	cout << out.size() << endl;
	for (int i :  out) cout << i << ' ';
	cout << endl;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3560kb

input:

BBAAABABBAAABB

output:

3
3 6 7 

result:

ok 2 lines

Test #2:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

AABBBAAB

output:

2
2 4 

result:

ok 2 lines

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3828kb

input:

A

output:

0


result:

wrong answer 1st lines differ - expected: '1', found: '0'