Skip to content

Instantly share code, notes, and snippets.

@Yosshi999
Yosshi999 / graph_optimizer.py
Last active December 12, 2017 17:32
TSG/IS18er AdventCalendar2017 12th (Qiita)
import chainer
import chainer.functions as F
import chainer.links as L
from chainer.training import extensions
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
class unit(chainer.Chain): # 恒星、惑星、衛星などをまとめたもの
def __init__(self, x, y):

Tokyo Westerns CTF 3rd 2017 Writeup

swap (pwn)

アドレスを二つ指定しその内容を8バイトだけ入れ替えることができる。 入れ替えの実装は次のようになっている。

memcpy(dst=tmp, src=1st, size=8);
memcpy(1st, 2st, 8);
memcpy(2nd, tmp, 8);
label 6
push 1
push 0
heap_store
push 2
push 1
heap_store
push 0
read_num
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
import pandas as pd
iris = load_iris()
data = pd.DataFrame(iris.data, columns=iris.feature_names)
length = data.iloc[:,0] #length = data["sepal length (cm)"]
width = data.iloc[:,1]
/*
M == 1
10 -> START
10 -> 10, 01
01 -> 10, 01
GOAL -> 01
M == 2
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_A&lang=jp
#include <iostream>
using namespace std;
const int KINDMAX = 21;
const int PAYMAX = 50001;
const int COINMAX = 10000;
int dp[PAYMAX][KINDMAX];
int coinMem[PAYMAX];
#include <iostream>
#include <string.h>
using namespace std;
const int SMAX = 1001;
int dp[SMAX][SMAX];
int main() {