8462번 - 배열의 힘
코드에서 구조체부분의 operator에서
bool operator < (const query &O){
int x = high / sz;
int y = O.high / sz;
return x == y ? low < O.low : x < y;
}
를
int x = low / sz;
int y = O.low / sz;
댓글을 작성하려면 로그인해야 합니다.
khx1712 4년 전
코드에서 구조체부분의 operator에서
bool operator < (const query &O){
int x = high / sz;
int y = O.high / sz;
return x == y ? low < O.low : x < y;
}
를
bool operator < (const query &O){
int x = low / sz;
int y = O.low / sz;
return x == y ? low < O.low : x < y;
}
으로 바꾸면 왜 시간초과가 날까요 구글링해보니 low로 시간초과가 나지 않은 코드들도 많던데무슨 문제일까요 ㅠㅠ