torus711 のアレ

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

2014-05-01から1ヶ月間の記事一覧

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 ] である。 また、各従業員は丁度…

TopCoder, SRM 619, Division 2, Level 2 : ChooseTheBestOne

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13146&rd=15852 問題概要 N 人の人がいて、1 から N に番号付けられている。N 人の人を円周上に並べ、Shiny が 1 番の人の前に立つ。その後、次の操作を N - 1 回適用する。 t 回目の操作…

TopCoder, SRM 619, Division 1, Level 1 : SplitStoneGame

問題文 http://community.topcoder.com/stat?c=problem_statement&pm=13113&rd=15852 問題概要 N 個の石の山があって、i 番の山には number[ i ] 個の石が含まれる。この石たちを使ったターン制の二人ゲームをする。各ターンは次の手順からなる。 2 つ以上の…

AtCoder Regular Contest #022, A : スーパーICT高校生

問題文 http://arc022.contest.atcoder.jp/tasks/arc022_1 問題概要 文字列 S が与えられる。S が部分列として "ICT" を含んでいるかどうか求めよ。ただし、大文字と小文字は区別しない。

AtCoder Regular Contest #022, B : 細長いお菓子

問題文 http://arc022.contest.atcoder.jp/tasks/arc022_2 問題概要 N 項からなる数列 A が与えられる。A の連続する部分列であって部分列に含まれる要素が相異なるものの内、長さが最大のものの長さを求めよ。

AtCoder Regular Contest #022, C : ロミオとジュリエット

問題文 http://arc022.contest.atcoder.jp/tasks/arc022_3 問題概要 N 頂点からなる木が与えられる。この木の最遠頂点対を一つ出力せよ。

Google Code Jam 2014, Round 1B, A : The Repeater

GCJ

問題文 http://code.google.com/codejam/contest/2994486/dashboard#s=p0 問題概要 N 個の文字列が与えられる。この文字列集合に対し、次の操作ができる。 一つの文字列 s を選んで、s 中のある文字 c を、連続する二つの c に置き換える 一つの文字列 s を…

Google Code Jam 2014, Round 1B, B : New Lottery Game

問題文 http://code.google.com/codejam/contest/2994486/dashboard#s=p1 問題概要 正整数 A, B, K が与えられる。a *1 *1:& は bitwise and を表す

Google Code Jam 2014, Round 1B, C : The Bored Traveling Salesman

問題文 http://code.google.com/codejam/contest/2994486/dashboard#s=p2 問題概要 N 個の街があって、それぞれの街は固有の郵便番号をもっている。また、いくつかの街の間は空路で結ばれていてる。 全ての街を訪れることができるように飛行機を予約したいが…

Codeforces #243, Division 2, A : Sereja and Mugs

問題文 http://codeforces.com/contest/426/problem/A 問題概要 容積が s である空のカップと、n 個のマグカップを使ったゲームをする。n 個のマグカップには最初水が入っていて、i 番のマグカップの内容量は である。各プレイヤーは一回ずつ、空でないマグ…

Codeforces #243, Division 2, B : Sereja and Mirroring

問題文 http://codeforces.com/contest/426/problem/B 問題概要 の行列に対する mirror 操作を、次のように定義する。 結果の行列のサイズは 結果の行列の上半分は、元になった行列と等しい 結果の行列の下半分は、元になった行列の行の順序を反転したもの …

Codeforces #243, Division 1, A ( Division 2, C ) : Sereja and Swaps

問題文 http://codeforces.com/contest/426/problem/C 問題概要 項数 n の数列 a と整数 k が与えられる。m( a ) を a の連続する部分列の和の最大値とし、a の二つの要素を交換する操作を最大 k 回できるとき、m( a ) の最大値はいくらか。 なお、 である。