# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
908917 | 12345678 | Coins (IOI17_coins) | C++17 | 9 ms | 1696 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>
using namespace std;
int mp[10];
std::vector<int> coin_flips(std::vector<int> b, int c) {
mp[0]=mp[2]=mp[5]=mp[7]=0;
mp[4]=mp[3]=1;
mp[1]=mp[6]=2;
int vl=0;
for (int i=0; i<3; i++) if (b[i]) vl|=(1<<i);
if (mp[vl]==c) return vector<int> {4};
for (int i=0; i<3; i++) if (mp[vl^(1<<i)]==c) return vector<int> {i};
}
int find_coin(std::vector<int> b) {
mp[0]=mp[2]=mp[5]=mp[7]=0;
mp[4]=mp[3]=1;
mp[1]=mp[6]=2;
int vl=0;
for (int i=0; i<3; i++) if (b[i]) vl|=(1<<i);
return mp[vl];
}
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... |