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

TopCoder SRM 495 DIV 2

Problem Check 250 o 525 o 1000 - Rating 1172 -> 1272 Div1に!嬉しい!怖いけど! Problem 250 CarrotBoxesEasy Rabbit Hanako has N boxes of carrots numbered 0 through N-1. The i-th box contains carrots[i] carrots. She decides to eat K carrots…

TopCoder SRM 386 DIV 2

Problem Check Points 250 o 244.94 500 o 201.94 1000 - - 前回に引き続き、正解率の低いMediumを倒せた!調子いいじゃなイカ!TopCoder Statistics@uwitenpen @phyllo 250 500 Problem 250 TrophyShelf You have several trophies sitting on a shelf in a…

ルービックキューブで時計を作ってみた

もう昨年のことになりますが、http://www.fitc.ca/events/about/?event=112に遊びに行きまして、ActionScriptは最近やってないけど、なにか作るってやっぱり面白いなぁ、といろいろと感銘を受けました。 その中で、中村勇吾さんの発表でハンドクロックという…

TopCoder SRM 387 DIV 2

Problem Check Points 250 o 242.05 600 o 199.45 1000 - - 600が解けて、僕満足!TopCoder Statistics@uwitenpen Problem 250 GuessingNextElement An integer arithmetic progression is a sequence defined by two positive integers, p and q, where p i…

Project Euler 102

3つの異なる点が -1000 ≤ x, y ≤ 1000 かつ三角形となるように, デカルト平面上にランダムに与えられる.以下の2つの三角形を考える.A(-340,495), B(-153,-910), C(835,-947) X(-175,41), Y(-421,-714), Z(574,-645) 三角形ABCが原点を内部に含み, XYZは原点…

Project Euler 65

2の平方根は無限連分数として書くことができる。(図:略)無限連分数である√2 = [1;(2)]と書くことができるが、(2)は2が無限に繰り返されることを示す。同様に、√23 = [4;(1,3,1,8)]。平方根の部分的な連分数の数列から良い有理近似が得られることが分かる。√…

Project Euler 85

注意深く数えると, 横が3, 縦が2の長方形の格子には, 18個の長方形が含まれている.ぴったり2,000,000個の長方形を含むような長方形の格子は存在しない. 一番近い解を持つような格子の面積を求めよ. 最初はDPで考えたんだけど、保存しておく必要が全然ないこ…

Project Euler 74

145は各桁の階乗の和が145と自分自身に一致することで有名である.1! + 4! + 5! = 1 + 24 + 120 = 145. 169の性質はあまり知られていない. これは169に戻る数の中で最長の列を成す. このように他の数を経て自分自身に戻るループは3つしか存在しない.169 → 363…

Project Euler 206

二乗すると「1_2_3_4_5_6_7_8_9_0」の形となるような唯一の正整数を求めよ。ただし、「_」は1桁の数である。 こんなコードを書いてしまってすいません。 1と2の間が9だってのが悪質です。

TopCoder SRM 388 DIV 2

Problem Check Points 250 x - 500 o ? 1000 x - なにも おぼえてないTopCoder Statistics Problem 250 MonotoneSequence A strictly increasing sequence is a sequence of numbers where each number is strictly greater than the previous one. A strict…

Project Euler 51

*57の第1桁を置き換えることで, 157, 257, 457, 557, 757, 857という6つの素数が得られる.56 **3の第3桁と第4桁を同じ数で置き換ることを考えよう. この5桁の数は7つの素数をもつ最初の例である: 56003, 56113, 56333, 56443, 56663, 56773, 56993. よって, …

TopCoder SRM 394 DIV 2

Problem Check Points 250 o 144.51 500 o 312.32 1000 - - 500が解けて僕満足! Problem 250 MountainWalk You are in a mountainous area which is represented by a String[] areaMap. The j-th character of the i-th element of the areaMap is a digit…

TopCoder SRM 396 DIV 2

Problem Check Points 250 o 196.25 500 - - 1000 - - 500、とんでもない勘違いをしててうわぁぁあああ@uwitenpen Problem 250 VerifyCreditCard You are developing an application for online transactions and you want to accept several credit cards. …

TopCoder SRM 398 DIV 2

Problem Check Points 250 o 237.52 500 x - 900 o 524.99 55分ぐらいで完走。まあ500は凡ミスしてしまったけど、全体的にはよかったと思います。TopCoder Statistics@uwitenpen

TopCoder SRM 399 DIV 2

Problem Check Points 250 o 221.74 500 o 452.09 1000 - 330.03 500を過去最高のスピードで解けたので良かった。TopCoder Statistics@uwitenpen

Project Euler 76

5は数の和として6通りに書くことができる:4 + 1 3 + 2 3 + 1 + 1 2 + 2 + 1 2 + 1 + 1 + 1 1 + 1 + 1 + 1 + 1 2つ以上の正整数の和としての100の表し方は何通りか. 悩んだ。@phylloさんのご助言により。

Project Euler 62

立方数 41063625 (3453) は, 桁の順番を入れ替えると2つの立方数になる: 56623104 (3843) と 66430125 (4053) である. 41063625は, 立方数になるような桁の置換をちょうど3つもつ最小の立方数である.立方数になるような桁の置換をちょうど5つもつ最小の立方…

TopCoder SRM 491 DIV 2

Problem Check Points 250 o 242.42 500 o 202.60 1000 - - Challenges - 0.00 Rate: 1058 -> 1115前回に引き続き500が解けた。本番運がいい。@phyllo @matsu4512

TopCoder SRM 490 DIV 2

Problem Check Points 250 o 244.19 500 o 219.04 1000 - - Challenge - 50.00 Rate: 926 -> 1058過去最高の出来。500がうまく解けた。Login - TopCoder Wiki @matsu4512 @aaharu

TopCoder SRM 400 DIV 2

Problem Check Points 250 o 205.19 500 x - 1000 - - TopCoder Statistics@uwitenpen

Project Euler 112

左から右までどの桁もその左の桁を上回らない数を増加数と呼ぶ。例えば、134468。同様に、どの桁もその右の桁を上回らない数を減少数と呼ぶ。例えば、66420。増加数でも減少数でもない正の整数を「活発な」数と呼ぶことにする。例えば、155349。100以下の数…

Project Euler 73

nとdを正の整数として, 分数 n/d を考えよう. n 弱い。5分もかかってない #include <iostream> using namespace std; int gcd(int a, int b) { while (a>0 && b>0) if (a>b) a%=b; else b%=a; return a+b; } int main(){ const double a1 = (double)1/3; const double </iostream>…