2011-03-21から1日間の記事一覧

PKU 3671 Dining Cows

PKU

http://poj.org/problem?id=3671 n匹の牛が順番に並んでいる。最初にi番目の牛は1か2のグループに割り当てられている。 このとき、牛のグループ割り当てをi番目までの牛が全て1で、i+1番目以降の牛が全て2となるように変更したい。全て1や全て2とうパターン…

PKU 3210 Coins

PKU

http://poj.org/problem?id=3210 3枚のコインを裏表ランダムに机に並べる。この時、全てのコインの面をそろえるには2回裏返せばよい。 例えば表(又は裏)が3枚の時は、同じコインを2回裏返し、表(又は裏)が2枚の時はその2枚を一回ずつ裏がせばよい。 同様にし…

PKU 1564 Sum It Up

PKU

http://poj.org/problem?id=1564 n個の数字とtが与えられる。 この時、n個の数字から和がtになるような組み合わせを全て選べというような問題。

PKU 1686 Lazy Math Instructor

PKU

http://poj.org/problem?id=1686 二つの式が与えられるので、その式が等しいかどうかを確かめるという問題。 久しぶりに、それなりの問題が解けたような気がします。 構文解析部分は殆どhttp://d.hatena.ne.jp/atetubou/20110317/1300367965と一緒です。

PKU 1663 Number Steps

PKU

http://poj.org/problem?id=1663 座標が与えられるので図のような感じで与えられている数を答えるというような問題。

PKU 3663 Costume Party

PKU

http://poj.org/problem?id=3663 長さn

PKU 3673 Cow Multiplication

PKU

http://poj.org/problem?id=3673 与えられた方法で計算するだけ。 易。

PKU 3032 Card Trick

PKU

http://poj.org/problem?id=3032 マジシャンがn枚のトランプの山で、次のような操作ができるようなトランプの積み方を出力せよというような問題。 1. まず1枚を山札の一番上から一番下に回す。そのあと、一番上の札を場に出す。 この時、その札は1。 2. 次に…

テンプレート

こんなん使ってます。 #include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include </sstream></functional></algorithm></vector></string></memory></iostream></set></utility></map></cfloat></climits></cmath></cstdlib></cstdio>

PKU 1797 Heavy Transportation

PKU

http://poj.org/problem?id=1797 n個のノードがあって、あるノードからあるノードに道があるとき、その道は最大で重さwまで通ることが出来る。 ノード1からノードnまで運べる最大の重量はいくらかを求めろという問題。

PKU 3626 Mud Puddles

PKU

http://poj.org/problem?id=3626 最短路問題。 泥の場所を通らないで、できるだけ早く目的の場所にたどり着けみたいな問題。やや易。

PKU 3086 Triangular Sums

PKU

http://poj.org/problem?id=3086 計算式を適用して結果を出力する問題。 易。 解答数稼ぎ用。

PKU 3087 Shuffle'm Up

PKU

http://poj.org/problem?id=3087 シャッフルのシミュレーションをして目的の状態に辿りつけるかどうかを判定するような問題。やや易。