<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ランクD - IQパズルステップ</title>
	<atom:link href="https://chokomon.com/tag/rank_d/feed/" rel="self" type="application/rss+xml" />
	<link>https://chokomon.com</link>
	<description>ちょこっと頭を良くするIQパズル問題集</description>
	<lastBuildDate>Thu, 13 Oct 2022 06:23:21 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://chokomon.com/wp-content/uploads/2022/02/cropped-icon512-32x32.png</url>
	<title>ランクD - IQパズルステップ</title>
	<link>https://chokomon.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>【paizaの森練習問題コンテスト6】ロボットの移動 (paizaランク D)-解答例-PHP編</title>
		<link>https://chokomon.com/42-forest_contest-06-03-00668/</link>
					<comments>https://chokomon.com/42-forest_contest-06-03-00668/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Thu, 13 Oct 2022 06:23:19 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[練習問題コンテスト]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクD]]></category>
		<category><![CDATA[難易度-1500]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=7002</guid>

					<description><![CDATA[【paizaの森練習問題コンテスト6】過去問題6 > ロボットの移動 (paizaランク D 相当) [難易度: 1594 ±45] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/paiza_set/42-forest_contest/">paizaの森練習問題コンテスト6</a>】<a href="https://paiza.jp/works/mondai/forest_contest_006/forest_contest_006__d_robot_movement" target="_blank" rel="noreferrer noopener">過去問題6 > ロボットの移動 (paizaランク D 相当)</a> [難易度: <strong>1594 ±45</strong>]



<p>※リンク先へ移動するためには[<a href="https://paiza.jp/works" target="_blank" rel="noreferrer noopener">paiza</a>]へのログインが必要です。</p>



<figure class="wp-block-image aligncenter size-full"><img fetchpriority="high" decoding="async" width="660" height="300" src="https://chokomon.com/wp-content/uploads/2022/10/42-06-03-01.png" alt="" class="wp-image-7003"/></figure>



<div class="wp-block-dvaux-frame sc_frame_wrap inline"><div class="sc_frame_title inline" style="background-color:#ccc">問題文</div><div class="sc_frame" style="background-color:#fff;border-color:#ccc">
<p>2 次元グリッドにおいて、ロボットは(0,0)の初期位置から目標地点(x,y)まで移動したいです。ロボットは 1 ステップにつき、以下の 5 種類の動きを取ることができます。</p>



<p>・(i,j) → (i,j + 1)<br>・(i,j) → (i + 1,j)<br>・(i,j) → (i,j - 1)<br>・(i,j) → (i - 1,j)<br>・(i,j)の位置で静止</p>



<p>ロボットが初期位置から目標地点に到達するには最小で何ステップ必要か求めてください。</p>



<p></p>



<p><strong>入力値（例）</strong><br>5 3</p>



<p><strong>出力値（例）</strong><br>8</p>
</div></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">解答例</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
    list($x, $y) = explode(" ", trim(fgets(STDIN)));
    
    echo abs($x)+abs($y);
?&gt;</pre></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="660" height="160" src="https://chokomon.com/wp-content/uploads/2022/10/42-06-03-02.png" alt="" class="wp-image-7004"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/42-forest_contest-06-03-00668/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【paizaの森練習問題コンテスト6】最大イニング (paizaランク D)-解答例-PHP編</title>
		<link>https://chokomon.com/42-forest_contest-06-02-00667/</link>
					<comments>https://chokomon.com/42-forest_contest-06-02-00667/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Wed, 12 Oct 2022 08:23:10 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[練習問題コンテスト]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクD]]></category>
		<category><![CDATA[難易度-1800]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6997</guid>

					<description><![CDATA[【paizaの森練習問題コンテスト6】過去問題6 > 最大イニング (paizaランク D 相当) [難易度: 1850 ±50] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/paiza_set/42-forest_contest/">paizaの森練習問題コンテスト6</a>】<a href="https://paiza.jp/works/mondai/forest_contest_006/forest_contest_006__d_maxinning" target="_blank" rel="noreferrer noopener">過去問題6 > 最大イニング (paizaランク D 相当)</a> [難易度: <strong>1850 ±50</strong>]



<p>※リンク先へ移動するためには[<a href="https://paiza.jp/works" target="_blank" rel="noreferrer noopener">paiza</a>]へのログインが必要です。</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="660" height="300" src="https://chokomon.com/wp-content/uploads/2022/10/42-06-02-01.png" alt="" class="wp-image-6998"/></figure>



<div class="wp-block-dvaux-frame sc_frame_wrap inline"><div class="sc_frame_title inline" style="background-color:#ccc">問題文</div><div class="sc_frame" style="background-color:#fff;border-color:#ccc">
<p>プロ野球歴 6 年目の小柳くんは投手として完投する（1 試合を 1 人で投げ切る）ことにこだわりを持っているため、決して自らマウンドを降りません。小柳くんはある試合で 9 イニングを投げきり、i (1 ≦ i ≦ 9) イニング目に投げた球数は m_i 球でした。しかし監督であるあなたは選手の体の状態を考慮しないといけないため、<code>k</code>球に到達した段階で小柳くんを降板させる必要がありました。小柳くんは球数を考慮した上でも完投できたのかどうか、完投出来ない場合は何イニング目で降板させるべきだったのかを答えてください。</p>



<p>なお、代打や代走などによる攻撃中の投手交代はないものとします。<br>また、この試合に延長やコールドはなく、９イニングで終了します。<br>自チームは後攻で、相手チームの攻撃は試合展開にかかわらず、９イニングおこなわれます。</p>



<p>ちょうどイニングの終了時に k 球に到達した場合は、もうそのイニングが終了してしまい、投手を交代することができないため、次のイニング開始時に降板します。(入力例 3 のケース)</p>



<p></p>



<p><strong>入力値（例）</strong><br>99<br>6<br>16<br>14<br>22<br>8<br>11<br>7<br>10<br>4</p>



<p><strong>出力値（例）</strong><br>Yes</p>
</div></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">解答例</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
    $k = trim(fgets(STDIN));
    
    $total = 0;
    $flag = false;
    
    for($i=0; $i&lt;9; $i++) {
        $m = trim(fgets(STDIN));
        $total += $m;
        if($total &gt; $k) {
            $flag = true;
            $counter = $i+1;
            break;
        }
    }
    echo ($flag) ? $counter : "Yes";
?&gt;</pre></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="160" src="https://chokomon.com/wp-content/uploads/2022/10/42-06-02-02.png" alt="" class="wp-image-6999"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/42-forest_contest-06-02-00667/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【paizaの森練習問題コンテスト6】球数制限 (paizaランク D)-解答例-PHP編</title>
		<link>https://chokomon.com/42-forest_contest-06-01-00666/</link>
					<comments>https://chokomon.com/42-forest_contest-06-01-00666/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Tue, 11 Oct 2022 09:33:59 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[練習問題コンテスト]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクD]]></category>
		<category><![CDATA[難易度-1300]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6992</guid>

					<description><![CDATA[【paizaの森練習問題コンテスト6】過去問題6 > 球数制限 (paizaランク D 相当) [難易度: 1306 ±53] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/paiza_set/42-forest_contest/">paizaの森練習問題コンテスト6</a>】<a href="https://paiza.jp/works/mondai/forest_contest_006/forest_contest_006__d_balllimit" target="_blank" rel="noreferrer noopener">過去問題6 > 球数制限 (paizaランク D 相当)</a> [難易度: <strong>1306 ±53</strong>]



<p>※リンク先へ移動するためには[<a href="https://paiza.jp/works" target="_blank" rel="noreferrer noopener">paiza</a>]へのログインが必要です。</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="300" src="https://chokomon.com/wp-content/uploads/2022/10/42-06-01-01.png" alt="" class="wp-image-6993"/></figure>



<div class="wp-block-dvaux-frame sc_frame_wrap inline"><div class="sc_frame_title inline" style="background-color:#ccc">問題文</div><div class="sc_frame" style="background-color:#fff;border-color:#ccc">
<p>プロ野球歴 3 年目 20 歳の佐々尾くんは投手として前途有望なため、ある一定の球数に到達すると怪我を考慮して、たとえパーフェクトピッチングを継続していたとしても降板させられます。佐々尾くんは現在<code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-light-orange-color">n</mark></code>イニング投げており、i (1 ≦ i ≦ n) イニング目に投げた球数は m_i 球です。n イニング投げ終わったときに<code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-light-orange-color">k</mark></code>球以上投げているとそれ以降のイニングは投げられません。佐々尾くんは次のイニングで続投できるかどうかを答えてください。</p>



<p></p>



<p><strong>入力値（例）</strong><br>5 100<br>12<br>14<br>20<br>8<br>17</p>



<p><strong>出力値（例）</strong><br>Yes</p>
</div></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">解答例</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
    list($n, $k) = explode(" ", trim(fgets(STDIN)));
    
    $total = 0;
    
    for($i=0; $i&lt;$n; $i++) {
        $m = trim(fgets(STDIN));
        $total += $m;
    }
    echo ($total &lt; $k) ? "Yes" : "No";
?&gt;</pre></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="160" src="https://chokomon.com/wp-content/uploads/2022/10/42-06-01-02.png" alt="" class="wp-image-6994"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/42-forest_contest-06-01-00666/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【スキルチェック見本問題セット】文字の一致 (paizaランク D)-解答例-PHP編</title>
		<link>https://chokomon.com/31-skillcheck_sample-01-04-00591/</link>
					<comments>https://chokomon.com/31-skillcheck_sample-01-04-00591/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Sun, 21 Aug 2022 19:19:52 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[スキルチェック見本問題セット]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクD]]></category>
		<category><![CDATA[難易度-900]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6522</guid>

					<description><![CDATA[【スキルチェック見本問題セット】> 文字の一致 (paizaランク D 相当) [難易度: 934 ±5] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/paiza_set/31-skillcheck_sample/">スキルチェック見本問題セット</a>】> <a href="https://paiza.jp/works/mondai/skillcheck_sample/diff_str" target="_blank" rel="noreferrer noopener">文字の一致 (paizaランク D 相当)</a> [難易度: <strong>934 ±5</strong>]



<p>※リンク先へ移動するためには[<a href="https://paiza.jp/works" target="_blank" rel="noreferrer noopener">paiza</a>]へのログインが必要です。</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="300" src="https://chokomon.com/wp-content/uploads/2022/08/31-01-04-01.png" alt="" class="wp-image-6523"/></figure>



<div class="wp-block-dvaux-frame sc_frame_wrap inline"><div class="sc_frame_title inline" style="background-color:#ccc">問題文</div><div class="sc_frame" style="background-color:#fff;border-color:#ccc">
<p>2 つの文字列 a, b が入力されます。文字列が一致していれば "OK" 、異なっていれば "NG" と出力してください。</p>



<p></p>



<p><strong>入力値（例）</strong><br>paiza<br>paiza</p>



<p><strong>出力値（例）</strong><br>OK</p>
</div></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">解答例</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
    $a = trim(fgets(STDIN));
    $b = trim(fgets(STDIN));
    
    echo ($a == $b) ? "OK" : "NG";
?&gt;</pre></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="160" src="https://chokomon.com/wp-content/uploads/2022/08/31-01-04-02.png" alt="" class="wp-image-6524"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/31-skillcheck_sample-01-04-00591/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【スキルチェック見本問題セット】一番小さい値 (paizaランク D)-解答例-PHP編</title>
		<link>https://chokomon.com/31-skillcheck_sample-01-03-00590/</link>
					<comments>https://chokomon.com/31-skillcheck_sample-01-03-00590/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Sun, 21 Aug 2022 19:08:01 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[スキルチェック見本問題セット]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクD]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6517</guid>

					<description><![CDATA[【スキルチェック見本問題セット】> 一番小さい値 (paizaランク D 相当) [難易度: 1104 ±4] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/paiza_set/31-skillcheck_sample/">スキルチェック見本問題セット</a>】> <a href="https://paiza.jp/works/mondai/skillcheck_sample/min_num" target="_blank" rel="noreferrer noopener">一番小さい値 (paizaランク D 相当)</a> [難易度: <strong>1104 ±4</strong>]



<p>※リンク先へ移動するためには[<a href="https://paiza.jp/works" target="_blank" rel="noreferrer noopener">paiza</a>]へのログインが必要です。</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="300" src="https://chokomon.com/wp-content/uploads/2022/08/31-01-03-01.png" alt="" class="wp-image-6518"/></figure>



<div class="wp-block-dvaux-frame sc_frame_wrap inline"><div class="sc_frame_title inline" style="background-color:#ccc">問題文</div><div class="sc_frame" style="background-color:#fff;border-color:#ccc">
<p>5 つの正の整数が入力されるので、最も小さい数字を出力して下さい。</p>



<p></p>



<p><strong>入力値（例）</strong><br>10<br>12<br>4<br>8<br>46</p>



<p><strong>出力値（例）</strong><br>4</p>
</div></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">解答例</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
    while($input = fgets(STDIN)){
        $num[]= trim($input);
    }
    echo min($num);
?&gt;</pre></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="160" src="https://chokomon.com/wp-content/uploads/2022/08/31-01-03-02.png" alt="" class="wp-image-6519"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/31-skillcheck_sample-01-03-00590/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【スキルチェック見本問題セット】足し算 (paizaランク D)-解答例-PHP編</title>
		<link>https://chokomon.com/31-skillcheck_sample-01-02-00589/</link>
					<comments>https://chokomon.com/31-skillcheck_sample-01-02-00589/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Sun, 21 Aug 2022 18:56:53 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[スキルチェック見本問題セット]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクD]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6512</guid>

					<description><![CDATA[【スキルチェック見本問題セット】> 足し算 (paizaランク D 相当) [難易度: 1076 ±4] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/paiza_set/31-skillcheck_sample/">スキルチェック見本問題セット</a>】> <a href="https://paiza.jp/works/mondai/skillcheck_sample/addition" target="_blank" rel="noreferrer noopener">足し算 (paizaランク D 相当)</a> [難易度: <strong>1076 ±4</strong>]



<p>※リンク先へ移動するためには[<a href="https://paiza.jp/works" target="_blank" rel="noreferrer noopener">paiza</a>]へのログインが必要です。</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="300" src="https://chokomon.com/wp-content/uploads/2022/08/31-01-02-01.png" alt="" class="wp-image-6513"/></figure>



<div class="wp-block-dvaux-frame sc_frame_wrap inline"><div class="sc_frame_title inline" style="background-color:#ccc">問題文</div><div class="sc_frame" style="background-color:#fff;border-color:#ccc">
<p>２つの正の整数 a, b が半角スペース区切りで入力されるので a と b を足した数を出力してください。</p>



<p>※「掛け算」の問題では入力が改行区切りで与えられましたが、今回は半角スペース区切りで与えられます。</p>



<p></p>



<p><strong>入力値（例）</strong><br>1 1</p>



<p><strong>出力値（例）</strong><br>2</p>
</div></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">解答例</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
    list($a, $b) = explode(" ", trim(fgets(STDIN)));
    echo ($a+$b);
?&gt;</pre></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="160" src="https://chokomon.com/wp-content/uploads/2022/08/31-01-02-02.png" alt="" class="wp-image-6514"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/31-skillcheck_sample-01-02-00589/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【スキルチェック見本問題セット】掛け算 (paizaランク D)-解答例-PHP編</title>
		<link>https://chokomon.com/31-skillcheck_sample-01-01-00588/</link>
					<comments>https://chokomon.com/31-skillcheck_sample-01-01-00588/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Sun, 21 Aug 2022 07:15:27 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[スキルチェック見本問題セット]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクD]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6503</guid>

					<description><![CDATA[【スキルチェック見本問題セット】> 掛け算 (paizaランク D 相当) [難易度: 1059 ±3] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/paiza_set/31-skillcheck_sample/">スキルチェック見本問題セット</a>】> <a href="https://paiza.jp/works/mondai/skillcheck_sample/multiplication" target="_blank" rel="noreferrer noopener">掛け算 (paizaランク D 相当)</a> [難易度: <strong>1059 ±3</strong>]



<p>※リンク先へ移動するためには[<a href="https://paiza.jp/works" target="_blank" rel="noreferrer noopener">paiza</a>]へのログインが必要です。</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="300" src="https://chokomon.com/wp-content/uploads/2022/08/31-01-01-01.png" alt="" class="wp-image-6504"/></figure>



<div class="wp-block-dvaux-frame sc_frame_wrap inline"><div class="sc_frame_title inline" style="background-color:#ccc">問題文</div><div class="sc_frame" style="background-color:#fff;border-color:#ccc">
<p>2つの正の整数a, bが改行区切りで入力されるのでaとbを掛け算した数値を出力してください。</p>



<p></p>



<p><strong>入力値（例）</strong><br>2<br>3</p>



<p><strong>出力値（例）</strong><br>6</p>
</div></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">解答例</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
    $a = trim(fgets(STDIN));
    $b = trim(fgets(STDIN));
    echo ($a * $b);
?&gt;</pre></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="160" src="https://chokomon.com/wp-content/uploads/2022/08/31-01-01-02.png" alt="" class="wp-image-6505"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/31-skillcheck_sample-01-01-00588/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【日付セット】閏年の判定 (paizaランク D)-解答例-PHP編</title>
		<link>https://chokomon.com/34-dateset-01-01-00578/</link>
					<comments>https://chokomon.com/34-dateset-01-01-00578/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Wed, 17 Aug 2022 17:48:51 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[日付セット]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクD]]></category>
		<category><![CDATA[難易度-1500]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6414</guid>

					<description><![CDATA[【日付セット】> 閏年の判定 (paizaランク D 相当) [難易度: 1525 ±12] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/paiza_set/34-dateset/">日付セット</a>】> <a rel="noreferrer noopener" href="https://paiza.jp/works/mondai/dateset/leap_year" target="_blank">閏年の判定 (paizaランク D 相当)</a> [難易度: <strong>1525 ±12</strong>]



<p>※リンク先へ移動するためには[<a href="https://paiza.jp/works" target="_blank" rel="noreferrer noopener">paiza</a>]へのログインが必要です。</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="300" src="https://chokomon.com/wp-content/uploads/2022/08/34-01-01-01.png" alt="" class="wp-image-6415"/></figure>



<div class="wp-block-dvaux-frame sc_frame_wrap inline"><div class="sc_frame_title inline" style="background-color:#ccc">問題文</div><div class="sc_frame" style="background-color:#fff;border-color:#ccc">
<p>西暦yが与えられるので、閏年ならYesを、平年ならばNoを出力してください。</p>



<p>閏年か平年かは次のような条件によって判定することができます。<br>・西暦が4で割り切れる年は閏年<br>・ただし、100で割り切れる年は平年<br>・ただし、400で割り切れる年は閏年<br>・西暦が4で割り切れない年は平年</p>



<p></p>



<p><strong>入力値（例）</strong><br>2019</p>



<p><strong>出力値（例）</strong><br>No</p>
</div></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">解答例</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
    $y = trim(fgets(STDIN));
    
    echo ($y % 4 == 0 &amp;&amp; ($y % 100 != 0 || $y % 400 == 0)) ? 
        "Yes" : "No";
?&gt;</pre></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="160" src="https://chokomon.com/wp-content/uploads/2022/08/34-01-01-02.png" alt="" class="wp-image-6416"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/34-dateset-01-01-00578/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【線形探索メニュー】奇数の探索 (paizaランク D)-解答例-PHP編</title>
		<link>https://chokomon.com/13-sequence_search-03-02-00545/</link>
					<comments>https://chokomon.com/13-sequence_search-03-02-00545/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Wed, 10 Aug 2022 16:04:16 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[線形探索メニュー]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクD]]></category>
		<category><![CDATA[難易度-1200]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6174</guid>

					<description><![CDATA[【線形探索メニュー】> 【特殊な探索】STEP: 2 奇数の探索 (paizaランク D 相当) [難易度: 1231 ±18] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/13-sequence_search/">線形探索メニュー</a>】> <a href="https://paiza.jp/works/mondai/sequence_search_problems/sequence_search_problems_search_condition_step1" target="_blank" rel="noreferrer noopener">【特殊な探索】STEP: 2 奇数の探索 (paizaランク D 相当)</a> [難易度: <strong>1231 ±18</strong>]



<p>※リンク先へ移動するためには[<a href="https://paiza.jp/works" target="_blank" rel="noreferrer noopener">paiza</a>]へのログインが必要です。</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="300" src="https://chokomon.com/wp-content/uploads/2022/08/13-03-02-01.png" alt="" class="wp-image-6175"/></figure>



<div class="wp-block-dvaux-frame sc_frame_wrap inline"><div class="sc_frame_title inline" style="background-color:#ccc">問題文</div><div class="sc_frame" style="background-color:#fff;border-color:#ccc">
<p>整数 n と、数列 a_1, ... , a_n が与えられます。</p>



<p>数列を先頭から順に見たときに、最後に現れる奇数が何番目にあるかを求めてください。最初の要素 (a_1) を 1 番目とします。</p>



<p>なお、与えられる数列には必ず奇数が含まれていることが保証されています。</p>



<p></p>



<p><strong>入力値（例）</strong><br>5<br>1 3 5 6 8</p>



<p><strong>出力値（例）</strong><br>3</p>
</div></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">解答例</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
    $n = trim(fgets(STDIN));
    $a = explode(" ", trim(fgets(STDIN)));
    
    for ($i = ($n - 1); $i &gt; -1; $i--) {
        if ($a[$i] % 2 != 0) {
            echo $i + 1;
            break;
        }
    }
?&gt;</pre></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="160" src="https://chokomon.com/wp-content/uploads/2022/08/13-03-02-02.png" alt="" class="wp-image-6176"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/13-sequence_search-03-02-00545/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【線形探索メニュー】偶数の探索 (paizaランク D)-解答例-PHP編</title>
		<link>https://chokomon.com/13-sequence_search-03-01-00544/</link>
					<comments>https://chokomon.com/13-sequence_search-03-01-00544/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Wed, 10 Aug 2022 15:43:46 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[線形探索メニュー]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクD]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6169</guid>

					<description><![CDATA[【線形探索メニュー】> 【特殊な探索】STEP: 1 偶数の探索 (paizaランク D 相当) [難易度: 1021 ±22] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/13-sequence_search/">線形探索メニュー</a>】> <a href="https://paiza.jp/works/mondai/sequence_search_problems/sequence_search_problems_search_condition_step0" target="_blank" rel="noreferrer noopener">【特殊な探索】STEP: 1 偶数の探索 (paizaランク D 相当)</a> [難易度: <strong>1021 ±22</strong>]



<p>※リンク先へ移動するためには[<a href="https://paiza.jp/works" target="_blank" rel="noreferrer noopener">paiza</a>]へのログインが必要です。</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="300" src="https://chokomon.com/wp-content/uploads/2022/08/13-03-01-01.png" alt="" class="wp-image-6170"/></figure>



<div class="wp-block-dvaux-frame sc_frame_wrap inline"><div class="sc_frame_title inline" style="background-color:#ccc">問題文</div><div class="sc_frame" style="background-color:#fff;border-color:#ccc">
<p>整数 n と、数列 a_1, ... , a_n が与えられます。</p>



<p>数列を先頭から順に見たときに、最初に現れる偶数が何番目にあるかを求めてください。最初の要素 (a_1) を 1 番目とします。</p>



<p>なお、与えられる数列には必ず偶数が含まれていることが保証されています。</p>



<p></p>



<p><strong>入力値（例）</strong><br>5<br>1 3 5 6 8</p>



<p><strong>出力値（例）</strong><br>4</p>
</div></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">解答例</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
    $n = trim(fgets(STDIN));
    $a = explode(" ", trim(fgets(STDIN)));
    
    for ($i = 0; $i &lt; $n; $i++) {
        if ($a[$i] % 2 == 0) {
            echo $i + 1;
            break;
        }
    }
?&gt;</pre></div>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="660" height="160" src="https://chokomon.com/wp-content/uploads/2022/08/13-03-01-02.png" alt="" class="wp-image-6171"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/13-sequence_search-03-01-00544/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
