Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <string.h>
#define LIMIT 1000000000
#define CHUNK_COUNT 35000
#define CHUNK_NUMS 15 * CHUNK_COUNT
// max size of buffer for CHUNK_NUMS numbers (except 1B)
#define CHUNK_SIZE (119 * CHUNK_COUNT)
void print();
#include <iostream>
#include <cstdio>
using namespace std;
const int MAXN = 100010;
const int MAXLEV = 17;
// Array and sparse table.
// Actually, array can be stored in 0's row of array