<?xml version="1.0" encoding="UTF-8" ?>
<feed xml:lang="ja" xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
  <title type="text">Obscure</title>
  <subtitle type="html">メモと予復習</subtitle>
  <link rel="self" type="application/atom+xml" href="http://tkzw.kuizu.net/atom"/>
  <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/"/>
  <updated>2013-09-24T22:32:57+09:00</updated>
  <author><name>tkzw_21</name></author>
  <generator uri="//www.ninja.co.jp/blog/" version="0.9">忍者ブログ</generator>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" />
  <entry>
    <id>tkzw.kuizu.net://entry/17</id>
    <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/%E9%9B%91%E8%A8%98/2048ai" />
    <published>2014-08-26T21:51:00+09:00</published> 
    <updated>2014-08-26T21:51:00+09:00</updated> 
    <category term="雑記" label="雑記" />
    <title>2048AI</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[6月頃に書いた2048のAIのソースコードをうｐします。<br />
<br />
2048についてはこちらで実際にやってみてください。<br />
<a href="http://gabrielecirulli.github.io/2048/" title="" target="_blank">http://gabrielecirulli.github.io/2048/</a><br />
<br />
3手先まで、空きマスが4マス未満になったら4手先まで（にしてるけどあんまり意味なさそう）<br />
ミニマックス法（？）で探索してるつもり。<br />
<br />
盤面の評価は<br />
1.隣り合うタイルの数値の差が小さいほど良い。<br />
2.左上に大きい数字があるほど良い。<br />
で決定しています。<br />
<br />
ちゃんと実装できていない可能性大です。<br />
<br />
一応1024までは安定、時々2048・4096ぐらいの精度です。<br />
<br />
ソースはこちら<br />
<a href="https://gist.github.com/tkzw21/26360f174e2055e994df" title="" target="_blank">https://gist.github.com/tkzw21/26360f174e2055e994df</a>]]> 
    </content>
    <author>
            <name>tkzw_21</name>
        </author>
  </entry>
  <entry>
    <id>tkzw.kuizu.net://entry/16</id>
    <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/%E9%9B%91%E8%A8%98/%E5%8D%98%E4%BD%93%E6%B3%95%EF%BC%88%E5%88%86%E6%95%B0%E3%81%A7%E8%A8%88%E7%AE%97%EF%BC%89" />
    <published>2014-07-21T21:10:17+09:00</published> 
    <updated>2014-07-21T21:10:17+09:00</updated> 
    <category term="雑記" label="雑記" />
    <title>単体法（分数で計算）</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[<br />
数理計画法の課題用に書きました。<br />
<br />
非常に汚いので夏に書き直します。<br />
<br />

<div><a href="http://ideone.com/G58Cxh" title="" target="_self">http://ideone.com/G58Cxh</a></div>]]> 
    </content>
    <author>
            <name>tkzw_21</name>
        </author>
  </entry>
  <entry>
    <id>tkzw.kuizu.net://entry/15</id>
    <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/%E9%9B%91%E8%A8%98/%E3%83%A1%E3%83%A2%E3%83%AA%E3%81%AE%E7%A2%BA%E4%BF%9D%E5%A0%B4%E6%89%80%E3%81%AE%E3%83%A1%E3%83%A2" />
    <published>2014-06-21T13:38:28+09:00</published> 
    <updated>2014-06-21T13:38:28+09:00</updated> 
    <category term="雑記" label="雑記" />
    <title>メモリの確保場所のメモ</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[<br />
前の方にあるのがスッタク領域で<br />
後ろの方にあるのがヒープ領域ってことかな。<br />
<br />

<pre><code>
#include&lt;string&gt;
#include&lt;cstdio&gt;
#include&lt;iostream&gt;

using namespace std;

int ga;
int garray[10];
int main(){
	int a;
	int* array = new int[10];

	string s;
	s += \'a\';

	printf(\"ga\'s  address     = %p\\n\",&amp;a);
	printf(\"a\'s  address      = %p\\n\",&amp;ga);
	printf(\"array\'s  address  = %p\\n\",array);
	printf(\"garray\'s  address = %p\\n\",&amp;garray);
	printf(\"s\'s  address      = %p\\n\",&amp;s);
	printf(\"s[0]\'s  address   = %p\\n\",&amp;s[0]);

	return 0;
}
</code>
</pre>
<pre>実行結果
ga's  address    = 0x22aa74
a's  address    = 0x100406020
array's  address    = 0x600028730
garray's  address    = 0x100406040
s's  address    = 0x22aa60
s[0]'s  address    = 0x600061ce8
</pre>]]> 
    </content>
    <author>
            <name>tkzw_21</name>
        </author>
  </entry>
  <entry>
    <id>tkzw.kuizu.net://entry/14</id>
    <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/topcoder/srm618%20div2%20easy-med" />
    <published>2014-04-27T19:09:07+09:00</published> 
    <updated>2014-04-27T19:09:07+09:00</updated> 
    <category term="topcoder" label="topcoder" />
    <title>SRM618 div2 easy,med</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[<h3>問題文</h3>
<a href="http://community.topcoder.com/stat?c=problem_statement&amp;pm=13072" title="">http://community.topcoder.com/stat?c=problem_statement&amp;pm=13072</a><br />
<a href="http://community.topcoder.com/stat?c=problem_statement&amp;pm=13147" title="">http://community.topcoder.com/stat?c=problem_statement&amp;pm=13147</a>
<h4>Easy</h4>
タップするとアルファベット順に進む携帯がある。<br />
入力に対し何回タップすればいいか合計を返せ。
<h4>Med</h4>
1.全部大文字<br />
2.同じ文字が連続しない<br />
3.xyxyのような部分列が存在しない(x,y&isin;文字)<br />
1~3を与えられた文字列が満たすかどうか返せ。<br />

<h3>感想とか</h3>
<h4>Easy</h4>
文字コードで足してくだけ。<br />

<h4>Med</h4>
スマートじゃなく雑に全探索しました。<br />
<a href="http://ideone.com/MKkvRp" title="" target="_blank">http://ideone.com/MKkvRp</a>]]> 
    </content>
    <author>
            <name>tkzw_21</name>
        </author>
  </entry>
  <entry>
    <id>tkzw.kuizu.net://entry/13</id>
    <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/topcoder/srm612%20div2%20500" />
    <published>2014-03-27T13:58:42+09:00</published> 
    <updated>2014-03-27T13:58:42+09:00</updated> 
    <category term="topcoder" label="topcoder" />
    <title>SRM612 div2 500</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[<h3><span style="color: #c0c0c0;">問題文</span></h3>
<a href="http://community.topcoder.com/stat?c=problem_statement&amp;pm=13041" title="" target="_self">http://community.topcoder.com/stat?c=problem_statement&amp;pm=13041</a><br />
<em><br />
smiles</em>個絵文字を入力したいとき、<br />
・今入力されている絵文字を全部クリップボードへコピーする。<br />
・クリップボードからペーストする。<br />
の2種類の操作ができる。<br />
操作する回数の最小値を求めよ。（絵文字は最初に1個入力されている）<br />
<br />
<hr />
<h3><span style="color: #c0c0c0;">感想</span></h3>
DFSが使えて嬉しかったので久々の更新ｗ<br />
（間違っているかもしれません。）<br />
<br />

<div style="padding: 10px; margin-bottom: 10px; border: 1px solid #333333;">
<pre><code>
class EmoticonsDiv2 {

	public:
	int printSmiles(int smiles) {
		int ans;
		ans = dfs(1,2,smiles);
		return ans+2;
	}

	int dfs(int clip,int now,int goal){
		int ret = INF;

		if(now == goal)return 0;
		if(now &gt; goal)return INF;
		for(int i=0;i&lt;2;i++){
			if(i==1)ret = min(ret,dfs(clip,now+clip,goal)+1);
			if(i==0)ret = min(ret,dfs(now,now+now,goal)+2);
		}
		return ret;
	}
};
</code>
</pre>
</div>]]> 
    </content>
    <author>
            <name>tkzw_21</name>
        </author>
  </entry>
  <entry>
    <id>tkzw.kuizu.net://entry/12</id>
    <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/topcoder/srm605%20div2%20250-500" />
    <published>2014-01-24T08:39:46+09:00</published> 
    <updated>2014-01-24T08:39:46+09:00</updated> 
    <category term="topcoder" label="topcoder" />
    <title>SRM605 div2 250,500</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[<h3>問題文</h3>
<h4>Easy</h4>
<a href="http://community.topcoder.com/stat?c=problem_statement&amp;pm=12950" title="">http://community.topcoder.com/stat?c=problem_statement&amp;pm=12950</a><br />
文字列Sのうちどこか１文字消すとき何通りの文字列ができるか。<br />

<h4>Meidium</h4>
<a href="http://community.topcoder.com/stat?c=problem_statement&amp;pm=12821" title="">http://community.topcoder.com/stat?c=problem_statement&amp;pm=12821</a><br />
<br />
長方形の盤面が黒か白に塗られている。<br />
１行分の色を反転する操作を何回かしたときにできる<br />
最大の正方形の面積を求めよ。<br />
<br />
<hr />
<h3>感想</h3>
<h4>Easy</h4>
文字が変わった回数をカウントして、プラス１。<br />

<h4>Medium</h4>
全探索で間に合うみたいだからごり押し。<br />

<h4>Hard</h4>
解けません(&acute;・&omega;・`)<br />
<br />
<br />

<div style="padding: 10px; margin-bottom: 10px; border: 1px solid #333333;">
<pre><code>
#include&lt;iostream&gt;
#include&lt;string&gt;

using namespace std;

class AlienAndPassword{
public:
	int getNumber(string S){
		int cnt=0;
		for(int i=1;i&lt;S.size();i++){
			if(S[i-1] != S[i]) cnt++;
		}
		return cnt+1;
	}
};
</code>
</pre>
</div>
<div style="padding: 10px; margin-bottom: 10px; border: 1px solid #333333;">
<pre><code>
#include&lt;iostream&gt;
#include&lt;string&gt;
#include&lt;vector&gt;
#include&lt;algorithm&gt;

using namespace std;

class AlienAndGame{
public:
	int getNumber(vector&lt;string&gt; board){
		int MAX;
		int ans=1;
		MAX = min(board[0].size(),board.size());
		
		for(int length=1;length&lt;=MAX;length++){
		
		for(int i=0;i&lt;board.size()-length+1;i++){
			for(int j=0;j&lt;board[0].size()-length+1;j++){
			
				int fuga=0;
				
				for(int k=0;k&lt;length;k++){
					int hoge=0;
					for(int l=0;l&lt;length-1;l++){
						if(board[i+k][j+l] == board[i+k][j+l+1])
							hoge++;
					}
					if(hoge+1==length)fuga++;
				}
				if(fuga==length)ans=length;
			}
		}}
		return ans*ans;
	}
};
</code>
</pre>
</div>]]> 
    </content>
    <author>
            <name>tkzw_21</name>
        </author>
  </entry>
  <entry>
    <id>tkzw.kuizu.net://entry/11</id>
    <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/topcoder/srm604%20div2%20medium" />
    <published>2014-01-19T21:45:08+09:00</published> 
    <updated>2014-01-19T21:45:08+09:00</updated> 
    <category term="topcoder" label="topcoder" />
    <title>SRM604 div2 500</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[<h3>問題文</h3>
<a href="http://community.topcoder.com/stat?c=problem_statement&amp;pm=12952" title="" target="_self">http://community.topcoder.com/stat?c=problem_statement&amp;pm=12952</a><br />
<br />
ゴールである(x,y)座標が与えられる。<br />
kターン目には上か右に3^k分進まなければならないとすると、(kは0から)<br />
ゴールには辿り着けるか返せ。<br />
<hr />
<h3>感想</h3>
本番の時は2^kならXOR?とかで解けるのにとか思っていましたが、<br />
3^kでも同じようなものだとChallengeの時に気づきました。<br />
<br />

<div style="padding: 10px; margin-bottom: 10px; border: 1px solid #333333;">
<pre><code>
#include &lt;algorithm&gt;
#include &lt;iostream&gt;
#include &lt;map&gt;
#include &lt;numeric&gt;
#include &lt;set&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define FORIT(i,c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define ISEQ(c) (c).begin(), (c).end()

class PowerOfThreeEasy {

	public: string ableToGet(int x, int y) {
		while(1){
			if((x%3==0&amp;&amp;y%3==1)||(x%3==1&amp;&amp;y%3==0)){
				x/=3;
				y/=3;
			}
			else{
				if(x==0&amp;&amp;y==0)return "Possible";
				return "Impossible";
			}
		}
	}

};

</code>
</pre>
</div>]]> 
    </content>
    <author>
            <name>tkzw_21</name>
        </author>
  </entry>
  <entry>
    <id>tkzw.kuizu.net://entry/10</id>
    <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/gale-shapley/%E5%AE%89%E5%AE%9A%E7%B5%90%E5%A9%9A%E5%95%8F%E9%A1%8C" />
    <published>2014-01-13T21:59:36+09:00</published> 
    <updated>2014-01-13T21:59:36+09:00</updated> 
    <category term="Gale-Shapley" label="Gale-Shapley" />
    <title>安定結婚問題</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[<h2><span style="text-decoration: underline;"><span style="color: #333399; text-decoration: underline;">安定結婚問題</span></span></h2>
詳しくは<a href="http://ja.wikipedia.org/wiki/%E5%AE%89%E5%AE%9A%E7%B5%90%E5%A9%9A%E5%95%8F%E9%A1%8C" title="" target="_blank">Wikipedia</a>を見てもらいたい。<br />
大雑把に言うと、男女それぞれ異性の好みのランキングのリストを渡された時、<br />
浮気しないようなペアを作ってくださいみたいな問題。<br />
そのペアをブロッキングペアというらしい。<br />
<br />
これはGale-Shapleyアルゴリズムを用いて解くことができる。<br />
Shapleyさんはノーベル経済学賞受賞してるっぽい。<br />
<br />
暇だったので0から書いてみた。<br />
考えながら書いてたらぐちゃぐちゃになった。<br />
間違ってる可能性大。<br />
<br />

<div style="padding: 10px; margin-bottom: 10px; border: 1px solid #333333;">
<pre><code>
#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
#include &lt;functional&gt;
#include &lt;climits&gt;
#include &lt;algorithm&gt;
#include &lt;map&gt;
#include &lt;cstdio&gt;
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;
#define N 4
#define M 20
//N要素数
//M=シャッフルする回数

using namespace std;
bool check(int v[N]){
	for(int i=0;i&lt;N;i++){
		if(v[i]==N)return true;
	}
	return false;
}
void showList(int manRank[N][N],int womanSuki[N][N]){
	cout &lt;&lt; "男性希望リスト" &lt;&lt; endl;
	for(int i=0;i&lt;N;i++){
		cout &lt;&lt; i &lt;&lt; ":";
		for(int j=0;j&lt;N;j++){
			cout &lt;&lt; manRank[i][j];
			if(j!=N-1)cout &lt;&lt; ",";
		}
		cout &lt;&lt; endl;
	}

	cout &lt;&lt; "女性希望リスト" &lt;&lt; endl;
	int womanRank[N][N];
	for(int i=0;i&lt;N;i++){
			for(int j=0;j&lt;N;j++){
				womanRank[i][womanSuki[i][j]]=j;
		}
	}
	for(int i=0;i&lt;N;i++){
			cout &lt;&lt; i &lt;&lt; ":";
			for(int j=0;j&lt;N;j++){
				cout &lt;&lt; womanRank[i][j];
				if(j!=N-1)cout &lt;&lt; ",";
			}
			cout &lt;&lt; endl;
		}
}
void showMatch(int manMarriage[N],int womanMarriage[N]){
	cout &lt;&lt; "男性-女性" &lt;&lt; endl;
	for(int i=0;i&lt;N;i++){
		cout &lt;&lt; i &lt;&lt; "-" &lt;&lt; manMarriage[i] &lt;&lt; endl;
	}
}

int main(){
	int manRank[N][N];
	int womanSuki[N][N];
	srand((unsigned) time(NULL));
	for(int i=0;i&lt;N;i++){
			for(int j=0;j&lt;N;j++){
				manRank[i][j]=j;
				womanSuki[i][j]=j;
			}
	}
	for(int i=0;i&lt;N;i++){
		for(int j=0;j&lt;M;j++){
			int hoge;
			int c1=rand() % N;
			int c2=rand() % N;
			hoge = manRank[i][c1];
			manRank[i][c1]=manRank[i][c2];
			manRank[i][c2]=hoge;
			c1=rand() % N;c2=rand() % N;
			hoge = womanSuki[i][c1];
			womanSuki[i][c1]=womanSuki[i][c2];
			womanSuki[i][c2]=hoge;
		}
	}
	showList(manRank,womanSuki);
	//誰と結婚しているか
	int womanMarriage[N];
	int manMarriage[N];
	//プロポーズ回数
	int manDraft[N];
	for(int i=0;i&lt;N;i++){
		womanMarriage[i]=N;
		manMarriage[i]=N;
		manDraft[i]=0;
	}

	//独身男性がいる限りループ
	int cnt=0;
	while(check(manMarriage)){

		for(int i=0;i&lt;N;i++){
			if(manMarriage[i]==N){//iが未婚男性の場合
				int hope = manRank[i][manDraft[i]];//希望女性
				if(womanMarriage[hope]==N){//希望女性が未婚
					manMarriage[i]=hope;			//結婚
					womanMarriage[hope]=i;
					manDraft[i]++;
				}
				else{//希望女性が既婚
					if(womanSuki[hope][i]&lt;womanSuki[hope][womanMarriage[hope]]){//女性にとって今プロポーズされた男性の方が良い時
						manMarriage[womanMarriage[hope]]=N;//NTRれた人は未婚に
						womanMarriage[hope]=i;				//結婚しなおし
						manMarriage[i]=hope;
						manDraft[i]++;
					}
					else{//NTR失敗
						manDraft[i]++;//プロポーズカウント
					}
				}
			}
		}
	}
	showMatch(manMarriage,womanMarriage);
	return 0;
}

</code>
</pre>
</div>]]> 
    </content>
    <author>
            <name>tkzw_21</name>
        </author>
  </entry>
  <entry>
    <id>tkzw.kuizu.net://entry/9</id>
    <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/topcoder/srm604%20div2%20easy" />
    <published>2014-01-12T20:56:34+09:00</published> 
    <updated>2014-01-12T20:56:34+09:00</updated> 
    <category term="topcoder" label="topcoder" />
    <title>SRM604 div2 easy</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[<h3><span style="text-decoration: underline;"><span style="color: #333399; text-decoration: underline;">問題文</span></span></h3>
<a href="http://community.topcoder.com/stat?c=problem_statement&amp;pm=12953"></a><a href="http://community.topcoder.com/stat?c=problem_statement&amp;pm=12953">http://community.topcoder.com/stat?c=problem_statement&amp;pm=12953</a><br />
<br />
空でない文字列がいくつか渡される。<br />
文字列を二分割してそれを入れ替えた時同じものに<br />
なるものをカウントして返せ。<br />
<br />
例："tokyo","kyoto"<br />
tokyo = to + kyo　&rarr;　kyo + to = kyoto<br />
このようなのをカウント。<br />
<hr />
<h3><span style="text-decoration: underline;"><span style="color: #333399; text-decoration: underline;">解法</span></span></h3>
Constraintsは文字列の数、文字列の長さがそれぞれ50である。<br />
よって全探索でも50^3程度にしかならない。<br />
<br />
<hr />
<h3><span style="text-decoration: underline;"><span style="color: #333399; text-decoration: underline;">反省</span></span></h3>
今回が本番初参戦だった。<br />
開催が遅かったので30分寝過ごしてしまった。<br />
練習の時、早く解くことを意識はしていたものの、時間制限を設けず<br />
やっていたので本番で焦ってしまった。<br />
初チャレンジもよく確認せず突っ込み-25点と<br />
いろいろと惨敗だった。<br />
<br />
なんだかんだやっぱり本番は楽しかったのでまた頑張りたい。<br />
<br />
<hr />
<div style="padding: 10px; margin-bottom: 10px; border: 1px solid #333333;">
<pre><code>
#include &lt;algorithm&gt;
#include &lt;iostream&gt;
#include &lt;map&gt;
#include &lt;numeric&gt;
#include &lt;set&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define FORIT(i,c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define ISEQ(c) (c).begin(), (c).end()

class FoxAndWord {

	public: int howManyPairs(vector&lt;string&gt; words) {
		int cnt=0;
		for(int i=0;i&lt;words.size()-1;i++){
			for(int j=i+1;j&lt;words.size();j++){

				if(words[i].size() == words[j].size()){
				for(int k=0;k&lt;words[i].size();k++){
					if(words[i].substr(k+1) + words[i].substr(0,k+1) == words[j]){
						cnt++;
						break;
					}
				}}
			}
		}

		return cnt;
	}

};
</code>
</pre>
</div>]]> 
    </content>
    <author>
            <name>tkzw_21</name>
        </author>
  </entry>
  <entry>
    <id>tkzw.kuizu.net://entry/8</id>
    <link rel="alternate" type="text/html" href="http://tkzw.kuizu.net/topcoder/srm603%20div2%20medium" />
    <published>2014-01-09T22:03:59+09:00</published> 
    <updated>2014-01-09T22:03:59+09:00</updated> 
    <category term="topcoder" label="topcoder" />
    <title>SRM603 div2 medium</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[<h3><span style="text-decoration: underline;"><span style="color: #333399; text-decoration: underline;">問題文</span></span></h3>
<a href="http://community.topcoder.com/stat?c=problem_statement&amp;pm=12939">http://community.topcoder.com/stat?c=problem_statement&amp;pm=12939</a><br />
<br />
要素数がNの配列Aがある。その中からN/2個のペアを作る。<br />
そのペアの中で積がX以上になる個数を求めよ。<br />
なお、Xは負の数であることが保証されている。<br />
<hr />
<h3><span style="text-decoration: underline;"><span style="color: #333399; text-decoration: underline;">解法</span></span></h3>
最初、A中に負の数の個数が何個あるか求めてから<br />
個数が奇数か偶数かとかで場合分けしようとしたが、<br />
ソートしてから、前から二個ずつペアにしていき、<br />
その積がXを超えている個数をカウントしていけば解けることに途中で気づいた。<br />
the productの意味を積だと知らず、少し手間取った。<br />
英語は大事。<br />
<br />
<br />

<div style="padding: 10px; margin-bottom: 10px; border: 1px solid #333333;">
<pre><code>
#include&lt;iostream&gt;
#include&lt;vector&gt;
#include&lt;map&gt;
#include&lt;functional&gt;
#include&lt;algorithm&gt;
#include&lt;string&gt;
#include&lt;climits&gt;

using namespace std;

class SplitIntoPairs{
public:
	int makepairs(vector&lt;int&gt; A,int X){
		sort(A.begin(),A.end());
		int cnt=0;
		for(int i=0;i&lt;A.size()-1;i+=2)
			if((long long)A[i]*A[i+1] &gt;= X)cnt++;
		return cnt;
	}
};
</code>
</pre>
</div>]]> 
    </content>
    <author>
            <name>tkzw_21</name>
        </author>
  </entry>
</feed>