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
init_1 = 94 * len | |
init_2 = 218 + 106 * (len - 1) | |
if file > "2GB": | |
if other_file >= 2GB: | |
j+=150 | |
elif other_file > 2045222520: | |
j+=134 | |
else: | |
j+=106 |
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
class UnitedStates: | |
states = ( | |
('AL','Alabama'), | |
('AK','Alaska'), | |
('AS','American Samoa'), | |
('AZ','Arizona'), | |
('AR','Arkansas'), | |
('CA','California'), | |
('CO','Colorado'), | |
('CT','Connecticut'), |
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
#include <iostream> | |
using namespace std; | |
int *miny(int *v,int n){ | |
int x=v[0],jmin=0; | |
for (int i=0; i<n; i++){ | |
if(v[i]<x){ | |
jmin=i; | |
x=v[jmin]; | |
} |
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
#include <iostream> | |
#include <list> | |
using namespace std; | |
int ascendente(list<int>&L,list<list<int>>&LL){ | |
auto p = L.begin(); | |
while(p!=L.end()){ | |
auto q=p; | |
q++; | |
list<int>tmp; |
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
import pycurl,urllib | |
try: | |
# python 3 | |
from urllib.parse import urlencode | |
except ImportError: | |
# python 2 | |
from urllib import urlencode | |
curl = pycurl.Curl() | |
curl.setopt(pycurl.URL,"https://api.instagram.com/oauth/access_token") |
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
#include <iostream> | |
#include <vector> | |
using namespace std; | |
void inssort(vector<int> &a){ | |
int n = a.size(); | |
for(int j=1; j<n; j++){ | |
int x = a[j]; | |
int k=j; | |
while(--k>=0 && x<a[k]) |
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
#include <iostream> | |
#include <list> | |
#include <map> | |
using namespace std; | |
/*show list of integers with C++ standard 1998*/ | |
void display_98(list<int> &L){ | |
list<int>::iterator p = L.begin(); | |
while(p!=L.end()){ | |
cout << *p << ' '; |
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
#include <iostream> | |
#include <list> | |
#include <map> | |
using namespace std; | |
/*NOTA: es necesario compilar con -std=c++11 (standard 2011)*/ | |
/* | |
-Si una clave key esta contenida en A o B pero no en ambos, entonces C no debe contener dicha clave. | |
-Si una clave key esta contenida en A y B a la vez, entonces C debe contener dicha clave y su valor |
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
#include <iostream> | |
#include <map> | |
using namespace std; | |
typedef map<int,int> map_p; | |
bool areinverse(map_p M1, map_p M2){ | |
if(M1.size()!=M2.size()) return false; | |
map_p::iterator p = M1.begin(); | |
while(p!=M1.end()){ | |
if(M2.find(p->second)!=M2.end()){ |
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
#include <iostream> | |
#include <list> | |
using namespace std; | |
list<int> crear_expand(int n,int m){ | |
list<int> l; int sum=0; | |
while(sum<n){ | |
if((sum+m)>n){ | |
sum+=1; | |
l.push_back(1); |
NewerOlder