#define NDEBUG
#ifdef NDEBUG
#define dbg(TXTMSG) if constexpr (false) cerr << "lol"
#define dbgv(VARN) ((void)0)
#define dbgfor(COND) if constexpr (false) for (COND)
#else
#define _GLIBCXX_DEBUG 1
#define _GLIBCXX_DEBUG_PEDANTIC 1
#pragma GCC optimize("trapv")
#define dbg(TXTMSG) cerr << "\n" << TXTMSG
#define dbgv(VARN) cerr << "\n" << #VARN << " = "<< VARN << ", line: " << __LINE__ << "\n"
#define dbgfor(COND) for (COND)
#endif
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
#define e0 first
#define e1 second
constexpr ll INFTY = 1e11;
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
ll L,Q;
cin >> L >> Q;
for (ll tc = 0; tc < Q; ++tc)
{
constexpr ll period = 32;
string p;
cin >> p;
if (p=="alojzije") {
ll A;
cin >> A;
vector<ll> outp;
for (ll i = 0; i < (A/period); ++i)
{
outp.push_back(i);
}
for (ll i = 0; i < 9; ++i)
{
outp.push_back(A/period);
}
for (ll i = 0; i < (A%period); ++i)
{
outp.push_back(50+i);
}
cout << outp.size() << " ";
for (ll e : outp) {
cout << e << " ";
}
cout << "\n";
}
else if (p=="benjamin") {
ll B;
cin >> B;
vector<ll> outp;
outp.push_back(B/period);
for (ll i = 0; i < period; ++i)
{
outp.push_back(50+i);
outp.push_back(50+i);
outp.push_back(50+i);
}
outp.push_back(50+B%period);
cout << outp.size() << " ";
for (ll e : outp) {
cout << e << " ";
}
cout << "\n";
}
else if(p=="cecilija")
{
ll lc;
cin >> lc;
set<ll> C;
for (ll i = 0; i < lc; ++i)
{
ll ci;
cin >> ci;
C.insert(ci);
}
if (C.count(10)==0) {
if (C.count(2)==1) {
cout << "A\n";
}
else {
assert(C.count(2)==0);
cout << "B\n";
}
}
else {
if (C.count(5)==1) {
cout << "A\n";
}
else {
assert(C.count(5)==0);
cout << "B\n";
}
}
}
else {dbgv(p);throw "help";};
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
17 ms |
740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2170 ms |
3700 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
5036 ms |
386772 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |