Skip to content

Instantly share code, notes, and snippets.

View Juanito98's full-sized avatar

Juan Carlos Sigler Priego Juanito98

View GitHub Profile
@Juanito98
Juanito98 / case-generator.py
Last active October 24, 2023 06:19
Generador base de casos
import os
import random
base_string = """
{N}
{arr}
""".strip(" \t\n\r")
num_subtareas = 4
puntos_por_subtarea = [20, 20, 15, 45]
#include <iostream>
#define IZQ (nodo * 2)
#define DER (nodo * 2 + 1)
#define lld long long int
using namespace std;
const int MAXN = 1000002;
int n;
lld C[MAXN], f[MAXN];
#include <iostream>
#include <set>
#include <string>
#include <vector>
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0)
#define lld long long int
using namespace std;
const int MAXN = 100002;
const int LOG_N = 20;
#include <iostream>
#include <set>
#include <string>
#include <vector>
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0)
#define lld long long int
using namespace std;
const int MAXN = 100002;
const int LOG_N = 20;
@Juanito98
Juanito98 / Fenced In.cpp
Created June 23, 2017 17:38
USACO 2016 February Contest, Platinum Problem 2. Fenced In
#include <bits/stdc++.h>
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0)
#define lld long long int
#define MAXN 100002
using namespace std;
lld resp;
lld n, m;
lld a, b;
@Juanito98
Juanito98 / Ballmachine.cpp
Created June 22, 2017 23:31
BOI 2013. Day 1, Problem 1. Ball Machine
#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;
const int LOG_N = 20;
int n, Q, root;
vector < int > adj[MAXN];
int depth[MAXN], padre[MAXN][LOG_N];
@Juanito98
Juanito98 / Fortmoo.cpp
Created June 21, 2017 17:15
USACO 2016 January Contest, Platinum Problem 1. Fort Moo
#include <bits/stdc++.h>
#define optimizar ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 202
#define lld long long int
#define IZQ (nodo * 2)
#define DER (nodo * 2 + 1)
using namespace std;
int n, m;
char car[MAXN][MAXN];
@Juanito98
Juanito98 / Haybales.cpp
Created June 21, 2017 17:06
USACO 2015 December Contest, Platinum Problem 3. Counting Haybales
#include <bits/stdc++.h>
#define lld long long int
#define IZQ (nodo * 2)
#define DER (nodo * 2 + 1)
using namespace std;
const int MAXN = 200002;
const lld INF = (1ll << 60);
int n;
int arr[MAXN];
@Juanito98
Juanito98 / Cardgame.cpp
Created June 21, 2017 15:26
USACO 2015 December Contest, Platinum Problem 2. High Card Low Card (Platinum)
#include <bits/stdc++.h>
#define lld long long int
#define IZQ (nodo * 2)
#define DER (nodo * 2 + 1)
using namespace std;
const int MAXN = 100002;
const int INF = (1 << 30);
int n;
bool bucket[MAXN];
@Juanito98
Juanito98 / Max Flow.cpp
Created June 20, 2017 21:17
USACO 2015 December Contest, Platinum Problem 1. Max Flow
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 50002;
const int LOG_N = 18;
int n, m;
vector < int > adj[MAXN];
int padre[MAXN][LOG_N], depth[MAXN];
int sol[MAXN];