Codeforces Round #429 (Div. 1), problem: (E) In a Trap Solution In Java

By | 2017-08-21T13:22:15+00:00 August 21st, 2017|Categories: Java, Programming|Tags: , , , , , |

import java.io.*; import java.util.*; public class E { int[] a; static final int LOG = 8; static final int BLOCK = 1 << LOG; static final int LOW_MASK = BLOCK - 1; int[] head; int[] next; int[] to; int[] par; int[] depth; void dfs(int [...]

Codeforces Round #429 (Div. 1), problem: (D) Destiny Solution In C/C++

By | 2017-08-21T13:20:34+00:00 August 21st, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , |

#include <bits/stdc++.h> using namespace std; const int maxN = 3e5+10, base = 1e9+7; int N, Q, ans, valmid, A[maxN]; bool cmp(int x) { return x <= valmid; } struct wavelet_tree { int low, high; wavelet_tree *L, *R; vector <int> tmp; wavelet_tree(int *u, int *v, [...]