Submission #332967

#TimeUsernameProblemLanguageResultExecution timeMemory
332967saarang123Coins (IOI17_coins)C++14
25 / 100
12 ms2096 KiB
#include "coins.h" #include <iostream> #include <vector> #include <string> using namespace std; vector<int> coin_flips(vector<int> b, int c) { vector<int> flip; if(b[0] == b[2]) { if(b[1] == b[0]) flip.push_back(c); else { if(c != 1) { if(c == 0) flip.push_back(2); else flip.push_back(0); } } } else { if(b[0] == b[1]) { if(c != 2) { if(c == 1) flip.push_back(0); else flip.push_back(1); } } else { if(c != 0) { if(c == 2) flip.push_back(1); else flip.push_back(2); } } } if(flip.empty()) flip.push_back(63); return flip; } int find_coin(vector<int> b) { vector<int> a[2]; for(int i = 0; i < 3; i++) a[b[i]].push_back(i); if(a[0].size() == 1) return a[0].back(); return a[1].back(); }
#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...