#include <bits/stdc++.h>
#include "Anna.h"
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
typedef pair<int, int> pii;
using ll = long long;
namespace {
}
int Declare() {
return 2000;
}
pair<vector<int>, vector<int>> Anna(ll A) {
int mul = (A - 1) / (2500000);
A %= 2500000;
if (A == 0) A = 2500000;
vector<int> v, w;
for (int i = 0; true; i += 2) {
if (A - (i + 1) <= 0) {
A--;
FOR(j, 0, A) v.push_back(1);
FOR(j, A, i) v.push_back(0);
break;
}
A -= (i + 1);
}
FOR(i, 0, v.size() / 2) {
w.push_back(v.back());
v.pop_back();
}
v.insert(v.begin(), 1);
v.insert(v.begin(), 0);
v.push_back(1);
v.push_back(0);
w.insert(w.begin(), 1);
w.insert(w.begin(), 0);
w.push_back(1);
w.push_back(0);
if (mul & 2) {
swap(v[0], v[1]);
swap(w[0], w[1]);
}
if (mul & 1) {
swap(v[v.size() - 1], v[v.size() - 2]);
swap(w[w.size() - 1], w[w.size() - 2]);
}
return mp(v, w);
}
#include <bits/stdc++.h>
#include "Bruno.h"
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
typedef pair<int, int> pii;
using ll = long long;
namespace {
}
ll Bruno(std::vector<int> u) {
ll ans = 2500000 * (u.front() * 2 + u.back());
ans += ((u.size() - 8) / 2) * ((u.size() - 8) / 2);
int x = count(u.begin(), u.end(), 1);
x -= 4;
ans += x + 1;
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
780 KB |
Output is correct |
2 |
Correct |
15 ms |
1120 KB |
Output is correct |
3 |
Correct |
20 ms |
1472 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
780 KB |
Output is correct |
2 |
Correct |
15 ms |
1120 KB |
Output is correct |
3 |
Correct |
20 ms |
1472 KB |
Output is correct |
4 |
Correct |
333 ms |
16152 KB |
Output is correct |
5 |
Correct |
332 ms |
16264 KB |
Output is correct |
6 |
Correct |
326 ms |
16592 KB |
Output is correct |
7 |
Correct |
335 ms |
16384 KB |
Output is correct |
8 |
Correct |
340 ms |
16312 KB |
Output is correct |
9 |
Correct |
419 ms |
20236 KB |
Output is correct |
10 |
Correct |
450 ms |
20300 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
780 KB |
Output is correct |
2 |
Correct |
15 ms |
1120 KB |
Output is correct |
3 |
Correct |
20 ms |
1472 KB |
Output is correct |
4 |
Correct |
333 ms |
16152 KB |
Output is correct |
5 |
Correct |
332 ms |
16264 KB |
Output is correct |
6 |
Correct |
326 ms |
16592 KB |
Output is correct |
7 |
Correct |
335 ms |
16384 KB |
Output is correct |
8 |
Correct |
340 ms |
16312 KB |
Output is correct |
9 |
Correct |
419 ms |
20236 KB |
Output is correct |
10 |
Correct |
450 ms |
20300 KB |
Output is correct |
11 |
Correct |
374 ms |
17772 KB |
Output is correct |
12 |
Correct |
362 ms |
17788 KB |
Output is correct |
13 |
Correct |
365 ms |
18032 KB |
Output is correct |
14 |
Correct |
373 ms |
17676 KB |
Output is correct |
15 |
Correct |
382 ms |
17400 KB |
Output is correct |
16 |
Correct |
516 ms |
26076 KB |
Output is correct |
17 |
Correct |
523 ms |
26372 KB |
Output is correct |
18 |
Correct |
276 ms |
13676 KB |
Output is correct |
19 |
Correct |
287 ms |
14448 KB |
Output is correct |
20 |
Correct |
271 ms |
13620 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
780 KB |
Output is correct |
2 |
Correct |
15 ms |
1120 KB |
Output is correct |
3 |
Correct |
20 ms |
1472 KB |
Output is correct |
4 |
Correct |
333 ms |
16152 KB |
Output is correct |
5 |
Correct |
332 ms |
16264 KB |
Output is correct |
6 |
Correct |
326 ms |
16592 KB |
Output is correct |
7 |
Correct |
335 ms |
16384 KB |
Output is correct |
8 |
Correct |
340 ms |
16312 KB |
Output is correct |
9 |
Correct |
419 ms |
20236 KB |
Output is correct |
10 |
Correct |
450 ms |
20300 KB |
Output is correct |
11 |
Correct |
374 ms |
17772 KB |
Output is correct |
12 |
Correct |
362 ms |
17788 KB |
Output is correct |
13 |
Correct |
365 ms |
18032 KB |
Output is correct |
14 |
Correct |
373 ms |
17676 KB |
Output is correct |
15 |
Correct |
382 ms |
17400 KB |
Output is correct |
16 |
Correct |
516 ms |
26076 KB |
Output is correct |
17 |
Correct |
523 ms |
26372 KB |
Output is correct |
18 |
Correct |
276 ms |
13676 KB |
Output is correct |
19 |
Correct |
287 ms |
14448 KB |
Output is correct |
20 |
Correct |
271 ms |
13620 KB |
Output is correct |
21 |
Incorrect |
364 ms |
18096 KB |
Output isn't correct |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
780 KB |
Output is correct |
2 |
Correct |
15 ms |
1120 KB |
Output is correct |
3 |
Correct |
20 ms |
1472 KB |
Output is correct |
4 |
Correct |
333 ms |
16152 KB |
Output is correct |
5 |
Correct |
332 ms |
16264 KB |
Output is correct |
6 |
Correct |
326 ms |
16592 KB |
Output is correct |
7 |
Correct |
335 ms |
16384 KB |
Output is correct |
8 |
Correct |
340 ms |
16312 KB |
Output is correct |
9 |
Correct |
419 ms |
20236 KB |
Output is correct |
10 |
Correct |
450 ms |
20300 KB |
Output is correct |
11 |
Correct |
374 ms |
17772 KB |
Output is correct |
12 |
Correct |
362 ms |
17788 KB |
Output is correct |
13 |
Correct |
365 ms |
18032 KB |
Output is correct |
14 |
Correct |
373 ms |
17676 KB |
Output is correct |
15 |
Correct |
382 ms |
17400 KB |
Output is correct |
16 |
Correct |
516 ms |
26076 KB |
Output is correct |
17 |
Correct |
523 ms |
26372 KB |
Output is correct |
18 |
Correct |
276 ms |
13676 KB |
Output is correct |
19 |
Correct |
287 ms |
14448 KB |
Output is correct |
20 |
Correct |
271 ms |
13620 KB |
Output is correct |
21 |
Incorrect |
364 ms |
18096 KB |
Output isn't correct |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
359 ms |
17668 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |