| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 399103 | iulia13 | Xoractive (IZhO19_xoractive) | C++14 | 6 ms | 456 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include "interactive.h"
using namespace std;
map <int, int> mp;/*
vector <int> a;
int n;
int ask(int position) {
return a[position - 1];
}
vector<int> get_pairwise_xor(vector<int> positions) {
vector<int> pairwise_xor;
for (int i = 0; i < positions.size(); i++) {
for (int j = 0; j < positions.size(); j++) {
pairwise_xor.push_back(a[positions[i] - 1] ^ a[positions[j] - 1]);
}
}
sort(pairwise_xor.begin(), pairwise_xor.end());
return pairwise_xor;
}*/
vector <int> guess(int n)
{
vector <int> v;
v.resize(n);
v[0] = ask(1);
for (int i = 0; (1 << i) <= n; i++)
{
vector <int> poz;
vector <int> poz1;
vector <int> poz2;
int cnt = 0, n1, n2;
for (int j = 2; j <= n; j++)
if (j & (1 << i))
poz.push_back(j), cnt++;
poz1 = get_pairwise_xor(poz);
poz1.resize(cnt * cnt);
n1 = cnt * cnt;
poz.push_back(1);
poz2 = get_pairwise_xor(poz);
n2 = (cnt + 1) * (cnt + 1);
poz2.resize(n2);
map <int, int> mpp;
for (auto x : poz2)
mpp[x]++;
for (auto x : poz1)
mpp[x]--;
for (auto x : mpp)
if (x.second)
mp[x.first ^v[0]] |= (1 << i);
}
for (auto x : mp)
v[x.second - 1] = x.first;
return v;
}/*
int main()
{
cin >> n;
for (int i = 1; i <= n; i++) {
int x;
cin >> x;
a.push_back(x);
}
a.resize(n);
vector<int> participant_solution = guess(n);
participant_solution.resize(n);
for (int i = 0; i < n; i++)
cout << participant_solution[i] << " ";
return 0;
}*/
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
