Submission #81581

#TimeUsernameProblemLanguageResultExecution timeMemory
81581imeimi2000cmp (balkan11_cmp)C++17
100 / 100
2065 ms83704 KiB
#include "cmp.h" const int radix[4] = { 6, 8, 10, 12 }; const int st[4] = { 100, 200, 300, 400 }; void remember(int a) { for (int i = 0; i < 4; ++i) { bit_set(a % radix[i] + st[i]); a /= radix[i]; } } int compare(int b) { int x[4]; for (int i = 0; i < 4; ++i) { x[i] = b % radix[i]; b /= radix[i]; } for (int i = 4; i--; ) { if (bit_get(x[i] + st[i])) continue; if ((x[i] << 1) < radix[i]) { for (int j = 0; j < x[i]; ++j) if (bit_get(j + st[i])) return 1; return -1; } else { for (int j = radix[i]; --j > x[i]; ) if (bit_get(j + st[i])) return -1; return 1; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...