This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define lld long long int | |
using namespace std; | |
lld gcd(lld a, lld b, lld &x, lld &y) { | |
if(!b) { | |
x = 1; y = 0; | |
return a; | |
} else { | |
lld d = gcd(b, a % b, x, y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define lld long long int | |
using namespace std; | |
const int MAXN = 2000002; | |
const int LOGN = 31; | |
int skip[MAXN][LOGN]; | |
int d(pair < int, int > a, pair < int, int > b) { | |
return b.second - a.first + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
const int MAXN = 10002; | |
struct ura { | |
int a, b, c; | |
}; | |
ura edges[MAXN]; | |
struct node { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0) | |
#define MAXN 300002 | |
using namespace std; | |
struct ura { | |
map < int, int > S; | |
int suma; | |
void insert(int x, int v) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0) | |
#define lld long long int | |
#define llf long double | |
using namespace std; | |
const int MAXN = 100002; | |
int c; | |
lld res[3]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0) | |
#define lld long long int | |
#define llf long double | |
using namespace std; | |
const int MAXN = 100002; | |
int n; | |
int padre[MAXN]; | |
int color[MAXN]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0) | |
#define lld long long int | |
using namespace std; | |
const int MAXN = 100002; | |
struct bit { | |
lld tree[MAXN * 2]; | |
void update(int pos, int v) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0) | |
#define MAXN 300 | |
using namespace std; | |
int n, m; | |
vector < int > pertenece[MAXN]; | |
int pared[MAXN][MAXN]; | |
int matriz[MAXN][MAXN]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#include <bits/stdc++.h> | |
#include <iostream> | |
#include <stack> | |
#include <vector> | |
#include <queue> | |
#include <math.h> | |
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0) | |
#define MAXN 2000002 | |
#define lld long long int | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0) | |
#define MAXN 50002 | |
#define lld long long int | |
using namespace std; | |
int n, k; | |
lld D; | |
pair < int, int > arr[MAXN]; |