제출 #1141797

#제출 시각아이디문제언어결과실행 시간메모리
1141797mohyaycmp (balkan11_cmp)C++20
19 / 100
993 ms82628 KiB
#include "cmp.h" #include <bits/stdc++.h> using namespace std; #define endl '\n' using ll = long long; #define pb push_back #define pF first #define pS second #define SP <<' '<< void remember(int a) { unsigned int n = a; if (popcount(n) <= 6) { ll j = 2048; ll i = 12; while (i > 0) { if (n >= j) { n -= j; bit_set(i); } j/=2; i--; } } else { bit_set(100); ll j = 2048; ll i = 12; while (i > 0) { if (n >= j) { n -= j; } else bit_set(i); j/=2; i--; } } } int compare(int b) { ll n = b; ll neg = bit_get(100); ll cmp1 = 1; if (neg == 0) { ll j = 2048; ll i = 12; while (i > 0) { ll x = bit_get(i); if (n >= j) { n -= j; if (x == 0) {cmp1 = 0; break;} } else if (x == 1) {cmp1 = 2; break;} j /= 2; i--; } } else { ll j = 2048; ll i = 12; while (i > 0) { ll x = bit_get(i); if (n >= j) { n -= j; if (x == 1) {cmp1 = 0; break;} } else if (x == 0) {cmp1 = 2; break;} j /= 2; i--; } } if (cmp1 == 2) return -1; if (cmp1 == 1) return 0; if (cmp1 == 0) return 1; }

컴파일 시 표준 에러 (stderr) 메시지

cmp.cpp: In function 'int compare(int)':
cmp.cpp:74:1: warning: control reaches end of non-void function [-Wreturn-type]
   74 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...