백준 10999 구간 합 구하기 2 혼내주기
lazy propagation 연습 문제. 기본 세그 트리에 lazy와 propagation을 추가하면 된다. 이름도 직관적이고 방법도 되게 간단한데, 이런 방법을 떠올렸다고 생각하니 대단할 뿐이다... 되게 재미있는 기법인듯. 백준에서는 lazy propagation이 '느리게 갱신되는'으로 번역되어있다. ㅋㅋㅋ #include #define fastio ios::sync_with_stdio(0), cin.tie(0) using namespace std; using ll = long long; const int N = 1 k; for(int i = 0; i > tree[i+N]; for(int i = N-1; i; --i) tree[i] = tree[i
혼내주기
2021. 7. 23. 10:52