#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 t, int k) -> void {
while (k--) {
FOR(i, 0, t) 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");
}
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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
905 ms |
2684 KB |
Token "ABABBAAAAAABAAAAAAABABBBBBBBBA...AAABAABBBBAAAABBBBBABBAABABBABA" doesn't correspond to pattern "A|B" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
5038 ms |
423700 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |