Submission #927584

# Submission time Handle Problem Language Result Execution time Memory
927584 2024-02-15T06:24:46 Z mohammedMonem cmp (balkan11_cmp) C++14
0 / 100
1158 ms 106832 KB
#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

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 time Memory Grader output
1 Incorrect 1158 ms 106832 KB ZERO POINTS: more than 20 accesses in the worst case