# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
116708 | faustaadp | Coins (IOI17_coins) | C++17 | 13 ms | 1464 KiB |
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>
typedef long long ll;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
std::vector<int> coin_flips(std::vector<int> b, int c)
{
ll i;
std::vector<int> flips;
for(i=0;i<64;i++)
if((b[i]==1&&i!=c)||(i==c&&b[i]==0))
flips.pb(i);
//flips.clear();
if(flips.empty())
{
flips.clear();
for(i=0;i<64;i++)
flips.pb(i);
}
return flips;
}
int find_coin(std::vector<int> b) {
ll i,sat=0;
for(i=0;i<64;i++)
if(b[i]==1)
sat++;
if(sat==1)
{
for(i=0;i<64;i++)
if(b[i]==1)
return i;
}
else
{
for(i=0;i<64;i++)
if(b[i]==0)
return i;
}
}
Compilation message (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... |