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
k = 15 | |
m = 1<<k | |
tab = {} | |
pow2 = m<<2 -- any power of two larger works | |
for i=1,m do | |
tab[pow2+i] = 1 -- insert big elements | |
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
math.randomseed(2151) -- (2151) | |
n = 1<<23 | |
iterations = 100 | |
pow = 1<<31 | |
pow2 = pow>>1 | |
m = 15 | |
offset = 1<<m | |
it = offset |
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 itertools | |
M = {} | |
def look_and_say(atom,n) : | |
global M | |
a = atom | |
if n == 0 : | |
return 0 | |
b = "" |
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
%w(socket net/http thread monitor cmath ./rsa).map(&method(:require)) | |
from_server = RSA.new | |
n,e = from_server.get_params | |
puts "Encryption system ready!" | |
server = TCPSocket.new 'localhost', 2000 # change this part | |
a = server.gets.to_i |
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 binary(x) : | |
return format(x,'b') | |
def print_binary(x) : | |
print binary(x) | |
def iterate(superset,f) : | |
i = 0 | |
while True : | |
f(i) |
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 runhaskell | |
-- Haskell traceroute over icmp | |
-- now with ByteString to avoid new errors produced | |
-- by the deprecated recvFrom from Network.Socket | |
import Control.Monad | |
import Data.Bits(complement) | |
import Data.ByteString(unpack,pack) | |
import Data.List |
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 <cstdio> | |
#include <vector> | |
using namespace std; | |
#define oo (1<<28) | |
int solve(vector <string> m) | |
{ | |
int N = m.size(), M = m[0].length(); |
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
gets.to_i.times do |i| | |
n, m, ps = gets.split.map(&:to_i) | |
players = (1..n).map do | |
name, sp, h = gets.split | |
sp, h = sp.to_i, h.to_i | |
[sp,h,name] | |
end | |
players.sort! | |
players.reverse! | |
team1, team2 = [], [] |
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 ruby | |
# [Gedit Tool] | |
# Name=CodeForces | |
# Shortcut=<Control>F6 | |
# Languages=cpp | |
# Applicability=all | |
# Output=output-panel | |
# Input=nothing | |
# Save-files=document |
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
require 'cairo' | |
#input and output come as arguments | |
input, output = ARGV | |
surface = Cairo::ImageSurface.from_png input | |
goal_data = surface.data | |
HEIGHT, WIDTH = surface.height, surface.width |
NewerOlder