QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#746197#5596. I Could Have Woni24WA 0ms3856kbC++141.1kb2024-11-14 13:48:252024-11-14 13:48:26

Judging History

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

  • [2024-11-14 13:48:26]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3856kb
  • [2024-11-14 13:48:25]
  • 提交

answer

// File generated on 24/11/13 21:39 by Anand

#include <bits/stdc++.h>
using namespace std;

#define fastio ios::sync_with_stdio(false); cin.tie(0)
#define rep(i, m, n)  for (long long i = m; i < n; i++)
#define DEBUG(x) cout << "debug: " << x << "\n"
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define pb push_back
#define sz size

typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vec;
typedef vector<vec> vecc;
typedef vector<pll> vecp;

void SOLVE() {
    string s;
    cin >> s;
    ll n = s.size();
    ll x = 0;
    vec y;
    rep(i,1,n) {
        ll a = 0, b = 0;
        ll ac = 0, bc = 0;
        rep(j, 0, n) {
            if (ac >= i) {a++; ac = 0; bc = 0;}
            if (bc >= i) {b++; ac = 0; bc = 0;}
            if (s[j] == 'A') ac++;
            else bc++;
        }
        if (ac >= i) a++;
        if (bc>=i) b++;
        if (a > b) y.pb(i);
    }
    cout << y.size() << "\n";
    for(auto& i : y) cout << i << " ";
    cout<< "\n";
}

signed main() {
    fastio;


		SOLVE();

    return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

BBAAABABBAAABB

output:

3
3 6 7 

result:

ok 2 lines

Test #2:

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

input:

AABBBAAB

output:

2
2 4 

result:

ok 2 lines

Test #3:

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

input:

A

output:

0


result:

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