답안 #927580

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
927580 2024-02-15T06:03:59 Z mohammedMonem 비교 (balkan11_cmp) C++14
0 / 100
611 ms 67976 KB
#include "cmp.h"
#include <bits/stdc++.h>

using namespace std;

void remember(int n) {
    bitset<12> bsn;
    for (int i = 0; i < bsn.size(); ++i) {
        if (bsn[i]) {
            bit_set(i + 1);
        }
    }
}

int compare(int b) {
    bitset<12> bsb;
    for (int i = 0; i < bsb.size(); ++i) {
        if (bsb[i] > bit_get(i + 1)) {
            return 1;
        } else if (bsb[i] < bit_get(i + 1)) {
            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) {
      |                     ~~^~~~~~~~~~~~
cmp.cpp: In function 'int compare(int)':
cmp.cpp:17:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for (int i = 0; i < bsb.size(); ++i) {
      |                     ~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 611 ms 67976 KB ZERO POINTS: For a=3040 and b=3318, correct answer is 1, got 0