Submission #1080228

#TimeUsernameProblemLanguageResultExecution timeMemory
1080228MihailoCoins (IOI17_coins)C++14
100 / 100
6 ms1940 KiB
#include <bits/stdc++.h> using namespace std; std::vector<int> coin_flips(std::vector<int> b, int c) { std::vector<int> flips; flips.push_back(c); for(int i=0; i<b.size(); i++) { if(b[i]) flips[0]^=i; } return flips; } int find_coin(std::vector<int> b) { int rez=0; for(int i=0; i<b.size(); i++) { if(b[i]) rez^=i; } return rez; }

Compilation message (stderr)

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