Submission #991064

#TimeUsernameProblemLanguageResultExecution timeMemory
991064messiuuuuuCoins (IOI17_coins)C++14
100 / 100
8 ms1948 KiB
#include <bits/stdc++.h> #include "coins.h" using namespace std; std::vector<int> coin_flips(vector<int> b, int c) { int ans = 0; for (int i = 0; i < b.size(); i++) if (b[i]) ans ^= i; vector<int> res = {ans ^ c}; return res; } int find_coin(vector<int> b) { int ans = 0; for (int i = 0; i < b.size(); i++) { if (b[i]) ans ^= i; } return ans; }

Compilation message (stderr)

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:8:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     for (int i = 0; i < b.size(); i++)
      |                     ~~^~~~~~~~~~
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:17:23: 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++)
      |                     ~~^~~~~~~~~~
#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...