Submission #1235405

#TimeUsernameProblemLanguageResultExecution timeMemory
1235405candi_ositosCoins (IOI17_coins)C++20
Compilation error
0 ms0 KiB
#include "coins.h"
#include <bits/stdc++.h>
using namespace std;
vector <int> coin_flips(vector <int> b, int a){
    int xd=0;
    vector <bool> s(6), r(6), c(6);
    for(int i=0; i<6; ++i){
        r[i]=a%2;
        a/=2;
    }
    int aux=1;
    for(int i=0; i<6; ++i){
        s[i]=0;
        aux*=2;
        for(int j=0; j<64; ++j){
            if(j%aux>aux/2-1){
                s[i]=1-s[i];
            }
        }
    }
    for(int i=0; i<6; ++i){
        c[i]=s[i];
    }
    for(int i=0; i<6; ++i){
        if(r[i]){
            c[i]=1-c[i];
        }
    }
    int aux=1;
    for(int i=0; i<6; ++i){
        if(c[i]){
            xd+=aux;
        }
        aux*=2;
    }
    vector <int> ret;
    ret.push_back(xd);
    return ret;
}
int find_coin(vector <int> b){
    int xd=0;
    int aux=1;
    for(int i=0; i<6; ++i){
        if(b[i]){
            xd+=aux;
        }
        aux*=2;
    }
    return xd;
}

Compilation message (stderr)

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:29:9: error: redeclaration of 'int aux'
   29 |     int aux=1;
      |         ^~~
coins.cpp:11:9: note: 'int aux' previously declared here
   11 |     int aux=1;
      |         ^~~