제출 #666055

#제출 시각아이디문제언어결과실행 시간메모리
666055MilosMilutinovic비교 (balkan11_cmp)C++14
0 / 100
0 ms208 KiB
#include "cmp.h"
#include <bits/stdc++.h>

using namespace std;

void remember(int n) {
  for (int i = 0; i < 12; i++) {
    if (n >> i & 1) {
      bit_set(i);
    }
  }
}

int compare(int b) {
  for (int i = 11; i >= 0; i--) {
    int is = bit_get(i);
    if ((b >> i & 1) == is) {
      continue;
    }
    if ((b >> i & 1) < is) {
      return -1;
    } else {
      return 1;
    }
  }
  return 0;
}

#Verdict Execution timeMemoryGrader output
Fetching results...