Submission #1380520


Source Code Expand

// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int n, a, b;
  cin >> n >> a >> b;
  string s;
  cin >> s;
  vi v(n);
  int c = 0, e = 0;
  rep(i, n) {
    if (s[i] == 'a' && c < a + b) {
      v[i] = true;
      c++;
    }
    if (s[i] == 'b' && c < a + b && e < b) {
      v[i] = true;
      c++, e++;
    }
  }
  for (auto x : v) cout << (x ? "Yes" : "No") << endl;
}

Submission Info

Submission Time
Task B - Qualification simulator
User AyaMorisawa
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1733 Byte
Status AC
Exec Time 159 ms
Memory 1664 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 13
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt AC 153 ms 1536 KB
02.txt AC 155 ms 1536 KB
03.txt AC 159 ms 1664 KB
04.txt AC 155 ms 1664 KB
05.txt AC 135 ms 1408 KB
06.txt AC 154 ms 1536 KB
07.txt AC 158 ms 1664 KB
08.txt AC 158 ms 1664 KB
09.txt AC 155 ms 1536 KB
10.txt AC 154 ms 1536 KB
s1.txt AC 1 ms 256 KB
s2.txt AC 1 ms 256 KB
s3.txt AC 1 ms 256 KB