This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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) {
int sum=0;
rep(i,0,63) sum ^= b[i]*i;
rep(i,0,63) if (sum^i == c) return {i};
assert(0);
}
int find_coin(vi b) {
int sum=0;
rep(i,0,63) sum ^= b[i]*i;
return sum;
}
Compilation message (stderr)
coins.cpp: In function 'vi coin_flips(vi, int)':
coins.cpp:17:27: warning: suggest parentheses around comparison in operand of '^' [-Wparentheses]
17 | rep(i,0,63) if (sum^i == c) return {i};
| ~~^~~~
# | 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... |