이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "coins.h"
#include <bits/stdc++.h>
using namespace std; using ii = pair<int,int>; using ll = long long; using vi = vector<int>;
#define rep(i,a,b) for (auto i = (a); i <= (b); ++i)
#define per(i,a,b) for (auto i = (b); i >= (a); --i)
#define all(x) begin(x), end(x)
#define siz(x) int((x).size())
#define Mup(x,y) x = max(x,y)
#define mup(x,y) x = min(x,y)
#define fi first
#define se second
#define dbg(...) fprintf(stderr,__VA_ARGS__)
vi coin_flips(vi b, int c) {
vi flips;
switch ((b[0]^b[1])+(b[1]^b[2])) {
case 0:
if (c == 0) flips.push_back(3);
if (c == 1) flips.push_back(0);
if (c == 2) flips.push_back(1);
break;
case 1:
if (c == 0) flips.push_back((b[0]^b[1]) ? 0 : 2);
if (c == 1) flips.push_back(3);
if (c == 2) flips.push_back((b[0]^b[1]) ? 2 : 0);
break;
case 2:
if (c == 0) flips.push_back(1);
if (c == 1) flips.push_back(2);
if (c == 2) flips.push_back(3);
break;
}
return flips;
}
int find_coin(vi b) {
return __builtin_popcount((b[0]^b[1])+(b[1]^b[2]));
}
# | 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... |