Submission #908917

#TimeUsernameProblemLanguageResultExecution timeMemory
90891712345678Coins (IOI17_coins)C++17
25 / 100
9 ms1696 KiB
#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)

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...