Submission #1045974

# Submission time Handle Problem Language Result Execution time Memory
1045974 2024-08-06T08:48:00 Z Tob Magic Show (APIO24_show) C++17
0 / 100
2 ms 1332 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;

vector <pii> Alice() {
	int w = B*bit;
	vector <int> p;
	for (int i = 0; i <= w; i++) p.pb(i);
	random_shuffle(all(p));
	ll x = setN(w+1);
	
	w = p[w];
	
	vector <pii> res;
	for (int i = 0; i < bit; i++) {
		res.pb({w+1, p[B*i]+1});
		if (x & (1LL << i)) for (int j = 1; j < B; j++) res.pb({p[B*i+j-1]+1, p[B*i+j]+1});
		else for (int j = 1; j < B; j++) res.pb({w+1, p[B*i+j]+1});
	}
	random_shuffle(all(res));
	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;

ll Bob(vector <pii> v) {
	int w = B*bit;
	vector <int> p;
	for (int i = 0; i <= w; i++) p.pb(i);
	random_shuffle(all(p));
	set <pii> s;
	for (auto& x : v) x.F--, x.S--;
	for (auto x : v) s.insert(x);
	ll res = 0;
	for (int i = 0; i < bit; i++) {
		for (int j = 1; j < B; j++) if (s.find({p[B*i+j-1], p[B*i+j]}) != s.end()) res |= (1LL << i);
	}
	return res;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1332 KB Correct.
2 Incorrect 2 ms 1076 KB Incorrect answer.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1332 KB Correct.
2 Incorrect 2 ms 1076 KB Incorrect answer.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1332 KB Correct.
2 Incorrect 2 ms 1076 KB Incorrect answer.
3 Halted 0 ms 0 KB -