QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#731355 | #5596. I Could Have Won | beamishboys# | WA | 0ms | 3828kb | C++23 | 548b | 2024-11-10 02:24:33 | 2024-11-10 02:24:34 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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'