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 <bits/stdc++.h>
#include "coin.h"
using namespace std;
vector<int> coin_flips(vector<int> a, int x)
{
int ini = 0, fim = 63, mid;
for(int k = 0; k < 8; k++)
{
mid = (ini + fim)/2;
if( x >= mid)
{
a[mid] = 1;
ini = mid;
}
else
{
a[mid] = 0;
fim = mid;
}
}
return a;
}
int find_coin(vector<int> a)
{
int ini = 0, fim = 63, mid;
for(int cnt = 0; cnt < 100; cnt ++)
{
mid = (ini + fim)/2;
if(a[mid]) ini = mid;
else fim = mid;
}
return mid;
}
# | 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... |