# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
1048453 |
2024-08-08T07:42:25 Z |
Tob |
마술쇼 (APIO24_show) |
C++17 |
|
1 ms |
1076 KB |
#include <bits/stdc++.h>
#include "Alice.h"
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
const int B = 80, bit = 60, seed = 12345, C = 20;
vector <pii> Alice() {
int w = B*bit;
ll x = setN(w+C);
vector <pii> res;
mt19937 rng(seed);
vector <int> p;
for (int i = 0; i < w; i++) p.pb(i/B);
shuffle(all(p), rng);
vector <int> q(w+C);
for (int i = 0; i < w+C; i++) q[i] = i;
shuffle(all(q), rng);
for (int i = 1; i < C; i++) res.pb({q[w+i-1]+1, q[w+i]+1});
mt19937 rng2(x);
auto val = [&](int x) {
uniform_int_distribution <int> rnd(0, x-1);
return rnd(rng2);
};
for (int i = 0; i < w; i++) {
if (x & (1LL << p[i])) res.pb({q[i]+1, q[i+val(C/2-1)+2]+1});
else res.pb({q[i]+1, q[i+C/2+val(C/2)+1]+1});
}
return res;
}
#include <bits/stdc++.h>
#include "Bob.h"
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
const int B = 80, bit = 60, seed = 12345, C = 20;
ll Bob(vector <pii> v) {
int w = B*bit;
mt19937 rng(seed);
vector <int> p;
for (int i = 0; i < w; i++) p.pb(i/B);
shuffle(all(p), rng);
vector <int> q(w+C), r(w+C);
for (int i = 0; i < w+C; i++) q[i] = i;
shuffle(all(q), rng);
for (int i = 0; i < w+C; i++) r[q[i]] = i;
ll res = 0;
for (auto x : v) {
if (r[x.S-1] - r[x.F-1] <= C/2 && r[x.F-1] < w) res |= (1LL << p[r[x.F-1]]);
}
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1076 KB |
Incorrect answer. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1076 KB |
Incorrect answer. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1076 KB |
Incorrect answer. |
2 |
Halted |
0 ms |
0 KB |
- |