Submission #927584

#TimeUsernameProblemLanguageResultExecution timeMemory
927584mohammedMonemcmp (balkan11_cmp)C++14
0 / 100
1158 ms106832 KiB
#include "cmp.h" #include <bits/stdc++.h> using namespace std; void remember(int n) { bitset<12> bsn = n; for (int i = 0; i < bsn.size(); ++i) { if (bsn[i]) { bit_set(i + 1); } } } int compare(int b) { bitset<12> bsb = b; for (int i = bsb.size() - 1; i >= 0; --i) { int get = bit_get(i + 1); if (bsb[i] > get) { return 1; } else if (bsb[i] < get) { return -1; } } return 0; }

Compilation message (stderr)

cmp.cpp: In function 'void remember(int)':
cmp.cpp:8:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     for (int i = 0; i < bsn.size(); ++i) {
      |                     ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...