Submission #594050

#TimeUsernameProblemLanguageResultExecution timeMemory
594050shezittCoins (IOI17_coins)C++14
0 / 100
9 ms1540 KiB
#include "coins.h" #include <bits/stdc++.h> using namespace std; // subtask 4 vector<int> coin_flips(vector<int> b, int c) { vector<int> flips; string s; int cc = c; while(cc){ s += (char)(cc%2+'0'); cc /= 2; } for(int i=0; i<6; ++i){ if(s[i] == '1' && !b[i]){ flips.push_back(i); } else if(s[i] == '0' && b[i]){ flips.push_back(i); } } if(int(flips.size()) == 0){ flips.push_back(63); } return flips; } int find_coin(vector<int> b) { int ans = 0; for(int i=0; i<6; ++i){ if(b[i]){ ans += 1<<i; } } return ans; }
#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...