Skip to content

Instantly share code, notes, and snippets.

View jhtan's full-sized avatar

Jhonatan Castro jhtan

View GitHub Profile
#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
using namespace std;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {
if(b == 0)
return a;
#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);
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int n, m;
string M[210];
int M2[210][210];
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
using namespace std;
int p[100001];
int ns;
void initSet(int n) {
#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 <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 <vector>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
vector<ll> LIS(vector<ll> X){
@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";
@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") . "";