# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1014225 | Mousa_Aboubaker | 마술쇼 (APIO24_show) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
vector<pair<int,int>> Alice(){
// add your code here
// change below into your code
long long x = setN(5000);
vector<pair<int, int>> p;
vector<int> bits;
for(int i = 0; i < 60; i++)
{
if(x & (1ll << i))
{
bits.push_back(i+2);
}
}
for(int i = 1; i < 5000; i++)
{
p.push_back({i, i+1});
}
int x = 0;
for(auto &el: p)
{
el.second = bits[x++];
x %= bits.size();
}
random_shuffle(p.begin()+1, p.end());
return p;
}
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
long long Bob(vector<pair<int, int>> V)
{
// add your code here
set<int> bits;
for (auto el : V)
{
bits.insert(el.first - 2);
}
long long x = 0;
for (int el : bits)
{
x |= (1ll << el);
}
return x; // change this into your code
}