(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #122861

#TimeUsernameProblemLanguageResultExecution timeMemory
122861tjd229Coins (IOI17_coins)C++14
100 / 100
14 ms1580 KiB
#include "coins.h" std::vector<int> coin_flips(std::vector<int> b, int c) { for (int i = 0; i < b.size(); ++i) if (b[i]) c ^= i; return { c }; } int find_coin(std::vector<int> b) { int c = 0; for (int i = 0; i < b.size(); ++i) if (b[i]) c ^= i; return c; }

Compilation message (stderr)

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:4:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < b.size(); ++i) if (b[i]) c ^= i;
                  ~~^~~~~~~~~~
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:10:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < b.size(); ++i) if (b[i]) c ^= 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...