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;
vector<int> coin_flips(vector<int> b, int c)
{
int s=0, t=0;
for (int i=0; i<64; i++)
s+=b[i], t+=i*b[i];
for (int i=0; i<64; i++)
if (((1-(s+1-b[i]*2)%4/2*2)*(t+(1-b[i]*2)*i)+6400)%64==c)
return vector<int>(1, i);
return vector<int>(0);
}
int find_coin(vector<int> b)
{
int s=0, t=0;
for (int i=0; i<64; i++)
s+=b[i], t+=i*b[i];
return ((1-s%4/2*2)*t+6400)%64;
}
# | 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... |