Skip to content

Instantly share code, notes, and snippets.

@hhc0null
hhc0null / gist:2182673
Created March 24, 2012 13:15
aoj-0008-Sum_of_4_Integers.cpp
// AOJ0008
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <stack>
int main() {
int i, j, k, l, n, cnt;
@hhc0null
hhc0null / gist:3065044
Created July 7, 2012 06:19
aoj-0200-Traveling_Alone__One-way_Ticket_of_Youth-Runtime_Error.cpp
// HELP ME!!!!! WHAT'S WRONG!!!!
#include <iostream>
const unsigned int inf = 1 << 26;
const int MAX_OF_INFOMATIONS = 300;
const int MAX_OF_STATIONS = 100;
const int MAX_OF_ENQUIRIES = 200;
int dijk(int m, int n, int s, int g[2][MAX_OF_STATIONS][MAX_OF_STATIONS], int ary[2][MAX_OF_STATIONS][MAX_OF_STATIONS]) {
@hhc0null
hhc0null / gist:3884904
Created October 13, 2012 14:57
revstr.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
usage = """revstr.py 0.0.1, a reversing tool for common files.
Basic Usage:
revstr.py < [filename]
cat [filename]|./revstr.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
# RSA Decipher for SECCON CTF 4(Yokohama)
# Author: Matsukuma Hiroki a.k.a. hhc0null <hhc.0.null@gmail.com>
# Usage: ./RSA_Decipher < [Crypted Text]
@hhc0null
hhc0null / regexdb_length.py
Last active December 10, 2015 12:28
CCC CTF, Web100 regexdb
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import urllib
url = 'http://94.45.252.233/'
for i in range(100): # from 0 to 100.
params = urllib.urlencode({'input': '/(^.{'+str(i+1)+'}$)/'}) # search the length of string.
@hhc0null
hhc0null / result_length_regexdb.txt
Created January 2, 2013 11:05
Result of regex_length.py
Length of strings: 1: 0
Length of strings: 2: 0
Length of strings: 3: 0
Length of strings: 4: 0
Length of strings: 5: 1: 29C3_
Length of strings: 6: 0
Length of strings: 7: 0
Length of strings: 8: 0
Length of strings: 9: 1: Key: None
Length of strings: 10: 2
@hhc0null
hhc0null / hex2asc.py
Last active December 10, 2015 18:38
hex2asc.py 0.0.1, a converter to ascii characters from hex strings. Basic Usage: $ hex2asc.py --space 41 41 41 AAA $ hex2asc.py 414141 AAA --- i have to finish a repot of phisics...
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
argc = len(sys.argv)
argv = sys.argv
def ShowUsage():
@hhc0null
hhc0null / AOJ0009.cpp
Created April 25, 2013 11:42
i want to take a bath immediately.
#include <cmath>
#include <iostream>
#include <iomanip>
#include <stack>
#include <list>
#include <vector>
int main(void) {
std::list<int> input;
std::vector<int> pnums;
; Calc a distance of a thrown object
(define pi (* 4 (atan 1.0))) ; pi = 4atan(-1)
(define gravaccr 9.8) ; gravitial accelaration
(define CalcDistance
(lambda (v0 deg)
(define DegreeToRadian
(lambda (degree)
(/ (* degree pi) 180)))
(define CalcDistanceX
@hhc0null
hhc0null / tribonacci.scm
Created July 25, 2013 05:41
put tribonacci numbers out with the tail recursion algorithm.
; put tribonacci numbers out with the tail recursion algorithm
(define (tribonacci n)
(tribo-tail n 0 0 1))
(define (tribo-tail n a b c)
(cond
((= n 0) or (= n 1) 0)
((= n 2) c)
(else