torus711 のアレ

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

TopCoder

TopCoder SRM 634, Division 2, Level 1 : MountainRanges

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13454&rd=16077 問題概要 数列 が与えられる。 の要素であって、その両隣の要素よりも真に大きいものの数を求めよ。

TopCoder SRM 634, Division 2, Level 2 : ShoppingSurveyDiv2

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13458&rd=16077 問題概要 ある店では 種類の商品を販売している。 人の顧客について、それぞれが購入した商品のリストを作成した。なお、各顧客は同じ品物は高々一つしか購入しない。また…

TopCoder SRM 634, Division 1, Level 1 : ShoppingSurveyDiv1

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13455&rd=16077 問題概要 ある店では 種類の商品を販売している。 人の顧客について、それぞれが購入した商品のリストを作成した。なお、各顧客は同じ品物は高々一つしか購入しない。また…

TopCoder SRM 628, Division 2, Level 1 : BishopMove

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13280&rd=16009 問題概要 のチェス盤上の位置 にビショップが置かれている。このビショップを位置 に移動させるために必要な手数の最小値を求めよ。到達不可能な場合は -1 で示せ。 ※ビシ…

TopCoder SRM 628, Division 2, Level 2 : BracketExpressions

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13243&rd=16009 問題概要 "(){}[]" に含まれる 6 種類の括弧及び 'X' からなる文字列 が与えられる。'X' を括弧の内任意の一文字に(独立に)置換できるとき、括弧の対応を取ることができ…

TopCoder SRM 628, Division 2, Level 3 : InvariantSets

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13242&rd=16009 問題概要 内の整数からなる集合 と、 上の写像 がある。 は配列 によって表され、 である。 また、 の部分集合 が invariant set であるとは、次の条件を満たすときである…

TopCoder SRM 628, Division 1, Level 1 : DivisorsPower

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13241&rd=16009 問題概要 関数 を の正の約数の個数を求める関数であるとする。また、関数 を と定める。 整数 が与えられる。 となる最小の を求めよ。そのような が存在しない場合は -1…

TopCoder, SRM 628, Division 1, Level 2 : CircuitsConstruction

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13237&rd=16009 問題概要 特殊な電気回路について考える。回路の構成は文字列で表される。 まず、単一の素子は一つの回路である。これは、文字列 "X" として表される。 また、二つの回路…

TopCoder, SRM 629, Division 2, Level 1 : RectangleCoveringEasy

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13363&rd=16060 問題概要 サイズが であるような長方形の穴がある。この穴を、サイズが であるような長方形の板で塞ぐ。板は回転されて使うこともできるが、板の辺は穴の辺に並行または直…

TopCoder, SRM 629, Division 2, Level 2 : CandyMaking

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13340&rd=16060 問題概要 個の容器があり、 番目の容器の容積は である。これらの容器全てを均一な密度の物体で満たしたい。ただし、 番目の容器の内容物の重さは、 に近付けたい。 容器…

TopCoder, SRM 629, Division 1, Level 1 : RectangleCovering

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13344&rd=16060 問題概要 サイズが である長方形の穴がある。また、長方形の板を複数枚もっていて、 番目の板のサイズは である。この板たちを使って穴を塞ぎたい。板は回転させて配置し…

TopCoder, SRM 627, Division 2, Level 3 : BubbleSortWithReversals

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13256&rd=16008 問題概要 整数列 が与えられる。高々 個のオーバーラップしない の連続する部分列を反転させる操作をした後、 をバブルソートで昇順ソートする。発生する交換操作の回数を…

TopCoder, SRM 627, Division 2, Level 1 : ManySquares

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13277&rd=16008 問題概要 複数の棒があり、 番の棒の長さは である。これらの棒を使ってできるだけ多くの正方形を作りたい。ただし、1 つの辺には丁度 1 本の棒を使わなければならない。…

TopCoder, SRM 627, Division 2, Level 2 : HappyLetterDiv2

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13245&rd=16008 問題概要 英小文字からなる文字列 が与えられる。この文字列に対し、異なる二つの文字を選んで取り除く操作を繰り返し適用し、それ以上操作を適用できなくなった時点で終…

TopCoder, SRM 627, Division 1, Level 1 : HappyLetterDiv1

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13274&rd=16008 問題概要 英小文字からなる文字列 が与えられる。この文字列に対し、異なる二つの文字を選んで取り除く操作を繰り返し適用し、それ以上操作を適用できなくなった時点で終…

TopCoder, SRM 627, Division 1, Level 2 : GraphInversions

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13275&rd=16008 問題概要 頂点からなる無向・重み無しで連結なグラフが与えられる。辺の数は に等しく。 番目の辺は と を結んでいる。更に、各頂点には(頂点番号とは別に)整数値が割り…

TopCoder, SRM 626, Division 2, Level 1 : SumOfPower

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13230&rd=15859 問題概要 整数からなる列 が与えられる。 の全ての連続する部分列の総和を求めよ。

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