Submission #503449

#TimeUsernameProblemLanguageResultExecution timeMemory
503449bang627cmp (balkan11_cmp)C++14
91 / 100
1273 ms82496 KiB
#include "cmp.h" #include <iostream> using namespace std; void remember(int a) { int cnt2 = 4; while (cnt2 > 0) { bit_set(1+ (cnt2 - 1) * 8 +a % 8); a >>= 3 , cnt2--; } } int compare(int b) { for (int i = 1; i <= 4; i++) { int i2 = 12-3 * i; int val = (b >> i2) % 8; int readed = bit_get(1 + (i - 1) * 8 + val); if (readed == 0) { if (val < 4) { for (int j = 0; j < val; j++) if (bit_get(1 + (i - 1) * 8 + j) == 1) return 1; return -1; } else { for (int j = 7; j > val; j--) if (bit_get(1 + (i - 1) * 8 + j) == 1) return -1; return 1; } } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...