Submission #57720

#TimeUsernameProblemLanguageResultExecution timeMemory
57720SpeedOfMagiccmp (balkan11_cmp)C++17
19 / 100
3140 ms82552 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 ^= (1 << 12) - 1; } 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; for (int i = 0; i < 12; i++) { int p = bit_get(i + 1); a += (1 << i) * p; } if (d) a ^= (1 << 12) - 1; 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...