Submission #793580

#TimeUsernameProblemLanguageResultExecution timeMemory
793580khshgcmp (balkan11_cmp)C++14
0 / 100
798 ms95952 KiB
#include "cmp.h" #include<bits/stdc++.h> using namespace std; const int arr[] = {1, 1 + 4, 1 + 4 + 4 * 4, 1 + 4 + 4 * 4 + 4 * 4 * 4, 1 + 4 + 4 * 4 + 4 * 4 * 4 + 4 * 4 * 4 * 4, 1 + 4 + 4 * 4 + 4 * 4 * 4 + 4 * 4 * 4 * 4 + 4 * 4 * 4 * 4 * 4}; void remember(int a) { for(int i = 0; i < 6; ++i) { bit_set(arr[i] + (a >> (10 - 2 * i))); } } int compare(int b) { int tl = 0, tr = 5; while(tl < tr) { int tm = (tl + tr) / 2; if(bit_get(arr[tm] + (b >> (10 - 2 * tm)))) { tl = tm + 1; } else { tr = tm; } } if(tl == 5) return 0; ++tl; b >>= (10 - 2 * tl); b &= 3; if(b == 3) return 1; if(b == 0) return -1; if(b == 1) bit_get(0) ? 1 : -1; return bit_get(2) ? -1 : 1; }

Compilation message (stderr)

cmp.cpp: In function 'int compare(int)':
cmp.cpp:29:32: warning: second operand of conditional expression has no effect [-Wunused-value]
   29 |  if(b == 1) bit_get(0) ? 1 : -1;
      |                                ^
cmp.cpp:29:32: warning: third operand of conditional expression has no effect [-Wunused-value]
#Verdict Execution timeMemoryGrader output
Fetching results...