<?xml version="1.0" encoding="UTF-8" ?><rdf:RDF 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:lang="ja">
  <channel rdf:about="http://w.atwiki.jp/isa_rentacs/">
    <title>Isa@Code集積場</title>
    <link>http://w.atwiki.jp/isa_rentacs/</link>
    <atom:link href="https://w.atwiki.jp/isa_rentacs/rss10.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsubhubbub.appspot.com" />
    <description>Isa@Code集積場</description>

    <dc:language>ja</dc:language>
    <dc:date>2011-06-19T01:06:36+09:00</dc:date>
    <utime>1308413196</utime>

    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="https://w.atwiki.jp/isa_rentacs/pages/48.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/isa_rentacs/pages/47.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/isa_rentacs/pages/46.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/isa_rentacs/pages/45.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/isa_rentacs/pages/44.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/isa_rentacs/pages/43.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/isa_rentacs/pages/42.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/isa_rentacs/pages/41.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/isa_rentacs/pages/40.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/isa_rentacs/pages/39.html" />
              </rdf:Seq>
    </items>
	
		
    
  </channel>
    <item rdf:about="https://w.atwiki.jp/isa_rentacs/pages/48.html">
    <title>[aoj]0074</title>
    <link>https://w.atwiki.jp/isa_rentacs/pages/48.html</link>
    <description>
      #include &lt;iostream&gt;
#include &lt;cstdio&gt;
using namespace std;

int main(void){
  int sec, sec3;
  int used;
  int hh,mm,ss;
  int reth,retm,rets;


  while(cin &gt;&gt; hh &gt;&gt; mm &gt;&gt; ss){
	if(hh == -1 &amp;&amp; mm == -1 &amp;&amp; ss == -1) break;
	used = hh * 3600 + mm * 60 + ss;
	sec = 7200 - used;
	sec3 = sec * 3;
	
	reth = sec / 3600;
	sec -= 3600 * reth;
	retm = sec / 60;
	sec -= 60 * retm;
	rets = sec;
	printf(&quot;%02d:%02d:%02d\n&quot;, reth, retm, rets);
	reth = sec3 / 3600;
	sec3 -= 3600 * reth;
	retm = sec3 / 60;
	sec3 -= 60 * retm;
	rets = sec3;
	printf(&quot;%02d:%02d:%02d\n&quot;, reth, retm, rets);
  }
}    </description>
    <dc:date>2011-06-19T01:06:36+09:00</dc:date>
    <utime>1308413196</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/isa_rentacs/pages/47.html">
    <title>[aoj]0073</title>
    <link>https://w.atwiki.jp/isa_rentacs/pages/47.html</link>
    <description>
      #include &lt;iostream&gt;
#include &lt;cmath&gt;
#include &lt;cstdio&gt;
using namespace std;

int main(void){
  int x, h;
  while(cin &gt;&gt; x){
	cin &gt;&gt; h;
	if(x == 0 &amp;&amp; h == 0) break;
	printf(&quot;%.6f\n&quot;,sqrt((double)x/2 * (double)x/2 + h*h) * x * 2 + x * x);
  }
}    </description>
    <dc:date>2011-06-19T00:58:50+09:00</dc:date>
    <utime>1308412730</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/isa_rentacs/pages/46.html">
    <title>[Algorithm]Prim&#039;s algorithm</title>
    <link>https://w.atwiki.jp/isa_rentacs/pages/46.html</link>
    <description>
      与えられたグラフの最小全域木を求める方法。priority_queueを使えばo(|E|log|V|)。

[手順]
1,適当な点を始点として取る

2,そこから到達可能な点のうち、最小コストのものを
到達済み集合に加える

3,すべての頂点に到達済みならば終了、そうでなければ2へ

[実装例]
[[0072&gt;[aoj]0072]]にて使用

  q.push(node(0,0));                    //始点として頂点0を取る、コストは0
  while(!q.empty()){
    node tmp = q.top(); q.pop();
    if(used[tmp.num] == true) continue; //popしたvが到達済みなら捨てる
    used[tmp.num] = true;               //到達済みにする
    ret += tmp.cost;                    //コストを加える
    for(int i=0;i&lt;n;i++){
      if(cost[tmp.num][i] != INF){      //加えた頂点から到達可能な頂点と、そのコストをPQにpush
	q.push(node(cost[tmp.num][i], i));
      }
    }
  }    </description>
    <dc:date>2011-06-19T00:51:00+09:00</dc:date>
    <utime>1308412260</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/isa_rentacs/pages/45.html">
    <title>[aoj]0072</title>
    <link>https://w.atwiki.jp/isa_rentacs/pages/45.html</link>
    <description>
      #include &lt;iostream&gt;
#include &lt;queue&gt;
#include &lt;cstring&gt;
#include &lt;algorithm&gt;

using namespace std;

#define INF 1&lt;&lt;30

struct node{
  int cost, num;
  node(int c, int n): cost(c), num(n){}
  bool operator &gt;(const node &amp;e) const{
	return cost &gt; e.cost;
  }

};

int main(void){
  int n;
  int m;
  int n1,n2,c;

  while(1){
	cin &gt;&gt; n;
	if(n == 0) break;

	bool visited[n];
	memset(visited, false, sizeof(visited));
	int cost[n][n];
	fill((int *)cost, (int *)cost+n*n, INF);
	bool used[n];
	fill(used, used+n, false);
	priority_queue&lt;node, vector&lt;node&gt;, greater&lt;node&gt; &gt; q;
	int ret=0;

	cin &gt;&gt; m;

	for(int i=0;i&lt;m;i++){
	  cin &gt;&gt; n1; cin.ignore();
	  cin &gt;&gt; n2; cin.ignore();
	  cin &gt;&gt; c;

	  cost[n1][n2] = c / 100 - 1;
	  cost[n2][n1] = c / 100 - 1;	
	}
	q.push(node(0,0));
	while(!q.empty()){
	  node tmp = q.top(); q.pop();
	  //cout &lt;&lt; &quot;poped: from &quot; &lt;&lt; tmp.num &lt;&lt; &quot; cost &quot; &lt;&lt; tmp.cost &lt;&lt; endl;

	  if(used[tmp.num] == true) continue;
	  used[t    </description>
    <dc:date>2011-06-19T00:33:50+09:00</dc:date>
    <utime>1308411230</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/isa_rentacs/pages/44.html">
    <title>[aoj]0040</title>
    <link>https://w.atwiki.jp/isa_rentacs/pages/44.html</link>
    <description>
      #include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;sstream&gt;
#include &lt;vector&gt;

using namespace std;

string encrypt(string str, int alpha, int beta){
  int size = str.size();
  string ret = &quot;&quot;;

  for(int i=0;i&lt;size;i++){
	if(&#039;a&#039; &lt;= str[i] &amp;&amp; str[i] &lt;= &#039;z&#039;){
	  ret += (alpha * (str[i] - &#039;a&#039;) + beta) % 26 + &#039;a&#039;;
	}
  }

  //cout &lt;&lt; str &lt;&lt; &quot; is encrypted to: &quot;&lt;&lt; ret &lt;&lt; endl;
  return ret;
}

int main(void){
  string thiss(&quot;this&quot;);
  string that(&quot;that&quot;);
  int n;

  cin &gt;&gt; n;
  cin.ignore(); //CR+LF
  for(int i=0;i&lt;n;i++){
	vector&lt;string&gt; strv;
	string str, tmp;
	getline(cin, str);
	int numwords;
	istringstream iss(str);
	int alpha, beta;
	bool decided = false;

	decided = false;
	while(iss &gt;&gt; tmp){
	  strv.push_back(tmp);
	}
	numwords = strv.size();

	for(int j=0;j&lt;numwords;j++){
	  /* test */
	  //cout &lt;&lt; &quot;checking: &quot; &lt;&lt; strv[j] &lt;&lt; endl;
	  /* */
	  if(strv[j].size() == 4){
		if(strv[j][0] == strv[j][3]){// strv[j] is a candidate of that
		     </description>
    <dc:date>2011-06-16T23:35:09+09:00</dc:date>
    <utime>1308234909</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/isa_rentacs/pages/43.html">
    <title>[aoj]0039</title>
    <link>https://w.atwiki.jp/isa_rentacs/pages/43.html</link>
    <description>
      #include &lt;iostream&gt;
#include &lt;string&gt;

using namespace std;

int getvalue(char c){
  if(c == &#039;I&#039;){
	  return 1;
	}else if(c == &#039;V&#039;){
	  return 5;
	}else if(c == &#039;X&#039;){
	  return 10;
	}else if(c == &#039;L&#039;){
	  return 50;
	}else if(c == &#039;C&#039;){
	  return 100;
	}else if(c == &#039;D&#039;){
	  return 500;
	}else if(c == &#039;M&#039;){
	  return 1000;
	}
  return -1;
}

int parseStr(string str){
  int ret=0;
  int now;
  int next;

  for(int i=0;i&lt;str.size();i++){
	now = getvalue(str[i]);
	if(i != str.size() - 1){
	  next = getvalue(str[i+1]);
	}else{
	  next = -1;
	}
	
	if(now &gt;= next){
	  ret += now;
	}else{
	  ret += next - now;
	  i++;
	}
  }
  return ret;
}

int main(void){
  string tmp;

  while(cin &gt;&gt; tmp){
	cout &lt;&lt; parseStr(tmp) &lt;&lt; endl;
  }
  
  return 0;
}    </description>
    <dc:date>2011-06-16T23:34:35+09:00</dc:date>
    <utime>1308234875</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/isa_rentacs/pages/42.html">
    <title>[aoj]0038</title>
    <link>https://w.atwiki.jp/isa_rentacs/pages/42.html</link>
    <description>
      #include &lt;iostream&gt;

using namespace std;

int main(void){
  int state; //前回の動いた方向
  int x, y; //current position
  bool horizon[5][4];
  bool vertical[4][5];
  char tmp;
  int i,j;

  for(i=0;i&lt;9;i++){
	if(i%2 == 0){
	  for(j=0;j&lt;4;j++){
		cin &gt;&gt; tmp;
		if(tmp == &#039;1&#039;){
		  horizon[i/2][j] = true;
		}else{
		  horizon[i/2][j] = false;
		}
	  }
	}else{
	  for(j=0;j&lt;5;j++){
		cin &gt;&gt; tmp;
		if(tmp == &#039;1&#039;){
		  vertical[i/2][j] = true;
		}else{
		  vertical[i/2][j] = false;
		}
	  }
	}
  }

  state = &#039;R&#039;;
  cout &lt;&lt; &quot;R&quot;;
  x = 0;
  y = 1;
  
  while(!(x == 0 &amp;&amp; y == 0)){
	if(state == &#039;R&#039;){
	  if(x - 1 &gt;= 0 &amp;&amp; vertical[x-1][y] ){
		state = &#039;U&#039;;
		x--;
		cout &lt;&lt; &quot;U&quot;;
	  }else if(y &lt;= 3 &amp;&amp; horizon[x][y]){
		state = &#039;R&#039;;
		y++;
		cout &lt;&lt; &quot;R&quot;;
	  }else if(x &lt;= 3 &amp;&amp; vertical[x][y]){
		state = &#039;D&#039;;
		x++;
		cout &lt;&lt; &quot;D&quot;;
	  }else{
		state = &#039;L&#039;;
		y--;
		cout &lt;&lt; &quot;L&quot;;
	  }
	}else if(state == &#039;D&#039;){
	  if(y &lt;= 3 &amp;&amp; horizon[x][y]){
		state = &#039;    </description>
    <dc:date>2011-06-16T23:33:33+09:00</dc:date>
    <utime>1308234813</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/isa_rentacs/pages/41.html">
    <title>[aoj]0037</title>
    <link>https://w.atwiki.jp/isa_rentacs/pages/41.html</link>
    <description>
      #include &lt;iostream&gt;

using namespace std;

int main(void){
  int state; //前回の動いた方向
  int x, y; //current position
  bool horizon[5][4];
  bool vertical[4][5];
  char tmp;
  int i,j;

  for(i=0;i&lt;9;i++){
	if(i%2 == 0){
	  for(j=0;j&lt;4;j++){
		cin &gt;&gt; tmp;
		if(tmp == &#039;1&#039;){
		  horizon[i/2][j] = true;
		}else{
		  horizon[i/2][j] = false;
		}
	  }
	}else{
	  for(j=0;j&lt;5;j++){
		cin &gt;&gt; tmp;
		if(tmp == &#039;1&#039;){
		  vertical[i/2][j] = true;
		}else{
		  vertical[i/2][j] = false;
		}
	  }
	}
  }

  state = &#039;R&#039;;
  cout &lt;&lt; &quot;R&quot;;
  x = 0;
  y = 1;
  
  while(!(x == 0 &amp;&amp; y == 0)){
	if(state == &#039;R&#039;){
	  if(x - 1 &gt;= 0 &amp;&amp; vertical[x-1][y] ){
		state = &#039;U&#039;;
		x--;
		cout &lt;&lt; &quot;U&quot;;
	  }else if(y &lt;= 3 &amp;&amp; horizon[x][y]){
		state = &#039;R&#039;;
		y++;
		cout &lt;&lt; &quot;R&quot;;
	  }else if(x &lt;= 3 &amp;&amp; vertical[x][y]){
		state = &#039;D&#039;;
		x++;
		cout &lt;&lt; &quot;D&quot;;
	  }else{
		state = &#039;L&#039;;
		y--;
		cout &lt;&lt; &quot;L&quot;;
	  }
	}else if(state == &#039;D&#039;){
	  if(y &lt;= 3 &amp;&amp; horizon[x][y]){
		state = &#039;    </description>
    <dc:date>2011-06-16T23:33:02+09:00</dc:date>
    <utime>1308234782</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/isa_rentacs/pages/40.html">
    <title>[aoj]0036</title>
    <link>https://w.atwiki.jp/isa_rentacs/pages/40.html</link>
    <description>
      #include &lt;iostream&gt;

using namespace std;

int main(void){
     char field[8][8];
     char tmp;
     int i,j;
	 while(1){
	   for(i=0;i&lt;8;i++){
		 for(j=0;j&lt;8;j++){
		   cin &gt;&gt; field[i][j];
		   //cout &lt;&lt; field[i][j];
		 }
		 //cout &lt;&lt; endl;
	   }
	   
	   //それぞれの形について判別
	   //まず左上のマスを探す
	   for(i=0;i&lt;8;i++){
		 for(j=0;j&lt;8;j++){
		   if(field[i][j] == &#039;1&#039;) goto NEXT;
		 }
	   }
	 NEXT:
	   //cout &lt;&lt; i &lt;&lt; &quot;    &quot; &lt;&lt; j &lt;&lt; endl;

     
	   if(j+3 &lt;= 7 &amp;&amp; field[i][j+1] == &#039;1&#039; &amp;&amp; field[i][j+2] == &#039;1&#039; &amp;&amp; field[i][j+3] == &#039;1&#039;){
		 //横一列
		 cout &lt;&lt; &quot;C&quot; &lt;&lt; endl;
	   }else if(i+3 &lt;= 7 &amp;&amp; field[i+1][j]  == &#039;1&#039; &amp;&amp; field[i+2][j] == &#039;1&#039; &amp;&amp; field[i+3][j] == &#039;1&#039;){
		 //縦一列
		 cout &lt;&lt; &quot;B&quot; &lt;&lt; endl;
	   }else if(j+1 &lt;= 7 &amp;&amp; i+1 &lt;= 7 &amp;&amp; field[i][j+1] == &#039;1&#039; &amp;&amp; field[i+1][j] == &#039;1&#039; &amp;&amp; field[i+1][j+1] == &#039;1&#039;){
		 //正方形
		 cout &lt;&lt; &quot;A&quot; &lt;&lt; endl;
	   }else if(i+2 &lt;= 7 &amp;&amp; j+1 &lt;= 7 &amp;&amp; field[i+1][j] == &#039;1&#039; &amp;&amp; field[i+1][j+1]  == &#039;1&#039; &amp;&amp; field[i+2][j+1] == &#039;1&#039;){
		 //1 0
		 //    </description>
    <dc:date>2011-06-16T23:32:28+09:00</dc:date>
    <utime>1308234748</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/isa_rentacs/pages/39.html">
    <title>[aoj]0035</title>
    <link>https://w.atwiki.jp/isa_rentacs/pages/39.html</link>
    <description>
      #include &lt;complex&gt;
#include &lt;iostream&gt;
#include &lt;cmath&gt;

using namespace std;

typedef complex&lt;double&gt; P;

//XY座標
#define X real()
#define Y imag()

double tri2s(double xa, double ya, double xb, double yb, double xc, double yc){
     double a, b, c, s;
    
     a = sqrt((xb - xc) * (xb - xc) + (yb - yc) * (yb - yc));
     b = sqrt((xa - xc) * (xa - xc) + (ya - yc) * (ya - yc));
     c = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
    
     s = (a+b+c) / 2;

	 cout &lt;&lt; sqrt(s * (s - a) * (s - b) * (s - c)) &lt;&lt; endl;
    
     return sqrt(s * (s - a) * (s - b) * (s - c));
}

double p2deg(double xa, double ya, double xb, double yb, double xc, double yc){
  double a, b, c, s, cos;
    
     a = sqrt((xb - xc) * (xb - xc) + (yb - yc) * (yb - yc));
     b = sqrt((xa - xc) * (xa - xc) + (ya - yc) * (ya - yc));
     c = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));

	 cos = (b * b + c * c - a * a) / 2 * b * c;

	 return acos(cos);

}

// 直線    </description>
    <dc:date>2011-06-16T23:31:19+09:00</dc:date>
    <utime>1308234679</utime>
  </item>
  </rdf:RDF>
