//Challenge: Accepted
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
#ifdef zisk
void debug(){cout << endl;}
template<class T, class ... U> void debug(T a, U ...b){cout << a << " ", debug(b...);}
template<class T> void pary(T l, T r) {
while (l != r) cout << *l << " ", l++;
cout << endl;
}
#else
#define debug(...) 0
#define pary(...) 0
#endif
#define ll long long
#define maxn 2005
#define pii pair<int, int>
#define ff first
#define ss second
int sum[maxn];
}
int Declare() {
for (int i = 1;i < maxn;i++) {
sum[i] = sum[i-1] + i * 2 + 1;
}
return 2000;
}
std::pair<std::vector<int>, std::vector<int> > Anna(long long A) {
int len = 0;
while (A > sum[len+1]) len++;
vector<int> X(len+1, 0);
vector<int> Y(len+1, 0);
A--;
for (int i = 0;i < min(len+1, int(A - sum[len]));i++) X[i] = 1;
for (int i = 0;i < min(len+1, int(A - sum[len] - (len+1)));i++) Y[i] = 1;
//pary(X.begin(), X.end());
//pary(Y.begin(), Y.end());
return make_pair(X, Y);
}
//Challenge: Accepted
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef zisk
void debug(){cout << endl;}
template<class T, class ... U> void debug(T a, U ...b){cout << a << " ", debug(b...);}
template<class T> void pary(T l, T r) {
while (l != r) cout << *l << " ", l++;
cout << endl;
}
#else
#define debug(...) 0
#define pary(...) 0
#endif
#define ll long long
#define maxn 2005
#define pii pair<int, int>
#define ff first
#define ss second
namespace {
bool ini = 0;
int sum[maxn];
}
long long Bruno(std::vector<int> u) {
if (!ini) {
ini = 1;
for (int i = 1;i < maxn;i++) {
sum[i] = sum[i-1] + i * 2 + 1;
}
}
int len = u.size() / 2;
int ret = sum[len-1]+1;
for (int i = 0;i < 2*len;i++) {
if (u[i] == 1) ret++;
}
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
508 KB |
Output is correct |
2 |
Correct |
16 ms |
904 KB |
Output is correct |
3 |
Correct |
22 ms |
1164 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
508 KB |
Output is correct |
2 |
Correct |
16 ms |
904 KB |
Output is correct |
3 |
Correct |
22 ms |
1164 KB |
Output is correct |
4 |
Correct |
551 ms |
22036 KB |
Output is correct |
5 |
Correct |
548 ms |
21856 KB |
Output is correct |
6 |
Correct |
538 ms |
22252 KB |
Output is correct |
7 |
Correct |
528 ms |
21680 KB |
Output is correct |
8 |
Correct |
548 ms |
22248 KB |
Output is correct |
9 |
Correct |
796 ms |
32580 KB |
Output is correct |
10 |
Correct |
728 ms |
32464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
508 KB |
Output is correct |
2 |
Correct |
16 ms |
904 KB |
Output is correct |
3 |
Correct |
22 ms |
1164 KB |
Output is correct |
4 |
Correct |
551 ms |
22036 KB |
Output is correct |
5 |
Correct |
548 ms |
21856 KB |
Output is correct |
6 |
Correct |
538 ms |
22252 KB |
Output is correct |
7 |
Correct |
528 ms |
21680 KB |
Output is correct |
8 |
Correct |
548 ms |
22248 KB |
Output is correct |
9 |
Correct |
796 ms |
32580 KB |
Output is correct |
10 |
Correct |
728 ms |
32464 KB |
Output is correct |
11 |
Incorrect |
1 ms |
644 KB |
Wrong Answer [3] |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
508 KB |
Output is correct |
2 |
Correct |
16 ms |
904 KB |
Output is correct |
3 |
Correct |
22 ms |
1164 KB |
Output is correct |
4 |
Correct |
551 ms |
22036 KB |
Output is correct |
5 |
Correct |
548 ms |
21856 KB |
Output is correct |
6 |
Correct |
538 ms |
22252 KB |
Output is correct |
7 |
Correct |
528 ms |
21680 KB |
Output is correct |
8 |
Correct |
548 ms |
22248 KB |
Output is correct |
9 |
Correct |
796 ms |
32580 KB |
Output is correct |
10 |
Correct |
728 ms |
32464 KB |
Output is correct |
11 |
Incorrect |
1 ms |
644 KB |
Wrong Answer [3] |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
508 KB |
Output is correct |
2 |
Correct |
16 ms |
904 KB |
Output is correct |
3 |
Correct |
22 ms |
1164 KB |
Output is correct |
4 |
Correct |
551 ms |
22036 KB |
Output is correct |
5 |
Correct |
548 ms |
21856 KB |
Output is correct |
6 |
Correct |
538 ms |
22252 KB |
Output is correct |
7 |
Correct |
528 ms |
21680 KB |
Output is correct |
8 |
Correct |
548 ms |
22248 KB |
Output is correct |
9 |
Correct |
796 ms |
32580 KB |
Output is correct |
10 |
Correct |
728 ms |
32464 KB |
Output is correct |
11 |
Incorrect |
1 ms |
644 KB |
Wrong Answer [3] |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |