Skip to content

Instantly share code, notes, and snippets.

View jairsaidds's full-sized avatar
🏠
Working from home

Jair Said Hernández Reyes jairsaidds

🏠
Working from home
View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
vector<int>FirstNumber;
vector<int>SecondNumber;
vector<int>ResultNumber;
struct node {
node *next;
int value;
node() {
@jairsaidds
jairsaidds / cpp.cpp
Created October 11, 2016 22:32
UVa 11402 Solution.
// Jair Said Hernandez Reyes.
// Segment Tree + Lazy Propagation.
// In General we have f(x) = a where a is the answer for every sub segment on tree, in this case f(x) = st[x].
// We also need a G(x) = R where G is a function that takes any n E Nodes and indicates what to do next, in this particular case G = lazy.
// G actually works as a flag.
// notice that we need to create function that handles transitions
#include<bits/stdc++.h>
using namespace std;
#define ll long long
@jairsaidds
jairsaidds / uva1112.cpp
Created January 14, 2016 17:23
UVa 1112 Solution.
// Simple Dijkstra Seen from Destination to all vertex v in the set of V.
// Jair Said Hernández Reyes.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<ll>
#define ii pair<ll, ll>
#define vii vector<ii>
#define oo 100000000000
ll T, N, M, E, D, TLE, W, X, Y;
@jairsaidds
jairsaidds / 929 UVa.
Created December 24, 2015 04:26
929 UVa Solution
// Jair Said Hernández Reyes.
// Dijkstra over an implicit Graph
#include<bits/stdc++.h>
using namespace std;
#define INF (1 << 30)
#define ll long long
#define ii pair<int, int>
#define iii pair<int, ii>
#define pb push_back
#define MAXN 1050
//Jair Said Hernandez Reyes
// BFS Multi-Sourcing.
#include<bits/stdc++.h>
using namespace std;
#define INF (1 << 30)
#define ll long long
#define pb push_back
#define MAXN 1050
ll CC, N , M;
pair<int, int> joe;
// Hernandez Reyes Jair Said.
// BFS on implicit graph where the coordinates are on R3 (3D).
#include<bits/stdc++.h>
using namespace std;
#define INF (1 << 30)
#define ll long long
#define pb push_back
#define MAXN 400
ll L, R, C;
char mat[MAXN][MAXN][MAXN];
//Hernández Reyes Jair Said UVa 429 Sol.
// Graph Theory - Simple BFS w/Map.
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define INF (int)(1<<30)
#define MAXN 10000
using namespace std;
map<string, int>mapa;
vector<int>A[MAXN];
// Jair Said Hernández Reyes. Uva 534 Solution.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MAXN 500000
ll root[MAXN];
ll N, many;
double X, Y;
struct edge{
ll u;
// Rare Order UVa - Jair Said Hernández Reyes.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define salto "\n"
#define pb push_back
#define mp make_pair
string in, a, b, c, d;
vector<ll>G[10000];
vector<ll>T;
@jairsaidds
jairsaidds / ans.cpp
Created September 20, 2015 03:53
Montesco Vs Capuleto UVa Solution
// Jair Said Hernández Reyes.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define salto "\n"
#define pb push_back
#define mp make_pair
ll N, E, x , y, many, feasible;
ll color[10000], in[10000];
vector<ll>G[10000];