Created
August 24, 2018 21:23
-
-
Save IvanIsCoding/f4045192efcd00d49024cfed6bee5803 to your computer and use it in GitHub Desktop.
Practice Session of IOI 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Ivan Carvalho | |
| // Coins - IOI 2017 Practice | |
| // 1 coin flip | |
| #include "coins.h" | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| vector<int> coin_flips(vector<int> b, int c) { | |
| int meu_inteiro = 0; | |
| for(int i = 0;i<64;i++) if(b[i]) meu_inteiro ^= i; | |
| vector<int> ans; | |
| ans.push_back(c ^ meu_inteiro); | |
| return ans; | |
| } | |
| int find_coin(vector<int> b) { | |
| int meu_inteiro = 0; | |
| for(int i = 0;i<64;i++) if(b[i]) meu_inteiro ^= i; | |
| return meu_inteiro; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment