Submission #42117

#TimeUsernameProblemLanguageResultExecution timeMemory
42117didwlvvcmp (balkan11_cmp)C++14
100 / 100
1948 ms94456 KiB
#include "cmp.h" void remember(int n) { int x = n / 480; bit_set(1000 + x); n %= 480; x = n / 48; bit_set(2000 + x); n %= 48; x = n / 6; bit_set(3000 + x); n %= 6; x = n; bit_set(4000 + x); } int compare(int b) { if (!bit_get(1000 + b / 480)) { int x = b / 480; if (x <= 5) { for (int i = 0; i < x; i++)if (bit_get(1000 + i))return 1; return -1; } else { for (int i = 11; i > x; i--)if (bit_get(1000 + i))return -1; return 1; } } else { b %= 480; if (!bit_get(2000 + b / 48)) { int x = b / 48; if (x <= 4) { for (int i = 0; i < x; i++)if (bit_get(2000 + i))return 1; return -1; } else { for (int i = 9; i > x; i--)if (bit_get(2000 + i))return -1; return 1; } } else { b %= 48; if (!bit_get(3000 + b / 6)) { int x = b / 6; if (x <= 3) { for (int i = 0; i < x; i++)if (bit_get(3000 + i))return 1; return -1; } else { for (int i = 7; i > x; i--)if (bit_get(3000 + i))return -1; return 1; } } else{ b %= 6; if (!bit_get(4000 + b)) { int x = b; if (x <= 2) { for (int i = 0; i < x; i++)if (bit_get(4000 + i))return 1; return -1; } else { for (int i = 5; i > x; i--)if (bit_get(4000 + i))return -1; return 1; } } else { return 0; } } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...