(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #648079

#TimeUsernameProblemLanguageResultExecution timeMemory
648079ojoConmigoCoins (IOI17_coins)C++17
100 / 100
11 ms1552 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; } } } */ /*Subtast 3 y 4 std::vector<int> flips; for(int i=0; i<6; i++){ if(((c&(1<<i)) > 0) != b[i]){ //cout << (c&(1<<i)) << " " << b[i] << endl; //cout << c << " " << (1<<i) << " " << b[i] << endl; flips.push_back(i); } } if(flips.empty()){ flips.push_back(63); } */ std::vector<int> flips(1); int temp = 0; for(int i=0; i<64; i++){ if(b[i]){ temp ^= i; } } flips[0] = temp^c; 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; */ /*Subtast 3 y 4 int sol = 0; for(int i=0; i<6; i++){ if(b[i]){ sol |= (1<<i); //cout << i << " " << (1<<i) << " " << sol << endl; } } */ int sol = 0; for(int i=0; i<64; i++){ if(b[i]){ sol ^= 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; } } */

Compilation message (stderr)

coins.cpp:86:9: warning: "/*" within comment [-Wcomment]
   86 |         /*
      |
#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...