PKU

ポラード・ロー素因数分解法(Pollard's rho algorithm) PKU 2447とか.

以下は嘘吐いてる可能性が結構あるので気をつけて!!ρ法は篩などでは見つけられない大きさの素因数を見つけるアルゴリズム.理論的なことは完全に理解していないので僕が説明するよりwikipedia:ポラード・ロー素因数分解法とかhttp://matsumoto-lab.hp.info…

PKU

PKU 2671なんだけど,while (1);を書くかどうかでACがWAになる. ダイクストラで解いたのだけど,擬似コードはこんな感じ. int bfs(){ while (!q.empty()){ } while (1); // これを消すとWA } int main(){ ... ... cout << bfs() << endl; } なんぞこれ?実…

3140 Contestants Division

PKU

この問題は読むのが難しかった>< the organizing committee can only afford to set the system up such that there will be only one way to transfer information from one university to another without passing the same university twiceこの一文は…

Emacs Lisp for PKU Judge Online and others

id:halwhiteさんがpkuのスクリプトを公開していたので私も公開.poj-modeっていうのは知らなかった…http://code.google.com/p/icpc-online-judge-scripts/source/browse/trunk/icpc-online-judge.el#このLispは外部スクリプトをプロセスを生成して実行します…

1019 Number Sequence

PKU

1019をid:keitanxkeitanが2分探索で解いていて,そんな問題だったかなぁとビックリした.自分のを見返してみたらやっぱり2分探索ではなかった.確かに2分探索でも解けるし実行時間は速いけど,こうやっても解けるよーっていう紹介. 概要 112123123412345…

手首のリハビリ替わりにPKU.まだまだかくのしんどい.

PKU

概要 与えられた迷路のどこにいても脱出できる最短の方向リストを求めよ. 壁の方向に進もうとした場合はその場にとどまる.複数解ある場合はどれを出力してもよい. その昔に友人がヒューリスティックで解いたよーとかいってて,どうやって解くんだろうと思…