//bs:flags:grader.cpp
#include "Anna.h"
#include "Bruno.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
namespace x = __gnu_pbds;
template <typename T>
using ordered_set = x::tree<T, x::null_type, less<T>, x::rb_tree_tag, x::tree_order_statistics_node_update>;
template <typename T>
using normal_queue = priority_queue<T, vector<T>, greater<>>;
#define all(x) begin(x), end(x)
#define sz(x) ((int) (x).size())
#define x first
#define y second
using ll = long long;
using ld = long double;
const ll MAGIC = 960389134456460687;
int Declare() {
return 530;
}
pair<vector<int>, vector<int>> Anna(ll n) {
n ^= MAGIC;
vector<int> x;
for (int i = 0; i < Declare() / 2; ++i) {
x.push_back(1);
x.push_back(0);
}
vector<int> y;
for (int i = 0; i < 60; ++i) {
y.push_back(1);
y.push_back(1);
y.push_back(1);
if (n >> i & 1) {
y.push_back(1);
y.push_back(1);
y.push_back(0);
y.push_back(0);
}
y.push_back(0);
y.push_back(0);
y.push_back(0);
}
while (sz(y) < Declare()) {
y.push_back(1);
y.push_back(0);
}
return {x, y};
}
ll Bruno(vector<int> a) {
int balance = 0, mx = 0;
ll ans = 0;
int i = 0;
for (int u : a) {
balance += (u == 0 ? -1 : 1);
if (balance < 2) {
if (mx >= 5) {
ans |= 1ll << i;
++i;
} else if (mx >= 3) {
++i;
}
mx = 0;
} else {
mx = max(mx, balance);
}
}
ans ^= MAGIC;
return ans;
}
//bs:flags:grader.cpp
#include "Anna.h"
#include "Bruno.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
namespace x = __gnu_pbds;
template <typename T>
using ordered_set = x::tree<T, x::null_type, less<T>, x::rb_tree_tag, x::tree_order_statistics_node_update>;
template <typename T>
using normal_queue = priority_queue<T, vector<T>, greater<>>;
#define all(x) begin(x), end(x)
#define sz(x) ((int) (x).size())
#define x first
#define y second
using ll = long long;
using ld = long double;
const ll MAGIC = 960389134456460687;
int Declare() {
return 530;
}
pair<vector<int>, vector<int>> Anna(ll n) {
n ^= MAGIC;
vector<int> x;
for (int i = 0; i < Declare() / 2; ++i) {
x.push_back(1);
x.push_back(0);
}
vector<int> y;
for (int i = 0; i < 60; ++i) {
y.push_back(1);
y.push_back(1);
y.push_back(1);
if (n >> i & 1) {
y.push_back(1);
y.push_back(1);
y.push_back(0);
y.push_back(0);
}
y.push_back(0);
y.push_back(0);
y.push_back(0);
}
while (sz(y) < Declare()) {
y.push_back(1);
y.push_back(0);
}
return {x, y};
}
ll Bruno(vector<int> a) {
int balance = 0, mx = 0;
ll ans = 0;
int i = 0;
for (int u : a) {
balance += (u == 0 ? -1 : 1);
if (balance < 2) {
if (mx >= 5) {
ans |= 1ll << i;
++i;
} else if (mx >= 3) {
++i;
}
mx = 0;
} else {
mx = max(mx, balance);
}
}
ans ^= MAGIC;
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
640 KB |
Output is correct |
2 |
Correct |
237 ms |
9020 KB |
Output is correct |
3 |
Correct |
211 ms |
8908 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
640 KB |
Output is correct |
2 |
Correct |
237 ms |
9020 KB |
Output is correct |
3 |
Correct |
211 ms |
8908 KB |
Output is correct |
4 |
Correct |
221 ms |
8964 KB |
Output is correct |
5 |
Correct |
220 ms |
9104 KB |
Output is correct |
6 |
Correct |
220 ms |
9028 KB |
Output is correct |
7 |
Correct |
220 ms |
9156 KB |
Output is correct |
8 |
Correct |
217 ms |
8936 KB |
Output is correct |
9 |
Correct |
217 ms |
9040 KB |
Output is correct |
10 |
Correct |
215 ms |
9064 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
640 KB |
Output is correct |
2 |
Correct |
237 ms |
9020 KB |
Output is correct |
3 |
Correct |
211 ms |
8908 KB |
Output is correct |
4 |
Correct |
221 ms |
8964 KB |
Output is correct |
5 |
Correct |
220 ms |
9104 KB |
Output is correct |
6 |
Correct |
220 ms |
9028 KB |
Output is correct |
7 |
Correct |
220 ms |
9156 KB |
Output is correct |
8 |
Correct |
217 ms |
8936 KB |
Output is correct |
9 |
Correct |
217 ms |
9040 KB |
Output is correct |
10 |
Correct |
215 ms |
9064 KB |
Output is correct |
11 |
Correct |
216 ms |
9056 KB |
Output is correct |
12 |
Correct |
214 ms |
9000 KB |
Output is correct |
13 |
Correct |
216 ms |
9048 KB |
Output is correct |
14 |
Correct |
216 ms |
9092 KB |
Output is correct |
15 |
Correct |
216 ms |
9064 KB |
Output is correct |
16 |
Correct |
210 ms |
8932 KB |
Output is correct |
17 |
Correct |
212 ms |
9140 KB |
Output is correct |
18 |
Correct |
210 ms |
9060 KB |
Output is correct |
19 |
Correct |
211 ms |
8992 KB |
Output is correct |
20 |
Correct |
211 ms |
9072 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
640 KB |
Output is correct |
2 |
Correct |
237 ms |
9020 KB |
Output is correct |
3 |
Correct |
211 ms |
8908 KB |
Output is correct |
4 |
Correct |
221 ms |
8964 KB |
Output is correct |
5 |
Correct |
220 ms |
9104 KB |
Output is correct |
6 |
Correct |
220 ms |
9028 KB |
Output is correct |
7 |
Correct |
220 ms |
9156 KB |
Output is correct |
8 |
Correct |
217 ms |
8936 KB |
Output is correct |
9 |
Correct |
217 ms |
9040 KB |
Output is correct |
10 |
Correct |
215 ms |
9064 KB |
Output is correct |
11 |
Correct |
216 ms |
9056 KB |
Output is correct |
12 |
Correct |
214 ms |
9000 KB |
Output is correct |
13 |
Correct |
216 ms |
9048 KB |
Output is correct |
14 |
Correct |
216 ms |
9092 KB |
Output is correct |
15 |
Correct |
216 ms |
9064 KB |
Output is correct |
16 |
Correct |
210 ms |
8932 KB |
Output is correct |
17 |
Correct |
212 ms |
9140 KB |
Output is correct |
18 |
Correct |
210 ms |
9060 KB |
Output is correct |
19 |
Correct |
211 ms |
8992 KB |
Output is correct |
20 |
Correct |
211 ms |
9072 KB |
Output is correct |
21 |
Correct |
217 ms |
9064 KB |
Output is correct |
22 |
Correct |
216 ms |
8992 KB |
Output is correct |
23 |
Correct |
219 ms |
9020 KB |
Output is correct |
24 |
Correct |
213 ms |
8888 KB |
Output is correct |
25 |
Correct |
215 ms |
9184 KB |
Output is correct |
26 |
Correct |
211 ms |
9028 KB |
Output is correct |
27 |
Correct |
211 ms |
8968 KB |
Output is correct |
28 |
Correct |
211 ms |
8968 KB |
Output is correct |
29 |
Correct |
213 ms |
9192 KB |
Output is correct |
30 |
Correct |
214 ms |
9172 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
640 KB |
Output is correct |
2 |
Correct |
237 ms |
9020 KB |
Output is correct |
3 |
Correct |
211 ms |
8908 KB |
Output is correct |
4 |
Correct |
221 ms |
8964 KB |
Output is correct |
5 |
Correct |
220 ms |
9104 KB |
Output is correct |
6 |
Correct |
220 ms |
9028 KB |
Output is correct |
7 |
Correct |
220 ms |
9156 KB |
Output is correct |
8 |
Correct |
217 ms |
8936 KB |
Output is correct |
9 |
Correct |
217 ms |
9040 KB |
Output is correct |
10 |
Correct |
215 ms |
9064 KB |
Output is correct |
11 |
Correct |
216 ms |
9056 KB |
Output is correct |
12 |
Correct |
214 ms |
9000 KB |
Output is correct |
13 |
Correct |
216 ms |
9048 KB |
Output is correct |
14 |
Correct |
216 ms |
9092 KB |
Output is correct |
15 |
Correct |
216 ms |
9064 KB |
Output is correct |
16 |
Correct |
210 ms |
8932 KB |
Output is correct |
17 |
Correct |
212 ms |
9140 KB |
Output is correct |
18 |
Correct |
210 ms |
9060 KB |
Output is correct |
19 |
Correct |
211 ms |
8992 KB |
Output is correct |
20 |
Correct |
211 ms |
9072 KB |
Output is correct |
21 |
Correct |
217 ms |
9064 KB |
Output is correct |
22 |
Correct |
216 ms |
8992 KB |
Output is correct |
23 |
Correct |
219 ms |
9020 KB |
Output is correct |
24 |
Correct |
213 ms |
8888 KB |
Output is correct |
25 |
Correct |
215 ms |
9184 KB |
Output is correct |
26 |
Correct |
211 ms |
9028 KB |
Output is correct |
27 |
Correct |
211 ms |
8968 KB |
Output is correct |
28 |
Correct |
211 ms |
8968 KB |
Output is correct |
29 |
Correct |
213 ms |
9192 KB |
Output is correct |
30 |
Correct |
214 ms |
9172 KB |
Output is correct |
31 |
Incorrect |
4 ms |
892 KB |
Wrong Answer [4] |
32 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
40 ms |
4216 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |