백준 2352 반도체 설계 혼내주기
lis. 개인적으로 이분 탐색보다 세그먼트 트리가 더 이해하기 쉬운 것 같다. 2개의 element를 정렬해서 갯수세는 세그먼트 트리 문제들이 재미있는듯. #include #define fastio ios::sync_with_stdio(0), cin.tie(0) using namespace std; using ll = long long; using pii = pair; #define all(v) v.begin(), v.end() int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const int N = 1 a; arr[i] = {a, i}; } } int query(int l, int r, int i = 1,..
혼내주기
2021. 7. 21. 12:08