This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#ifdef MIKU
string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m";
#define debug(x...) cout << dbmc << "[" << #x << "]: ", dout(x)
void dout() { cout << dbrs << endl; }
template <typename T, typename ...U>
void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); }
#else
#define debug(...) 39
#endif
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
using ll = long long;
typedef pair<int, int> pii;
const int MXN = 205;
int L, q, n, a[MXN], b[MXN];
string s;
namespace FAB {
void OUTPUT(int n, int a, int b, int c, int sr) {
vector<int> v;
auto f = [&](int cnt, int tg) -> void {
while (cnt--) {
FOR(i, 0, tg) v.push_back(sr);
sr++;
}
};
int w[3] = {n / 100, n % 100 / 10, n % 10};
f(w[0], a);
f(w[1], b);
f(w[2], c);
cout << v.size() << ' ';
for (auto &i : v) cout << i << ' ';
cout << '\n';
}
void fa() {
cin >> n;
OUTPUT(--n, 1, 3, 6, 1);
}
void fb() {
cin >> n;
OUTPUT(--n, 2, 4, 5, 10000);
}
}
void fc() {
vector<int> v(7, 0);
int br;
cin >> n;
while (n--) {
cin >> br;
v[br]++;
}
int a = v[1] * 100 + v[3] * 10 + v[6];
int b = v[2] * 100 + v[4] * 10 + v[5];
cout << (a < b ? "B" : "A") << '\n';
}
void miku() {
cin >> L >> q;
assert(L >= 110);
while (q--) {
cin >> s;
if (s[0] == 'a') FAB::fa();
else if (s[0] == 'b') FAB::fb();
else fc();
}
}
int32_t main() {
cin.tie(0) -> sync_with_stdio(false);
cin.exceptions(cin.failbit);
miku();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |