| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1333362 | QuocSensei | Coins (IOI17_coins) | C++20 | 6 ms | 764 KiB |
#include <bits/stdc++.h>
#define ll long long
#define el cout << endl
#define BIT(n) (1ll << (n))
#define bit(mask, i) (((mask) >> (i)) & 1)
using namespace std;
const int maxn = 8;
namespace SUBTASK_1
{
namespace personA
{
vector<int> coin_flips(vector<int> b, int c)
{
vector<int> A;
if (c != b[0])
A.push_back(0);
else
A.push_back(63);
return A;
}
}
namespace personB
{
int find_coin(vector<int> b)
{
return b[0];
}
}
}
namespace SUBTASK_2
{
const int val[] = {0, 2, 1, 2, 1, 1, 2, 0};
namespace personA
{
vector<int> coin_flips(vector<int> b, int c)
{
int x = 0;
for (int i = 0; i < 3; i++)
x += b[i] * BIT(2 - i);
if (val[x] == c)
return {63};
for (int i = 0; i < maxn; i++)
if (__builtin_popcount(x ^ i) == 1 && val[i] == c)
{
// cout << "TRANS: " << (x ^ i), el;
return {2 - __lg(x ^ i)};
}
return {};
}
}
namespace personB
{
int find_coin(vector<int> b)
{
int x = 0;
for (int i = 0; i < 3; i++)
x += b[i] * BIT(2 - i);
return val[x];
}
}
}
namespace SUBTASK_3
{
namespace personA
{
vector<int> coin_flips(vector<int> b, int c)
{
vector<int> A;
for (int i = 0; i < maxn * maxn; i++)
if ((i != c && b[i]) || (i == c && !b[i]))
A.push_back(i);
if (A.empty())
{
A.push_back(c);
A.push_back(c);
}
return A;
}
}
namespace personB
{
int find_coin(vector<int> b)
{
for (int i = 0; i < maxn * maxn; i++)
if (b[i])
return i;
return -1;
}
}
}
namespace SUBTASK_4
{
namespace personA
{
vector<int> coin_flips(vector<int> b, int c)
{
vector<int> A;
for (int i = 0; i < 6; i++)
if (b[i] ^ bit(c, 5 - i))
A.push_back(i);
if (A.empty())
{
A.push_back(63);
A.push_back(63);
}
return A;
}
}
namespace personB
{
int find_coin(vector<int> b)
{
int ans = 0;
for (int i = 0; i < 6; i++)
ans += b[i] * BIT(5 - i);
return ans;
}
}
}
namespace SUBTASK_AC
{
namespace personA
{
vector<int> coin_flips(vector<int> b, int c)
{
int x = 0;
for (int i = 0; i < maxn * maxn; i++)
if (b[i])
x ^= i;
return {c ^ x};
}
}
namespace personB
{
int find_coin(vector<int> b)
{
int ans = 0;
for (int i = 0; i < maxn * maxn; i++)
if (b[i])
ans ^= i;
return ans;
}
}
}
vector<int> coin_flips(vector<int> b, int c)
{
return SUBTASK_AC::personA::coin_flips(b, c);
}
int find_coin(vector<int> b)
{
return SUBTASK_AC::personB::find_coin(b);
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
