Submission #331111

#TimeUsernameProblemLanguageResultExecution timeMemory
331111PetyCoins (IOI17_coins)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "coins.h" using namespace std; vector<int> coin_flips (vector<int> b, int c) { vector<int>flep; int sum = 0; for (int i = 0; i < 64; i++) if (b[i]) sum ^= i; flip.push_back(sum ^ c); } int find_coin (vector<int> b) { long long sum = 0; for (int i = 0; i < b.size(); i++) if (b[i]) sum ^= i; return sum; }

Compilation message (stderr)

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:12:3: error: 'flip' was not declared in this scope; did you mean 'flep'?
   12 |   flip.push_back(sum ^ c);
      |   ^~~~
      |   flep
coins.cpp:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:17:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |   for (int i = 0; i < b.size(); i++)
      |                   ~~^~~~~~~~~~