#include "Annalib.h"
#include<vector>
#include<string>
#include<iostream>
using namespace std;
const int N = 150;
const int M = 60;
const long long XOR = 0x341231365237683ll;
const int P[150] = {4, 28, 118, 69, 138, 85, 30, 65, 63, 35, 132, 146, 56, 10, 95, 74, 64, 70, 125, 128, 124, 39, 120,
111, 80, 29, 16, 60, 53, 100, 26, 136, 106, 143, 137, 76, 123, 45, 37, 33, 130, 3, 2, 59, 99, 142,
145, 97, 68, 83, 127, 58, 38, 1, 62, 114, 43, 101, 22, 141, 103, 131, 110, 18, 61, 49, 115, 0, 5,
135, 15, 13, 86, 34, 105, 72, 9, 7, 126, 88, 77, 41, 17, 51, 133, 50, 81, 112, 116, 67, 96, 24, 148,
117, 84, 102, 144, 19, 92, 121, 25, 8, 75, 52, 93, 73, 149, 6, 20, 48, 104, 66, 12, 57, 91, 147, 90,
82, 98, 27, 21, 139, 129, 108, 44, 31, 89, 134, 14, 87, 32, 71, 55, 122, 23, 79, 36, 109, 78, 113,
119, 47, 107, 54, 42, 40, 46, 11, 140, 94};
void Anna(int n, long long x, int k, int p[]) {
x = x ^ XOR;
vector<int> res(N);
string s;
for (int i = 0; i < 60; i++) {
s += to_string((x >> i) & 1);
}
vector<bool> z(N);
for (int i = 0; i < k; i++) z[p[i]] = true;
bool st = false;
int j = 0;
for (int i = 0; i < N; i++) {
if (z[i] || j == (int) s.size()) {
st = !st;
continue;
}
if ((s[j] == '0' && !st) || (s[j] == '1' && st)) {
res[i] = 1;
j++;
} else {
st = !st;
}
}
// cout << s << " " << x << "\n";
for (int i = 0; i < N; i++) {
// Set(i, res[P[i]]);
Set(i, res[i]);
}
}
#include "Brunolib.h"
#include<vector>
#include<string>
#include<iostream>
using namespace std;
const int N = 150;
const int M = 60;
const long long XOR = 0x341231365237683ll;
const int P[150] = {4, 28, 118, 69, 138, 85, 30, 65, 63, 35, 132, 146, 56, 10, 95, 74, 64, 70, 125, 128, 124, 39, 120,
111, 80, 29, 16, 60, 53, 100, 26, 136, 106, 143, 137, 76, 123, 45, 37, 33, 130, 3, 2, 59, 99, 142,
145, 97, 68, 83, 127, 58, 38, 1, 62, 114, 43, 101, 22, 141, 103, 131, 110, 18, 61, 49, 115, 0, 5,
135, 15, 13, 86, 34, 105, 72, 9, 7, 126, 88, 77, 41, 17, 51, 133, 50, 81, 112, 116, 67, 96, 24, 148,
117, 84, 102, 144, 19, 92, 121, 25, 8, 75, 52, 93, 73, 149, 6, 20, 48, 104, 66, 12, 57, 91, 147, 90,
82, 98, 27, 21, 139, 129, 108, 44, 31, 89, 134, 14, 87, 32, 71, 55, 122, 23, 79, 36, 109, 78, 113,
119, 47, 107, 54, 42, 40, 46, 11, 140, 94};
long long Bruno(int n, int A[]) {
vector<int> a(N);
for (int i = 0; i < N; i++) {
// a[P[i]] = A[i];
a[i] = A[i];
}
long long x = 0;
bool st = false;
int j = 0;
string s;
for (int i = 0; i < N; i++) {
if (a[i]) {
s += to_string(st);
if (st)
x = x | (1ll << j);
j++;
if (j == M) break;
} else {
st = !st;
}
}
// cout << s << " " << x << "\n";
x = x ^ XOR;
return x;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
39 ms |
2336 KB |
Output is partially correct - L* = 31 |
2 |
Partially correct |
33 ms |
2236 KB |
Output is partially correct - L* = 28 |
3 |
Partially correct |
34 ms |
2352 KB |
Output is partially correct - L* = 31 |
4 |
Partially correct |
40 ms |
2212 KB |
Output is partially correct - L* = 27 |
5 |
Partially correct |
46 ms |
2280 KB |
Output is partially correct - L* = 31 |
6 |
Partially correct |
34 ms |
2356 KB |
Output is partially correct - L* = 31 |
7 |
Partially correct |
34 ms |
2252 KB |
Output is partially correct - L* = 29 |
8 |
Partially correct |
36 ms |
2168 KB |
Output is partially correct - L* = 30 |
9 |
Partially correct |
50 ms |
2264 KB |
Output is partially correct - L* = 29 |
10 |
Partially correct |
45 ms |
2236 KB |
Output is partially correct - L* = 27 |
11 |
Partially correct |
32 ms |
2248 KB |
Output is partially correct - L* = 31 |
12 |
Partially correct |
34 ms |
2268 KB |
Output is partially correct - L* = 34 |
13 |
Partially correct |
34 ms |
2268 KB |
Output is partially correct - L* = 31 |
14 |
Partially correct |
36 ms |
2292 KB |
Output is partially correct - L* = 30 |
15 |
Partially correct |
39 ms |
2328 KB |
Output is partially correct - L* = 36 |
16 |
Partially correct |
40 ms |
2412 KB |
Output is partially correct - L* = 31 |
17 |
Partially correct |
38 ms |
2304 KB |
Output is partially correct - L* = 31 |
18 |
Partially correct |
32 ms |
2324 KB |
Output is partially correct - L* = 32 |
19 |
Partially correct |
33 ms |
2324 KB |
Output is partially correct - L* = 28 |
20 |
Partially correct |
34 ms |
2352 KB |
Output is partially correct - L* = 29 |
21 |
Partially correct |
32 ms |
2380 KB |
Output is partially correct - L* = 30 |
22 |
Partially correct |
34 ms |
2336 KB |
Output is partially correct - L* = 29 |
23 |
Partially correct |
36 ms |
2260 KB |
Output is partially correct - L* = 32 |
24 |
Partially correct |
33 ms |
2328 KB |
Output is partially correct - L* = 32 |
25 |
Partially correct |
32 ms |
2384 KB |
Output is partially correct - L* = 31 |
26 |
Partially correct |
32 ms |
2252 KB |
Output is partially correct - L* = 29 |
27 |
Partially correct |
33 ms |
2252 KB |
Output is partially correct - L* = 29 |
28 |
Partially correct |
33 ms |
2252 KB |
Output is partially correct - L* = 30 |
29 |
Partially correct |
34 ms |
2348 KB |
Output is partially correct - L* = 33 |
30 |
Partially correct |
45 ms |
2224 KB |
Output is partially correct - L* = 30 |
31 |
Partially correct |
37 ms |
2228 KB |
Output is partially correct - L* = 32 |
32 |
Partially correct |
34 ms |
2296 KB |
Output is partially correct - L* = 30 |
33 |
Partially correct |
33 ms |
2256 KB |
Output is partially correct - L* = 32 |
34 |
Partially correct |
34 ms |
2320 KB |
Output is partially correct - L* = 35 |
35 |
Partially correct |
33 ms |
2260 KB |
Output is partially correct - L* = 30 |
36 |
Partially correct |
44 ms |
2272 KB |
Output is partially correct - L* = 34 |
37 |
Partially correct |
35 ms |
2296 KB |
Output is partially correct - L* = 31 |
38 |
Partially correct |
33 ms |
2220 KB |
Output is partially correct - L* = 32 |
39 |
Partially correct |
32 ms |
2292 KB |
Output is partially correct - L* = 30 |
40 |
Partially correct |
33 ms |
2316 KB |
Output is partially correct - L* = 30 |