# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
381040 | 2021-03-24T10:10:08 Z | wp1270 | 비교 (balkan11_cmp) | C++14 | 1965 ms | 82668 KB |
#include "cmp.h" void remember(int n) { int first = n / 64; int second = n % 64; bit_set(first / 10 + 1); bit_set(first % 10 + 8); bit_set(second / 10 + 19); bit_set(second % 10 + 26); } int compare(int b) { int first_b = b / 64; int second_b = b % 64; int m_f = first_b / 10; if (bit_get(m_f + 1)) { int k_f = first_b % 10; if (bit_get(k_f + 8)) { int m_s = second_b / 10; if (bit_get(m_s + 19)) { int k_s = second_b % 10; if (bit_get(k_s + 26)) { return 0; } else if (k_s >= 5) { for (int i = k_s + 1; i <= 9; i++) { if (bit_get(i + 26)) return -1; } return 1; } else if (k_s < 5) { for (int i = k_s - 1; i >= 0; i--) { if (bit_get(i + 26)) return 1; } return -1; } } else if (m_s >= 4) { for (int i = m_s + 1; i <= 6; i++) { if (bit_get(i + 19)) return -1; } return 1; } else if (m_s < 4) { for (int i = m_s - 1; i >= 0; i--) { if (bit_get(i + 19)) return 1; } return -1; } } else if (k_f >= 5) { for (int i = k_f + 1; i <= 9; i++) { if (bit_get(i + 8)) return -1; } return 1; } else if (k_f < 5) { for (int i = k_f - 1; i >= 0; i--) { if (bit_get(i + 8)) return 1; } return -1; } } else if (m_f >= 4) { for (int i = m_f + 1; i <= 6; i++) { if (bit_get(i + 1)) return -1; } return 1; } else if (m_f < 4) { for (int i = m_f - 1; i >= 0; i--) { if (bit_get(i + 1)) return 1; } return -1; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 1965 ms | 82668 KB | Output is partially correct - maxAccess = 12, score = 82 |