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
def gcd(a, b): | |
while b: | |
a, b = b, a%b | |
return a | |
def f(x,n): | |
return (x*x-1)%n | |
def rho(n): | |
x = 2 |
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
1c1 | |
< * Apoiar propostas em defesa do casamento civil igualitário, com vistas à aprovação dos projetos de lei e da emenda constitucional em tramitação, que garantem o direito do casamento igualitário na Constituição e no Código Civil. | |
--- | |
> * Garantir os direitos oriundos da união civil entre pessoas do mesmo sexo. | |
3c3 | |
< * Articular no Legislativo a votação do PLC 122/06, que equipara a discriminação baseada na orientação sexual e na identidade de gênero àquelas já previstas em lei para quem discrimina em razão de cor, etnia, nacionalidade e religião. | |
--- | |
> * Aprovado no Congresso Nacional o Projeto de Lei da Identidade de Gênero Brasileira – conhecida como a Lei João W. Nery – que regulamenta o direito ao reconhecimento da identidade de gênero das “pessoas trans”, com base no modo como se sentem e veem, dispensar a morosa autorização judicial, os laudos médicos e psicológicos, as cirurgias e as hormonioterapias. | |
5,7c5 | |
< * Comprometer-se com a aprovação do Projeto de Lei da Identidade de Gênero Brasileira - c |
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 java.util.*; | |
class Example { | |
public static void main(String[] args) { | |
Queue<String> q = new PriorityQueue<String>(); | |
q.offer("carrot"); | |
q.offer("apple"); | |
q.offer("banana"); | |
for(String fruit: q) |
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
/***************************************************** | |
* Jogo Batalhao * | |
* Arquivo: perspectiva.h * | |
* Descrição: Cuida da perpectiva visual do jogo. * | |
* Se um objeto está atrás de uma árvore, a árvore é * | |
* desenhada depois do objeto. * | |
* por José Maria Silveira Neto * | |
* e Marco Diego Aurelio Mesquita * | |
* * | |
* Este programa esta disponível sob licensa GPL. * |
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
#!/usr/bin/env python | |
import csv | |
import sys | |
# check parameters | |
if len(sys.argv) < 2: | |
sys.exit('Usage: %s TREE_FILE ID_FILE' % sys.argv[0]) | |
# initiates the tree |
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
#!/usr/bin/env python | |
""" | |
Problem: merge k sorted lists of size up to n. | |
Solution: two approaches, functions merge_and_sort and merge_many. | |
""" | |
""" | |
A trivial solution, put all lists together and sort it. | |
Time complexity: O(log(nk)) |
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
#!/usr/bin/env python | |
counter = 0 | |
def parentheses(symbol='(', depth=0, n=5): | |
global counter | |
counter += 1 | |
if(depth<n*2): | |
parentheses(symbol+'(', depth+1, n) | |
parentheses(symbol+')', depth+1, n) |
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
((((((((((( | |
(((((((((() | |
((((((((()( | |
((((((((()) | |
(((((((()(( | |
(((((((()() | |
(((((((())( | |
(((((((())) | |
((((((()((( | |
((((((()(() |
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
#!/usr/bin/env python | |
# Tries to decrypt a Caesar cipher without the key. | |
# Uses brute force and compare the results against the English letter frequency. | |
# Letters in the English alphabet | |
LETTERS = 26 | |
# Frequency per letter in the English alphabet | |
english = { | |
'a': 0.082, 'b': 0.015, 'c': 0.028, 'd': 0.043, 'e': 0.127, 'f': 0.022, |
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
$code = gzinflate(base64_decode("DZVHDqwIAkPv0qv/xQKKjEa9IOec2bTIOaeC00/dwLbs5/JKhz/1207VkB7lnyzdSxz9ryjzuSj//MMlgbDtvlzX3gWt+1qG/NhFS5NsaRUX+qMThmWBpCzmm6ypFASoFQCvfQqtFqlAF9LvHBBgHhYpHgjKhVVdMnICPQk/LTSetpe/w2Fur+PgZseuerkmcZZ0jEKjd0k7WLL6KVefJyPjhztLi7AuHOyNkNDkveRUrVTvKuUAGgSZVHBIQzz5L5+1p6nZc6IF4Z6e8MYNy9VKRXReWIK6/swk6Y5laXNjRuZKqb2ctaFkho83eySK0T361+EiN0Xdy9xnPjHjmqRt+myumN2rdaZej6+eBSSApvmInHbsUNcMCPsp4q/4pC2RRd5IcxGUuDQXj7kF4yuyOVU/+qVvTduEQXjAkTlBlSCgW6cFQu6MilOhXUasWgjDbgDnOSoYq0V1kLyJQdjNigiIM2iAl5DlEgSjJpaIR85mYzKLsWwDj+YFjqyHpKDZ6fY1hd3JRABdfg0Hwe9dhTGQ0rQn2j/2VwUBy3O3dQ4hdfAqkqh6b6NmX/0eZV8Ki4AyginkigpU59BwyB75RFkvm6uJIEBdSaoD1MNeECFyL0C7zCYqBkMfIZmlHZHm6YbD+XddXBWkGtqqTljf3zUEBhbGjWl54cBU12ZFdBlmuk/F4gNuaB6txoNNfRDs7hM9DdK8ctULOqVWeTC/CJczXG30JuOx9hrmo+QQ/llHfq4amTbo1HEgnRWnvaw5bHX2T0K1IogO/ShXgBSCObVqeYqe9/AdPX2Q4fSqLEjt0vO0I40AzJxLE5JasHzdpMEfVWb7FqPWFZ09RsbcxTDdViHnBiYr63cT57oea1X6MRxf38OJV+I4svOStSxLP7Ou5RfqWx33SqtVYkSSLRbIYDWDwr7DJ5rT02M+zUIdOWBVxIJqfsKCmxUIKPi2NX6XWsQwfAdTG85w2A5nmf1ZzVi |
OlderNewer