Submission #1308391

#TimeUsernameProblemLanguageResultExecution timeMemory
1308391qntlsCoins (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 c){
    int ans = 0;
    for (int i = 0; i < 64; i++){
         if(b[i]==1) ans = ans ^ i;
    }
    int Xor = ans ^ c;
    b[Xor] ^= 1;
    return b;
}

int find_coin(int[] b){
    int ans = 0;
    for (int i = 0; i < 64; i++){
        if (b[i]==1) ans = ans ^ i;
    }
    return ans;
}

Compilation message (stderr)

coins.cpp:16:21: error: expected ',' or '...' before 'b'
   16 | int find_coin(int[] b){
      |                     ^
coins.cpp: In function 'int find_coin(int*)':
coins.cpp:19:13: error: 'b' was not declared in this scope
   19 |         if (b[i]==1) ans = ans ^ i;
      |             ^
grader.cpp: In function 'void shuffle(std::vector<int>&)':
grader.cpp:88:23: warning: 'void std::random_shuffle(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
   88 |         random_shuffle(v.begin(), v.end());
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61,
                 from grader.cpp:5:
/usr/include/c++/13/bits/stl_algo.h:4581:5: note: declared here
 4581 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~