QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
詳細信息
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'