This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Los puntos claves son usar gcd para reducir al maximo la fraccion sum/n | |
Para impresión se puede usar este tip: | |
c=cifras(n) | |
char b[50]="% d\n"; | |
b[1]=c+'0';//convertir int to char | |
printf(b,abs(sum)) | |
Asi se fuerza a ocupar c espacios la impresion del numero sum | |
**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* La idea principal es utilizar union-find disjoint set | |
* Tener cuidado con la lectura. Usar getchar() para leer saltos de linea (\n) | |
* | |
* */ | |
#include <iostream> | |
#include <cmath> | |
#include <algorithm> | |
#include <queue> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Idea de solucion adhoc, la parte principal del es convertir int a string, | |
en c++11 se puede hacer de forma facil usando to_string(int x) | |
PResentation error: cuidar siempre imprimir un salto de linea entre casos y tambien al final de la salida | |
**/ | |
#include <iostream> | |
#include <cmath> | |
#include <algorithm> | |
#include <queue> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Problema adhoc | |
La idea es usar un map,y un arreglo de numeros como string para evitar la conversion de int a string | |
**/ | |
#include <iostream> | |
#include <cmath> | |
#include <algorithm> | |
#include <queue> | |
#include <stack> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
La idea en este problema es llevar un acumulado pero de los numeros que hay (del 0 al 9) hasta x posición | |
**/ | |
#include <iostream> | |
#include <cmath> | |
#include <algorithm> | |
#include <queue> | |
#include <stack> | |
#include <sstream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Problema ad-hoc, la idea de solución es simular el proceso de como va "despertando el cerebro" | |
**/ | |
#include <iostream> | |
#include <cmath> | |
#include <algorithm> | |
#include <queue> | |
#include <stack> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
La idea de solución es usar union-find disjont sets | |
combinado con un map | |
**/ | |
#include <iostream> | |
#include <cmath> | |
#include <algorithm> | |
#include <queue> | |
#include <stack> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
La idea de solución es ad-hoc. | |
Tener cuidado con que la fuente C5 solo deben imprimir los * y la C1 solo los caracteres, no los espacios( . ) | |
**/ | |
#include <iostream> | |
#include <cmath> | |
#include <algorithm> | |
#include <queue> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
La idea es basicamente greedy, tomar el mayor disponible y los n menores necesarios | |
para completar el peso minimo requerido de 50 | |
**/ | |
#include <iostream> | |
#include <cmath> | |
#include <algorithm> | |
#include <queue> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
La idea es encontrar el angulo punto que nos dan, usan atan(y/x), comparandolo con nuestros angulos inicial y final | |
y finalmente que la distancia del punto al centro sea menor o igual al radio | |
**/ | |
#include <iostream> | |
#include <cmath> | |
#include <algorithm> | |
#include <queue> |