Skip to content

Instantly share code, notes, and snippets.

View jhtan's full-sized avatar

Jhonatan Castro jhtan

View GitHub Profile
@jhtan
jhtan / inf27lol super_market
Created August 21, 2014 15:02
1st homework of inf27lol lol
create table cliente (
cliente_id varchar(8) not null,
nombre varchar(50),
paterno varchar(50),
materno varchar(50),
primary key (cliente_id)
)
create table cargo (
cargo_id varchar(8) not null,
@jhtan
jhtan / SPOJ Desining T-Shirts, ArgCamp14
Created July 31, 2014 20:52
SPOJ Desining T-Shirts, ArgCamp14
#include <bits/stdc++.h>
#define MAX 1000000
using namespace std;
struct trie{
map<char, int> sig;
bool termina;
int a, b;
};
trie t[MAX];
int n = 1;
@jhtan
jhtan / latitude&longitude2
Created June 7, 2014 19:43
latitude&longitude2
<?php
/**
* Created by PhpStorm.
* User: jhtan
* Date: 6/7/14
* Time: 1:13 PM
*/
$address = $_GET['address'] . ' Nuestra Señora de La Paz, Bolivia';
//$url = "http://maps.google.com/maps/api/geocode/json?address=" . urlencode($address) . "&components=country:BO|locality:" . urlencode("Nuestra Señora de La Paz") . "";
@jhtan
jhtan / latitude&longitude
Created June 7, 2014 18:23
latitude&longitude
<?php
/**
* Created by PhpStorm.
* User: jhtan
* Date: 6/7/14
* Time: 1:13 PM
*/
$address = $_GET['address'];
$url = "http://maps.google.com/maps/api/geocode/json?address=" . urlencode($address) . "&sensor=false&region=India";
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
vector<ll> LIS(vector<ll> X){
#include <cstdio>
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
double dist(double x1, double y1, double x2, double y2) {
return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int t;
scanf("%d", &t);
string V[13] = {"", "", "1", "7", "4", "2", "6", "8", "10", "18", "22", "20", "28"};
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
using namespace std;
int p[100001];
int ns;
void initSet(int n) {
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int n, m;
string M[210];
int M2[210][210];
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
vector<string> knuthP(string s) {
if(s.length() == 1) {
vector<string> A;
A.push_back(s);