답안 #1084790

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1084790 2024-09-07T02:17:57 Z Math4Life2020 마술쇼 (APIO24_show) C++17
100 / 100
4 ms 1064 KB
#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 = 80;
const ll N = 5000;

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;
}
#include <bits/stdc++.h>
using namespace std;
#include "Bob.h"
using ll = long long; using pii = pair<ll,ll>;
const ll SEED = 82014312209183;
const ll E = 80;
const ll N = 5000;

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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 816 KB Correct.
2 Correct 3 ms 824 KB Correct.
3 Correct 2 ms 812 KB Correct.
4 Correct 2 ms 812 KB Correct.
5 Correct 2 ms 1064 KB Correct.
6 Correct 3 ms 824 KB Correct.
7 Correct 2 ms 812 KB Correct.
8 Correct 3 ms 812 KB Correct.
9 Correct 2 ms 812 KB Correct.
10 Correct 2 ms 808 KB Correct.
11 Correct 2 ms 816 KB Correct.
12 Correct 3 ms 812 KB Correct.
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 816 KB Correct.
2 Correct 3 ms 824 KB Correct.
3 Correct 2 ms 812 KB Correct.
4 Correct 2 ms 812 KB Correct.
5 Correct 2 ms 1064 KB Correct.
6 Correct 3 ms 824 KB Correct.
7 Correct 2 ms 812 KB Correct.
8 Correct 3 ms 812 KB Correct.
9 Correct 2 ms 812 KB Correct.
10 Correct 2 ms 808 KB Correct.
11 Correct 2 ms 816 KB Correct.
12 Correct 3 ms 812 KB Correct.
13 Correct 2 ms 824 KB Correct.
14 Correct 2 ms 816 KB Correct.
15 Correct 3 ms 816 KB Correct.
16 Correct 3 ms 816 KB Correct.
17 Correct 2 ms 820 KB Correct.
18 Correct 3 ms 816 KB Correct.
19 Correct 3 ms 816 KB Correct.
20 Correct 3 ms 816 KB Correct.
21 Correct 3 ms 812 KB Correct.
22 Correct 2 ms 824 KB Correct.
23 Correct 3 ms 816 KB Correct.
24 Correct 2 ms 828 KB Correct.
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 816 KB Correct.
2 Correct 3 ms 824 KB Correct.
3 Correct 2 ms 812 KB Correct.
4 Correct 2 ms 812 KB Correct.
5 Correct 2 ms 1064 KB Correct.
6 Correct 3 ms 824 KB Correct.
7 Correct 2 ms 812 KB Correct.
8 Correct 3 ms 812 KB Correct.
9 Correct 2 ms 812 KB Correct.
10 Correct 2 ms 808 KB Correct.
11 Correct 2 ms 816 KB Correct.
12 Correct 3 ms 812 KB Correct.
13 Correct 2 ms 824 KB Correct.
14 Correct 2 ms 816 KB Correct.
15 Correct 3 ms 816 KB Correct.
16 Correct 3 ms 816 KB Correct.
17 Correct 2 ms 820 KB Correct.
18 Correct 3 ms 816 KB Correct.
19 Correct 3 ms 816 KB Correct.
20 Correct 3 ms 816 KB Correct.
21 Correct 3 ms 812 KB Correct.
22 Correct 2 ms 824 KB Correct.
23 Correct 3 ms 816 KB Correct.
24 Correct 2 ms 828 KB Correct.
25 Correct 2 ms 820 KB Correct.
26 Correct 2 ms 836 KB Correct.
27 Correct 4 ms 820 KB Correct.
28 Correct 4 ms 824 KB Correct.
29 Correct 2 ms 820 KB Correct.
30 Correct 2 ms 816 KB Correct.
31 Correct 3 ms 820 KB Correct.
32 Correct 3 ms 820 KB Correct.
33 Correct 3 ms 816 KB Correct.
34 Correct 3 ms 812 KB Correct.
35 Correct 3 ms 816 KB Correct.
36 Correct 3 ms 816 KB Correct.
37 Correct 2 ms 820 KB Correct.
38 Correct 3 ms 820 KB Correct.
39 Correct 3 ms 820 KB Correct.
40 Correct 3 ms 744 KB Correct.
41 Correct 3 ms 792 KB Correct.
42 Correct 4 ms 816 KB Correct.
43 Correct 3 ms 820 KB Correct.
44 Correct 2 ms 816 KB Correct.