Skip to content

Instantly share code, notes, and snippets.

#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int n;
int S[300005],T[4];
double M[300005];
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
int t,a,b,r;
/**
Observar que dice: "output one line per car, in the same order as the input" Imprimir la respueta de cada auto en el mismo orden de entrada
Input:
1
2 2 4
0 left
1 left
2 right
/**
Notar que cada que avanza la manecilla de los minutos también lo hace la de las horas, por eso el ángulo de horas (aH) se obtinene como:
aH=60 * h + .5 * m;
aM=6 *m;
O bien podemos simplificar a:
aH=60 *h;
aM=5.5*m;
**/
/**
Si tienes problemas entendiendole al problema checa este caso:
Entrada:
1
3 2 2
2 3 3
0
1 2
Salida:
/**
Problema fácil que se puede complicar por la lectura de la entrada
**/
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
/**
Notar que: "A combination of courses is considered
most popular
if no other combination has higher
popularity."
Con esto podemos preguntarnos ¿Si hay empate entre varias combinanciones?
Entrada:
10
/**
El punto clave del problema es verlo como un barrido
**/
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <sstream>
#include <map>
#include <set>
using namespace std;
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <sstream>
#include <map>
#include <set>
using namespace std;