Submission #57718

#TimeUsernameProblemLanguageResultExecution timeMemory
57718SpeedOfMagiccmp (balkan11_cmp)C++17
10 / 100
3169 ms82500 KiB
#include "cmp.h" #include <bits/stdc++.h> using namespace std; void remember(int a) { int oneAmount = 0; for (int i = 0; i < 12; i++) if (a & (1 << i)) oneAmount++; if (oneAmount > 6) { bit_set(13); a = -a; } for (int i = 0; i < 12; i++) if ((1 << i) & a) bit_set(i + 1); } int compare(int b) { int d = bit_get(13); int a = 0; int mul = 1; if (d) { a = 1 << 12; mul = -1; } for (int i = 0; i < 12; i++) { int p = bit_get(i + 1); a += (1 << i) * p * mul; } if (a > b) return -1; else if (a < b) return 1; else return 0; if ((a < b && !d) || (a > b && d)) return 1; else return -1; } //‭111101000010‬ //‭110101011111‬
#Verdict Execution timeMemoryGrader output
Fetching results...