Submission #1006172

#TimeUsernameProblemLanguageResultExecution timeMemory
1006172Abdullah_AlodaibiCoins (IOI17_coins)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; using ll = long long; vector<int> coin_flips(vector<int> b, int c){ int x=0; for(int i=0;i<b.size();i++){ x^=b[i]*i; x%=b.size(); } b[x^c]=(b[x^c]+1)%2; return b; } int find_coin(vector<int> b){ int x=0; for(int i=0;i<b.size();i++){ x^=b[i]*i; x%=b.size(); } return x; } int main(){ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); ll t; cin>>t; while(t--){ vector<int> b; int c; cin>>c; for(int i=0;i<64;i++){ char x; cin>>x; b.push_back(int(x)-48); } cout<<find_coin(coin_flips(b,c))<<"\n"; } }

Compilation message (stderr)

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:6:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |     for(int i=0;i<b.size();i++){
      |                 ~^~~~~~~~~
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:15:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     for(int i=0;i<b.size();i++){
      |                 ~^~~~~~~~~
/usr/bin/ld: /tmp/cc0rVS6f.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccPFyVJc.o:coins.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status