Submission #42272

#TimeUsernameProblemLanguageResultExecution timeMemory
42272ljk0411jgcmp (balkan11_cmp)C++14
10 / 100
3088 ms94784 KiB
#include "cmp.h" void remember(int n) { int num = n, temp = 0; for (int i = 0; i < 12; i++) { if ((num & (1 << i)) != 0) { if (i > 5) { temp |= (1 << i); } bit_set(i + 1); } } temp++; bit_set(temp + 5000); } int compare(int b) { int temp = 0; for (int i = 11; i >= 6; i--) { if ((b & (1 << i)) != 0) { temp |= (1 << i); } } temp++; if (bit_get(temp + 5000) == 1) { for (int i = 6; i >= 1; i--) { if (bit_get(i) == 1) { if ((b & (1 << (i - 1))) == 0) { return -1; } } else { if ((b & (1 << (i - 1))) != 0) { return 1; } } } } else { for (int i = 12; i >= 7; i--) { if (bit_get(i) == 1) { if ((b & (1 << (i - 1))) == 0) { return -1; } } else { if ((b & (1 << (i - 1))) != 0) { return 1; } } } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...