torus711 のアレ

主に競技プログラミングの問題について書きます.PC 以外だと数式が表示されないかもしれないです

2014-01-01から1年間の記事一覧

TopCoder, SRM 626, Division 2, Level 2 : FixedDiceGameDiv2

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13240&rd=15859 問題概要 二つのサイコロを使った二人ゲームを考える。Alice は 面のサイコロを、Bob は 面のサイコロを使用する。二人は同時にサイコロを振り、出た目が大きい方のプレイ…

TopCoder, SRM 626, Division 1, Level 1 : FixedDiceGameDiv1

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13239&rd=15859 問題概要 複数のサイコロを使った二人ゲームを考える。Alice は 個の 面サイコロを、Bob は 個の 面サイコロを使用する。二人は同時に全てのサイコロを振り、出目の和が大…

TopCoder, SRM 625, Division 2, Level 1 : AddMultiply

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13231&rd=15858 問題概要 非負整数 が与えられる。次の条件を満たすタプル を一つ求めよ。 少なくとも一つ、条件を満たすタプルが存在することが保証される。

TopCoder, SRM 625, Division 2, Level 2 : IncrementingSequence

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=12107&rd=15858 問題概要 項からなる数列 と正整数 が与えられる。この数列に対し、 を に置き換える操作を任意回できる。 をサイズ の順列にすることができるか否か求めよ。 なお、サイ…

TopCoder, SRM 625, Division 1, Level 1 : PalindromePermutations

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=11856&rd=15858 問題概要 文字列 word が与えられる。word のアナグラムの内一つをランダムに選んだとき、それが回文となっている確率を求めよ。

TopCoder, SRM 624, Division 2, Level 3 : GameOfSegments

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13204&rd=15857 問題概要 N 頂点からなる凸多角形を成す点集合を使った二人ゲームをする。ゲームはターン制で進行し、各ターンでプレイヤーは以下のいずれかの行動の内一つを選択する。 …

TopCoder, SRM 624, Division 1, Level 2 : DrivingPlans

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13197&rd=15857 問題概要 N 頂点からなる連結な重み付き無向グラフが与えられる。重みは非負整数である。 頂点を 1 から N で番号付けたとして、頂点 1 から頂点 N への最短経路(単純道…

TopCoder, SRM 624, Division 2, Level 1 : CostOfDancing

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13195&rd=15857 問題概要 非負整数からなる列 danceCost と、正整数 K ( ) が与えられる。danceCost から重複せずに K 項を選んだきの総和の最小値を求めよ。

TopCoder, SRM 624, Division 2, Level 2 : BuildingHeightsEasy

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13215&rd=15857 問題概要 正整数の列 heights と、正整数 M ( ) が与えられる。 heights の各要素に対し、値を 1 増やす操作を任意回できるとき、heights の内 M 個以上を等しくするため…

TopCoder, SRM 624, Division 1, Level 1 : BuildingHeights

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13211&rd=15857 問題概要 Division 2, Level 2 と設定は同じ。ただしこちらは 1 以上 N 以下の全ての M について答えを求めて、全ての xor を return せよ。

TopCoder, SRM 623, Division 2, Level 1 : CatchTheBeatEasy

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13208&rd=15856 問題概要 Division 1, Level 2 と同じゲームをする。 全てのフルーツを拾得することができるか否か、判定せよ。 N

TopCoder, SRM 623, Division 2, Level 2 : CatAndRat

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=12932&rd=15856 問題概要 半径が R のリング状のチューブがあり、このチューブには一箇所の入り口がある。時刻 0 のとき、チューブにネズミが一匹入る。ネズミはチューブに入ったあと、Vr…

TopCoder, SRM 623, Division 2, Level 3 : ApplesAndPears

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=12935&rd=15856 問題概要 Division 1, Level 1 とほぼ同一。ただし、uniform であることの要件は、矩形領域内部のグリッドが全て同一の状態であること。 N

TopCoder, SRM 623, Division 1, Level 1 : UniformBoard

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13209&rd=15856 問題概要 のグリッド状の盤面があり、各グリッドは、丁度一つのりんごか梨のいずれかがあるか、空であるかのいずれかである。この盤面に対し、一つのフルーツを選んで空い…

TopCoder, SRM 623, Division 1, Level 2 : CatchTheBeat

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=12807&rd=15856 問題概要 次のようなゲームをする。 2D ゲームである プレイヤーキャラクターの初期位置は原点 ( 0, 0 ) プレイヤーキャラクターは X 軸上のみを移動することができ、その…

TopCoder, SRM 622, Division 2, Level 3 : Subsets

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=10554&rd=15855 問題概要 正整数の(多重)集合 S が与えられる。この集合の部分集合 T であって、 であるものの数を求めよ。 であり、任意の a ∈ S について である。 また、答えは 32 b…

TopCoder, SRM 622, Division 2, Level 1 : FibonacciDiv2

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13159&rd=15855 問題概要 正整数 N が与えられる。N との差が最も小さいフィボナッチ数と N との差(の絶対値)を求めよ。

TopCoder, SRM 622, Division 2, Level 2 : BoxesDiv2

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13192&rd=15855 問題概要 いくつかの飴を持っている。飴には種類があり、i 番目の種類の飴の数は candyCounts[ i ] で与えられる。また、非負整数 i を用いて と表せる大きさの箱を無限個…

TopCoder, SRM 622, Division 1, Level 1 : BuildingRoutes

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13193&rd=15855 問題概要 有向重み付き完全グラフ G = ( V, E ) と、正整数 T が与えられる。全ての頂点対 ( s, t ) について、s -> t の最短路を考える(ある ( s, t ) に対し最短路が複…

TopCoder, SRM 621, Division 2, Level 1 : TwoWaysSorting

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=11084&rd=15854 問題概要 文字列をソートする際、文字列同士の比較には次の二種類が考えられる。 辞書式順序で早い方を手前にする 長さが短い方を手前にする 長さが相異なる文字列の配列…

TopCoder, SRM 621, Division 2, Level 2 : NumbersChallenge

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13166&rd=15854 問題概要 整数の(多重)集合 S が与えられる。S の部分和として現れない最小の非負整数を求めよ。

TopCoder, SRM 621, Division 1, Level 1 : RadioRange

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13187&rd=15854 問題概要 二次元平面上にいくつかの円があり、i 番目の円の中心座標は ( X[ i ], Y[ i ] ) 、半径は R[ i ] である。 これらの円とは別に、原点を中心とする円を考える。…

AtCoder Beginner Contest #008, A : アルバム

問題文 http://abc008.contest.atcoder.jp/tasks/abc008_1 問題概要 正整数 S, T ( ) が与えられる。 を満たす整数 x の個数を求めよ。

AtCoder Beginner Contest #008, B : 投票

問題文 http://abc008.contest.atcoder.jp/tasks/abc008_2 問題概要 N 個の文字列の(多重)集合 S が与えられる。S に最も多く含まれている文字列を一つ出力せよ。

AtCoder Beginner Contest #008, C : コイン

問題文 http://abc008.contest.atcoder.jp/tasks/abc008_3 問題概要 表裏を区別できる N 枚のコインがあり、各コインには正整数が一つ書かれている。i 番のコインに書かれている整数は である。 今、N 枚のコイン順列の内からランダムに選択された順序でコイ…

AtCoder Beginner Contest #008, D : 金塊ゲーム

問題文 http://abc008.contest.atcoder.jp/tasks/abc008_4 問題概要 説明しづらいので本家問題文参照で><

TopCoder SRM 620, Division 2, Level 1 : CandidatesSelectionEasy

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13160&rd=15853 概要 きつねのしえるは新しいメイドさんを雇おうとしている。メイドさん候補は n 人いて、0 から n - 1 に番号付けされている。また、メイドさんに要求される技能は m 種…

TopCoder SRM 620, Division 2, level 2 : PairGameEasy

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13161&rd=15853 問題概要 正整数の順序対 ( x, y ) について、( x + y , y ) または ( x, y + x ) に変化させる操作を任意回数できる。 正整数 a, b, c, d が与えられる。( a, b ) から (…

TopCoder, SRM 620, Division 1, Level 1 : PairGame

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13142&rd=15853 問題概要 正整数の順序対 ( x, y ) について、( x + y , y ) または ( x, y + x ) に変化させる操作を任意回数できる。 二つの順序対 ( a, b ), ( c, d ) を共に生成でき…

TopCoder, SRM 619, Division 2, Level 1 : GoodCompanyDivTwo

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13112&rd=15852 問題概要 N 人の従業員がいる会社がある。0 番の従業員以外の各従業員には直属の上司が丁度一人いて、i 番の従業員の上司は superior[ i ] である。 また、各従業員は丁度…