# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1167610 | InvMOD | Arranging Shoes (IOI19_shoes) | C++20 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
//#define name "InvMOD"
#ifndef name
#include "shoes.h"
#endif // name
using namespace std;
#define sz(v) (int)(v).size()
using ll = int64_t;
// 2i : left shoe, 2i + 1: right shoe
// x < 0 -> left shoe, x > 0 -> right shoe
struct BIT{
vector<int> bit;
BIT(int n = 0): bit(n + 1) {}
void update(int p, int val){
for(; p < sz(bit); p += (p & (-p))){
bit[p] += val;
}
return;
}
int get(int p){
if(p < 0) return 0;
int res = 0;