Skip to content

Instantly share code, notes, and snippets.

View rogerioagjr's full-sized avatar

Rogério Júnior rogerioagjr

View GitHub Profile
@rogerioagjr
rogerioagjr / toca.cpp
Created June 10, 2017 19:57
Toca do Saci
#include <bits/stdc++.h>
using namespace std;
#define MAXN 1010
#define F first
#define S second
typedef pair<int,int> ii;
@rogerioagjr
rogerioagjr / cofre.cpp
Last active April 17, 2018 18:59
Segredo do Cofre
// Segredo do Cofre - F1P1 - OBI 2017
// Rogério Júnior
// O(N+M)
#include <cstdio> // scanf e printf
#include <algorithm> // min e max
using namespace std;
#define MAXN 100100 // defino o valor de MAXN
// Teleférico - F1P1 - OBI 2017
// Rogério Júnior
// Complexidade: O(1)
#include <cstdio> // scanf e printf
int main(){
// declaro e leio os valores de C e A
int c, a;
@rogerioagjr
rogerioagjr / drone.cpp
Last active May 25, 2017 15:25
Drone de Entrega
// Drone de Entrega - F1PJ - OBI 2017
// Rogério Júnior
// Complexidade: O(1)
#include <cstdio> // scanf e printf
int main(){
// declaro e leio os valores de A, B, C, H e L
int a, b, c, h, l;
// Bondinho - F1PJ - OBI 2017
// Rogério Júnior
// Complexidade: O(1)
#include <cstdio> // scanf e printf
int main(){
// declaro e leio os valores de A e M
int a, m;
@rogerioagjr
rogerioagjr / basic_treap.cpp
Last active March 28, 2017 13:16
Basic Treap
// Rogerio Junior - @rogerioagjr
// Basic Treap
#include <bits/stdc++.h>
using namespace std;
struct node{
int v, w;
@rogerioagjr
rogerioagjr / knap_bot-up.cpp
Created March 18, 2017 18:41
Knapsack Bottom-Up
// Rogerio Junior
// March 18, 2017
#include <bits/stdc++.h>
using namespace std;
#define MAXN 1010
int dp[MAXN][MAXN], w[MAXN], v[MAXN];
@rogerioagjr
rogerioagjr / dynamic_2d_segtree.cpp
Created March 8, 2017 16:06
Dynamic 2D SegTree
//Rogerio Junior
//Dynamic 2D SegTree
#include <iostream>
using namespace std;
#define M ((ini+fim)/2)
struct node1d{
@rogerioagjr
rogerioagjr / static_2d_segtree.cpp
Created March 8, 2017 16:05
Static 2D SegTree
//Rogerio Junior
//Static 2D SegTree
#include <iostream>
using namespace std;
#define L (2*seg)
#define R (2*seg+1)
#define M ((ini+fim)/2)
@rogerioagjr
rogerioagjr / joi2017-2.cpp
Created February 13, 2017 14:25
Semiexpress
#include <bits/stdc++.h>
using namespace std;
#define MAXM 3030
typedef long long ll;
ll n, m, k, expr[MAXM];