蟻本はとりあえず急いでフローを求めたい人向けの説明なので、
アルゴリズムイントロダクション(図書館にある)とかを読むのをお勧めします。
http://hos.ac/slides/20150319_flow.pdf
これが分かりやすいですかね。
用語として、 フロー、フローの残余グラフ、増加路、カット、とかは理解しておきましょう。
増加路が存在しない⇔最大フローとか、 最大フロー最小カット定理、とかは理解しておくとよい。
#include<cstdio> | |
#include<cstring> | |
#include<vector> | |
#include<queue> | |
#include<algorithm> | |
#include<cmath> | |
#include<climits> | |
#include<string> | |
#include<set> | |
#include<map> |
蟻本はとりあえず急いでフローを求めたい人向けの説明なので、
アルゴリズムイントロダクション(図書館にある)とかを読むのをお勧めします。
http://hos.ac/slides/20150319_flow.pdf
これが分かりやすいですかね。
用語として、 フロー、フローの残余グラフ、増加路、カット、とかは理解しておきましょう。
増加路が存在しない⇔最大フローとか、 最大フロー最小カット定理、とかは理解しておくとよい。
<html> | |
<head> | |
<title>igoclock</title> | |
<script> | |
function hoge(){ | |
if(document.timer.player.value>=0){ | |
document.timer.remain.value -= 1; | |
if(document.timer.remain.value < 0){ | |
document.timer.player.value = -1; | |
document.body.style.backgroundColor = 'red'; |
#coding: utf-8 | |
import threading | |
import socket | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import urlparse | |
page_head = """ | |
<!doctype html> |
type tyvar = string | |
type var = string | |
type ty = | |
| TyV of tyvar | |
| TyFun of ty * ty | |
| TyAll of tyvar * ty |
def eval(s,inputs): | |
mem = [0 for i in xrange(6000)] | |
ip = 0 | |
mp = 0 | |
stack = [] | |
def state2s(): | |
return ( | |
''.join(map(lambda (i,c): "*"+c if i == ip else c ,enumerate(s))) + '\n' + | |
str(map(lambda (i,c): "@"+str(c) if i == mp else c ,enumerate(mem[:200]))) |
When beta reducing, "capture avoiding substitution" is not taken place.
For example, the term (\x. \y. x y) y
should be reduced to \z. y z
by renaming y
to z
in (\x. \y. x y)
, but in the interpreter, this term is reduced to \y. y y
, which is ill typed lambda term.
By exploiting this, the input
f1 = (\f:I->I. \g:A->A. g)
f2 = (\x:(I->I)->(A->A)->A->A. \f1:A->A. x dec) f1 (\d:A. d)
#include<cstdio> | |
#include<cstring> | |
#include<vector> | |
#include<queue> | |
#include<algorithm> | |
#include<cmath> | |
#include<climits> | |
#include<string> | |
#include<set> | |
#include<map> |
https://github.com/satos---jp/fstar-tips で書き直し中
from cryptosystem import PKCS | |
from polynomials import Polynomial as P | |
from cryptosystem_edit import PKCS as PKCS_edit | |
from flag_params import flag_encrypted_password as encpass | |
cs = PKCS.importPublicKey(open('public.key').read()) | |