Submission #1084791

# Submission time Handle Problem Language Result Execution time Memory
1084791 2024-09-07T02:20:31 Z Math4Life2020 Magic Show (APIO24_show) C++17
0 / 100
1 ms 780 KB
//finally AC!!!!!! :partying_face:
//ok time to run tests
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
using ll = long long; using pii = pair<ll,ll>;
const ll SEED = 82014312209183;
const ll E = 61;
const ll N = 1000;

ll l2(ll x) {
	return (31-__builtin_clz(x));
}

vector<pair<int,int>> Alice() {
	ll X = setN((int)N); //X<=10^18<2^60
	mt19937 gen(SEED);
	vector<pair<int,int>> ans; 
	for (ll x=1;x<N;x++) {
		ll y=0;
		ll lx = l2(x);
		for (ll i=0;i<lx;i++) {
			ll bv = gen()%E;
			if ((X>>bv)&1) {
				y += (1LL<<i);
			}
		}
		ans.push_back({y+1,x+1});
	}
	return ans;
}
//finally AC!!!!!! :partying_face:
//ok time to run tests
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
using ll = long long; using pii = pair<ll,ll>;
const ll SEED = 82014312209183;
const ll E = 61;
const ll N = 1000;

ll l2(ll x) {
	return (31-__builtin_clz(x));
}


ll Bob(vector<pair<int,int>> V) {
	mt19937 gen(SEED);
	ll ans = 0;
	ll read[N];
	for (ll i=0;i<N;i++) {
		read[i]=-1;
	}
	for (pii p0: V) {
		ll y = p0.first; ll x = p0.second;
		x--; y--;
		read[x]=y;
	}
	for (ll x=1;x<N;x++) {
		ll RD=read[x];
		ll lx = l2(x);
		for (ll i=0;i<lx;i++) {
			ll bv = gen()%E;
			if ((RD!=-1) && ((RD>>i)&1)) {
				ans |= (1LL<<bv)*((RD>>i)&1);
			}
		}
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 780 KB Correct.
2 Correct 1 ms 780 KB Correct.
3 Incorrect 1 ms 776 KB Incorrect answer.
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 780 KB Correct.
2 Correct 1 ms 780 KB Correct.
3 Incorrect 1 ms 776 KB Incorrect answer.
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 780 KB Correct.
2 Correct 1 ms 780 KB Correct.
3 Incorrect 1 ms 776 KB Incorrect answer.
4 Halted 0 ms 0 KB -