#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 |
Incorrect |
19 ms |
2464 KB |
Unexpected end of file - int64 expected |
2 |
Incorrect |
19 ms |
2520 KB |
Unexpected end of file - int64 expected |
3 |
Incorrect |
19 ms |
2324 KB |
Unexpected end of file - int64 expected |
4 |
Incorrect |
24 ms |
2504 KB |
Unexpected end of file - int64 expected |
5 |
Incorrect |
21 ms |
2452 KB |
Unexpected end of file - int64 expected |
6 |
Incorrect |
20 ms |
2472 KB |
Unexpected end of file - int64 expected |
7 |
Incorrect |
20 ms |
2536 KB |
Unexpected end of file - int64 expected |
8 |
Incorrect |
20 ms |
2440 KB |
Unexpected end of file - int64 expected |
9 |
Incorrect |
19 ms |
2460 KB |
Unexpected end of file - int64 expected |
10 |
Incorrect |
19 ms |
2440 KB |
Unexpected end of file - int64 expected |
11 |
Incorrect |
26 ms |
2464 KB |
Unexpected end of file - int64 expected |
12 |
Incorrect |
19 ms |
2460 KB |
Unexpected end of file - int64 expected |
13 |
Incorrect |
19 ms |
2372 KB |
Unexpected end of file - int64 expected |
14 |
Incorrect |
21 ms |
2508 KB |
Unexpected end of file - int64 expected |
15 |
Incorrect |
22 ms |
2436 KB |
Unexpected end of file - int64 expected |
16 |
Incorrect |
21 ms |
2456 KB |
Unexpected end of file - int64 expected |
17 |
Incorrect |
19 ms |
2512 KB |
Unexpected end of file - int64 expected |
18 |
Incorrect |
19 ms |
2536 KB |
Unexpected end of file - int64 expected |
19 |
Incorrect |
26 ms |
2516 KB |
Unexpected end of file - int64 expected |
20 |
Incorrect |
21 ms |
2436 KB |
Unexpected end of file - int64 expected |
21 |
Incorrect |
19 ms |
2504 KB |
Unexpected end of file - int64 expected |
22 |
Incorrect |
19 ms |
2432 KB |
Unexpected end of file - int64 expected |
23 |
Incorrect |
19 ms |
2432 KB |
Unexpected end of file - int64 expected |
24 |
Incorrect |
18 ms |
2484 KB |
Unexpected end of file - int64 expected |
25 |
Incorrect |
22 ms |
2516 KB |
Unexpected end of file - int64 expected |
26 |
Incorrect |
19 ms |
2440 KB |
Unexpected end of file - int64 expected |
27 |
Incorrect |
19 ms |
2476 KB |
Unexpected end of file - int64 expected |
28 |
Incorrect |
19 ms |
2408 KB |
Unexpected end of file - int64 expected |
29 |
Incorrect |
27 ms |
2440 KB |
Unexpected end of file - int64 expected |
30 |
Incorrect |
21 ms |
2440 KB |
Unexpected end of file - int64 expected |
31 |
Incorrect |
18 ms |
2460 KB |
Unexpected end of file - int64 expected |
32 |
Incorrect |
20 ms |
2432 KB |
Unexpected end of file - int64 expected |
33 |
Incorrect |
20 ms |
2420 KB |
Unexpected end of file - int64 expected |
34 |
Incorrect |
18 ms |
2464 KB |
Unexpected end of file - int64 expected |
35 |
Incorrect |
21 ms |
2500 KB |
Unexpected end of file - int64 expected |
36 |
Incorrect |
19 ms |
2468 KB |
Unexpected end of file - int64 expected |
37 |
Incorrect |
20 ms |
2408 KB |
Unexpected end of file - int64 expected |
38 |
Incorrect |
20 ms |
2460 KB |
Unexpected end of file - int64 expected |
39 |
Incorrect |
27 ms |
2396 KB |
Unexpected end of file - int64 expected |
40 |
Incorrect |
21 ms |
2668 KB |
Unexpected end of file - int64 expected |