Submission #648060

#TimeUsernameProblemLanguageResultExecution timeMemory
648060ojoConmigoCoins (IOI17_coins)C++17
0 / 100
9 ms1224 KiB
#include "coins.h" //#include <bits/stdc++.h> //using namespace std; std::vector<int> coin_flips(std::vector<int> b, int c) { /* Subtask 1 y 2 std::vector<int> flips(1); flips[0] = 63; if(b[0] == b[1] && b[1] == b[2]){ flips[0] = c; }else{ for(int i=0; i<3; i++){ if(c == i)continue; if(b[i] == b[c]){ flips[0] = i; } } } */ std::vector<int> flips; for(int i=0; i<6; i++){ if((c & (1<<i)) != b[i]){ flips.push_back(i); } } if(flips.empty()){ flips.push_back(63); } return flips; } int find_coin(std::vector<int> b) { /* Subtask 1 y 2 if (b[0] == b[1]) { return 2; }else if(b[0] == b[2]){ return 1; }else return 0; */ int sol = 0; for(int i=0; i<6; i++){ if(b[i]){ sol += (1<<i); } } return sol; } /* int main(){ int t; cin >> t; while(t--){ int c; cin >> c; vector<int> b(64); for(int i=0; i<64; i++){ cin >> b[i]; } vector<int> flips = coin_flips(b,c); for(int x : flips){ b[x] = 1 - b[x]; } for(int i=0; i<8; i++){ for(int j=0; j<8; j++){ cout << b[i*8+j]; } cout << endl; } cout << find_coin(b) << endl; } } */
#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...