<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xml:lang="ja">
	<channel>
		<title>not&#39;s memo</title>
		<link>http://topcoder.g.hatena.ne.jp/not522/</link>
		<description>not&#39;s memo</description>
		<dc:creator>not522</dc:creator>


		<item>
			<title>yukicoder No.262 面白くないビットすごろく</title>
			<link>https://topcoder.g.hatena.ne.jp/not522/20150806/1438872489</link>

			<description><![CDATA[
		<div class="section">
			<p>出題しようと準備していた問題が想定<a class="keyword" href="https://topcoder.g.hatena.ne.jp/keyword/TLE">TLE</a>解法で出題されてしまって、とても悲しい気分になったので解説を書きました。。。</p>			<br>

			<h4>用意していた問題</h4>
			<p>Xから立ってるビットの数だけ足すというのをK回くりかえすと何になるか？</p>
			<p>X,KはT個与えられる。</p>
			<p>X,K&lt;10^17, T&lt;10^5</p>			<br>

			<h4>解法</h4>
			<a name="seemore"></a>

			<p class="share-button sectionfooter"><a href="http://b.hatena.ne.jp/entry/https://topcoder.g.hatena.ne.jp/not522/%23" class="hatena-bookmark-button" data-hatena-bookmark-title="2015-08-06" data-hatena-bookmark-layout="standard" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script><a href="http://twitter.com/share" class="twitter-share-button" data-lang="ja" data-count="none" data-url="https://topcoder.g.hatena.ne.jp/not522/#" data-text="2015-08-06 - not&#39;s memo (id:not522 / @not_522)">ツイートする</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js" charset="utf-8"></script><iframe src="http://www.facebook.com/plugins/like.php?href=https%3A%2F%2Ftopcoder.g.hatena.ne.jp%2Fnot522%2F%23&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></p>

		</div>
]]></description>

			<dc:creator>not522</dc:creator>

			<pubDate>Thu, 06 Aug 2015 14:48:09 GMT</pubDate>



		</item>

		<item>
			<title>ICPC2015国内予選「G問題」参加記</title>
			<link>https://topcoder.g.hatena.ne.jp/not522/20150627/1435332636</link>

			<description><![CDATA[
		<div class="section">
			<p>ひっくり返して線分の集合にバラして双対となる多角形の集合を求めて外周を決めるだけ。</p>
			<p>ライブラリ除いて50行くらい。サンプルは通った。</p>
			<a name="seemore"></a>

			<p class="share-button sectionfooter"><a href="http://b.hatena.ne.jp/entry/https://topcoder.g.hatena.ne.jp/not522/%23" class="hatena-bookmark-button" data-hatena-bookmark-title="2015-06-27" data-hatena-bookmark-layout="standard" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script><a href="http://twitter.com/share" class="twitter-share-button" data-lang="ja" data-count="none" data-url="https://topcoder.g.hatena.ne.jp/not522/#" data-text="2015-06-27 - not&#39;s memo (id:not522 / @not_522)">ツイートする</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js" charset="utf-8"></script><iframe src="http://www.facebook.com/plugins/like.php?href=https%3A%2F%2Ftopcoder.g.hatena.ne.jp%2Fnot522%2F%23&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></p>

		</div>
]]></description>

			<dc:creator>not522</dc:creator>

			<pubDate>Fri, 26 Jun 2015 15:30:36 GMT</pubDate>



		</item>

		<item>
			<title>幾何の小手先テクn選</title>
			<link>https://topcoder.g.hatena.ne.jp/not522/20141209/1418131138</link>

			<description><![CDATA[
		<div class="section">
			<p>これは、<a href="http://partake.in/events/9b53847a-3a97-4aac-b754-5e681c3c7197" target="_blank">Competitive Programming Advent Calendar Div2014</a>の9日目の記事です。</p>
			<h4>誤差</h4>
			<h5>typedef double Real;</h5>
			<p>誤差死したときはlong doubleにし、<a class="keyword" href="https://topcoder.g.hatena.ne.jp/keyword/TLE">TLE</a>したときはdoubleにできるように最初からtypedefしておくと便利です。</p>
			<h5>EPSゲー</h5>
			<p>座標の範囲が[-1000:1000]だとEPS=1e-8を使うというのを基準にしていて、相対誤差っぽく[-10000:10000]だとEPS=1e-7とかにすると苦しむことが減ります。</p>
			<h4>縮退</h4>
			<h5>回転</h5>
			<p>与えられた全ての点を原点を中心に少しだけ回転させる。</p>
			<p>スラブ分割（コンピュータ・ジオメトリ P.149）する時など、x座標が同じ頂点があって縮退している場合に縮退が解けます。</p>
			<p>例題：<a href="http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2433" target="_blank">最終防衛線</a></p>
			<h5>(x,y)-&gt;(x+α*y,y)</h5>
			<p>上と同じタイプの縮退が解けます。</p>
			<h5>乱数</h5>
			<p>座標に小さな乱数（ただしEPSよりは十分大きい）を追加して縮退を解く。</p>
			<p>例題：<a href="http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2482" target="_blank">Exportation in Space</a></p>
			<p>ただし、実際に値を出すときは縮退前の座標を使わないとちょっとずれて<a class="keyword" href="https://topcoder.g.hatena.ne.jp/keyword/WA">WA</a>の原因になります。</p>
			<h5>記号摂動</h5>
			<p>小手先でゎない。</p>
			<h4>便利関数</h4>
			<h5>sign</h5>
			<p>混乱を避けるため、EPSはこの関数以外では使わないようにしています。</p>
<pre class="syntax-highlight">
<span class="synType">inline</span> <span class="synType">int</span> sgn(Real a, Real b = <span class="synConstant">0</span>) {<span class="synStatement">return</span> a &amp;#<span class="synConstant">60</span>; b - EPS ? -<span class="synConstant">1</span> : a &amp;#<span class="synConstant">62</span>; b + EPS ? <span class="synConstant">1</span> : <span class="synConstant">0</span>;}
<span class="synType">inline</span> <span class="synType">bool</span> near(Point a, Point b) {<span class="synStatement">return</span> !sgn(abs(a - b));}
</pre>

			<h5>vec</h5>
<pre class="syntax-highlight">
<span class="synType">inline</span> Point vec(<span class="synType">const</span> Line&amp;#<span class="synConstant">38</span>; a) {<span class="synStatement">return</span> a.b - a.a;}
</pre>

			<h5>角度</h5>
<pre class="syntax-highlight">
<span class="synType">inline</span> Real arg(<span class="synType">const</span> Point&amp;#<span class="synConstant">38</span>; base, <span class="synType">const</span> Point&amp;#<span class="synConstant">38</span>; a, <span class="synType">const</span> Point&amp;#<span class="synConstant">38</span>; b) {<span class="synStatement">return</span> arg((b - base) / (a - base));}
</pre>

			<h5>sqrt</h5>
			<p> -EPSを突っ込んで死ぬのを回避。</p>
<pre class="syntax-highlight">
<span class="synType">inline</span> Real sr(Real a) {<span class="synStatement">return</span> sqrt(max(a, (Real)<span class="synConstant">0</span>));}
</pre>

			<h4>その他</h4>
			<h5>c.c+polar(c.r, PI/2*i)</h5>
			<p>円と線分をグラフに落とすときにc.c+polar(c.r, PI/2*i)を頂点に追加しておくと便利なことがあります。</p>
			<p>例題：<a href="http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2484" target="_blank">Magnum Tornado</a></p>
			<p>円周上をPI/2以下しか動かないのでどっちから来たか簡単に分かります。</p>
			<h5>モンテカルロ法</h5>
			<p>どんな面積でも簡単に求められることで有名。</p>
			<p>というのはさすが冗談で、例えばサブミットデバッグするときに答えが大きくずれているかのチェックができたりします。</p>
			<p class="share-button sectionfooter"><a href="http://b.hatena.ne.jp/entry/https://topcoder.g.hatena.ne.jp/not522/%23" class="hatena-bookmark-button" data-hatena-bookmark-title="2014-12-09" data-hatena-bookmark-layout="standard" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script><a href="http://twitter.com/share" class="twitter-share-button" data-lang="ja" data-count="none" data-url="https://topcoder.g.hatena.ne.jp/not522/#" data-text="2014-12-09 - not&#39;s memo (id:not522 / @not_522)">ツイートする</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js" charset="utf-8"></script><iframe src="http://www.facebook.com/plugins/like.php?href=https%3A%2F%2Ftopcoder.g.hatena.ne.jp%2Fnot522%2F%23&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></p>

		</div>
]]></description>

			<dc:creator>not522</dc:creator>

			<pubDate>Tue, 09 Dec 2014 13:18:58 GMT</pubDate>



		</item>

		<item>
			<title>ハル研究所プログラミングコンテスト2014参加記</title>
			<link>https://topcoder.g.hatena.ne.jp/not522/20141128/1417136336</link>

			<description><![CDATA[
		<div class="section">
			<p>※この記事は結果発表前に書いています</p>			<br>

			<h4>提出したコード</h4>
			<p><a href="https://gist.github.com/not522/9a398898d258b24a4512" target="_blank">https://gist.github.com/not522/9a398898d258b24a4512</a></p>			<br>

			<h4>方針</h4>
			<p>忙しくて時間がなかった（実際にかけた時間は12時間くらい）ので楽に点数が上がりそうなのだけ実装する</p>
			<p>そもそもかなり自由度が低いゲームなので、貪欲でもそこそこの点数が得られそうと予想していた</p>			<br>

			<h4>やったこと</h4>
			<h5>Parameter::CharaAddAccelWaitTurnごとくらいで加速</h5>
			<p>player.accelCount()を見て適宜調整</p>
			<p>基本的には2個くらい残す</p>
			<p>離れていってるなら残り1個だろうと加速</p>
			<h5>最後の一手なら加速</h5>			<br>

			<h5>加速なしで次の蓮に到達できるならそのまま</h5>			<br>

			<h5>次の蓮の位置を考慮して速度ベクトルを決める</h5>
			<p>きちんと出す（TODO昔書いた記事のURLを書く）のが面倒だったのでてきとう</p>
			<h5>流れを考慮</h5>
			<p>てきとう（-2*field.flowVel()）にやった</p>
			<h5>加速しなくても目標の蓮に同じターン数以下で到達できるなら加速しない</h5>			<br>

			<h5>加速したら次のターンで先輩忍者にぶつかる場合は加速回数が余っていない限り加速しない</h5>			<br>

			<h4>やってないこと</h4>
			<h5>蓮の位置を考慮して何回ごと加速すればよいか決める</h5>
			<p>ちゃんとやれば1〜2万点はあがりそう</p>
			<p>上位と差が付いたのはたぶんここ</p>
			<h5>len(hoge)をメモ</h5>
			<p>すぐできるし、これはやったほうが良かった（ボトルネックになってる）</p>
			<h5>スタート直後の最適化</h5>
			<p>無理でしょ</p>
			<h5>ゴール直前の最適化</h5>
			<p>めんどいんじゃ</p>
			<h5>流れをちゃんと考える</h5>
			<p>めんどいｎ（ｒｙ</p>
			<h5>先輩忍者をちゃんと考える</h5>
			<p>めんｄ（ｒｙ</p>
			<h5>次の次の蓮をちゃんと考える</h5>
			<p>ｍ（ｒｙ</p>			<br>

			<h4>マジックナンバー</h4>
			<h5>10ターンごとに加速</h5>
			<p>Parameter::CharaAddAccelWaitTurn</p>
			<h5>-2*field.flowVel()</h5>
			<p>2*Σ_{i=0}^9(0.875-0.0625*i)/0.875が13.5くらいなのでnormalizeとかすれば10くらいになって良さそう</p>
			<p>ちゃんと確かめたわけじゃないのでてきとう</p>
			<h5>その他</h5>
			<p>100ステージ×100ケースでパラメタ調整した</p>
			<p class="share-button sectionfooter"><a href="http://b.hatena.ne.jp/entry/https://topcoder.g.hatena.ne.jp/not522/%23" class="hatena-bookmark-button" data-hatena-bookmark-title="2014-11-28" data-hatena-bookmark-layout="standard" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script><a href="http://twitter.com/share" class="twitter-share-button" data-lang="ja" data-count="none" data-url="https://topcoder.g.hatena.ne.jp/not522/#" data-text="2014-11-28 - not&#39;s memo (id:not522 / @not_522)">ツイートする</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js" charset="utf-8"></script><iframe src="http://www.facebook.com/plugins/like.php?href=https%3A%2F%2Ftopcoder.g.hatena.ne.jp%2Fnot522%2F%23&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></p>

		</div>
]]></description>

			<dc:creator>not522</dc:creator>

			<pubDate>Fri, 28 Nov 2014 00:58:56 GMT</pubDate>



		</item>

	</channel>
</rss>
