Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2), problem: (C) Fountains Solution In C/C++

By |2017-07-24T13:24:46+00:00July 24th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , , |

#include <iostream> #include <algorithm> #include <vector> using namespace std; int n, c, d; int bit[2][100100]; void insertBIT (int id, int a, int x) { for (int i=a; i<=100100; i+=i&(-i)) bit[id][i]=max(x, bit[id][i]); } int queryBIT (int id, int a) { int res=0; for (int i=a; [...]