Submission #503462

#TimeUsernameProblemLanguageResultExecution timeMemory
503462bang627cmp (balkan11_cmp)C++14
100 / 100
1210 ms82488 KiB
#include "cmp.h" #include <iostream> using namespace std; void remember(int a) { bit_set(1 + (int)a / (10 * 8 * 6)); a %= 10 * 8 * 6; bit_set(1+10 + (int)a / (8 * 6)); a %= 8 * 6; bit_set(1+10+ 10 + (int)a / 6); a %= 6; bit_set(1+10+ 10 +8+a); } int compare(int b) { int readed,val; readed =bit_get(1 + (int)b / (10 * 8 * 6)), val = (int)b / (10 * 8 * 6); //cout << endl; //cout << val << " "; if (readed == 0) { if (val <= 4) { for (int j = 0; j < val; j++) if (bit_get(1 + j) == 1) return 1; return -1; } else { for (int j = 8; j > val; j--) if (bit_get(1 + j) == 1) return -1; return 1; } } b %= 10 * 8 * 6; readed= bit_get(1+10 + (int)b / (8 * 6)), val = (int)b/(8*6); //cout << val << " "; if (readed == 0) { if (val <= 4) { for (int j = 0; j < val; j++) if (bit_get(1 + 10 + j) == 1) return 1; return -1; } else { for (int j = 9; j > val; j--) if (bit_get(1 + 10 + j) == 1) return -1; return 1; } } b %= 8 * 6; readed= bit_get(1+10+10+(int)b / 6), val = (int)b / 6; //cout << val << " "; if (readed == 0) { if (val <= 3) { for (int j = 0; j < val; j++) if (bit_get(1 + 10 + 10+j) == 1) return 1; return -1; } else { for (int j = 7; j > val; j--) if (bit_get(1 + 10 + 10 + j) == 1) { // cout << "hi"; return -1; } return 1; } } b %= 6; readed= bit_get(1+10+10+8+ b), val = b; //cout << val << " " << endl; if (readed == 0) { if (val <= 2) { for (int j = 0; j < val; j++) if (bit_get(1 + 10 + 10+8+ j) == 1) return 1; return -1; } else { for (int j = 5; j > val; j--) if (bit_get(1 + 10 + 10 + 8 + j) == 1) return -1; return 1; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...