Skip to content

Instantly share code, notes, and snippets.

@MatheusLealv
MatheusLealv / Binaria.cpp
Last active December 13, 2017 23:47
Binária - Seletiva IOI 2015
#include <bits/stdc++.h>
#define int long long
#define N 110
#define mod 1000000007
using namespace std;
int n, k, h, ch[N][N], dp[N][N], fat[N];
struct node
{
@MatheusLealv
MatheusLealv / Crayfish.cpp
Created August 31, 2017 15:11
Crayfish Scrivener - IOI '12
// Crayfish Scrivener - IOI 2012
// Complexidade O(N*logN)
// Matheus Leal V :D
#include <bits/stdc++.h>
#define N 1000050
#define log 22
using namespace std;
int n, id;
@MatheusLealv
MatheusLealv / Quality.cpp
Created August 30, 2017 19:47
Quality of living - IOI ' 10
// Quality of living - IOI 2010
// Complexidade O (N*M*log(N*M))
// Matheus Leal V
#include <bits/stdc++.h>
#define f first
#define s second
#define N 3005
using namespace std;
typedef pair<int, int> pii;
@MatheusLealv
MatheusLealv / typeprinter.cpp
Created August 25, 2017 00:25
Type Printer - IOI ' 08
// Type Printer - IOI ' 08
// Complexidade O ( N*|S| )
// Matheus Leal V
#include <bits/stdc++.h>
using namespace std;
struct node
{
// Ovelhas - Seletiva IOI 2016
// Complexidade O (N*Log(N))
// Matheus Leal V
#include <bits/stdc++.h>
#define N 100050
#define f first
#define s second
using namespace std;
typedef long long ll;
@MatheusLealv
MatheusLealv / bairro.cpp
Last active December 13, 2017 23:49
Bairro - Seletiva IOI 2016
// Bairro - Seletiva IOI 2016
// Complexidade O (N*log²(N))
#include <bits/stdc++.h>
#define inf 2000000000
#define N 200050
#define f first
#define s second
using namespace std;
typedef pair<int, int> pii;
@MatheusLealv
MatheusLealv / Prize.cpp
Created August 2, 2017 15:32
The Big Prize
//The Big Prize - IOI 2017 Day 2 Problem A (90 Pontos)
//Matheus Leal V
#include <bits/stdc++.h>
#define N 200050
#define d min(i + 500, n)
#include "prize.h"
using namespace std;
int n, v[N];
@MatheusLealv
MatheusLealv / Cave.cpp
Created July 20, 2017 05:36
Cave - IOI '13
// Cave - IOI 2013
// Complexidade O(N²*log(N))
// Matheus Leal V
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
int N, idx[5050], tip[5050];
@MatheusLealv
MatheusLealv / dreaming.cpp
Created July 19, 2017 19:45
Dreaming - IOI ' 13
// Dreaming - IOI 2013
// Complexidade O(N*log(N))
// Matheus Leal V
#include <bits/stdc++.h>
#define int long long
#define N 100050
#define f first
#define s second
using namespace std;
#include <bits/stdc++.h>
#define N 2000010
#define inf 2000000000
#define f first
#define s second
using namespace std;
typedef pair<int, int> pii;
pii best;