<?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>難易度-1000 - IQパズルステップ</title>
	<atom:link href="https://chokomon.com/tag/difficulty-1000/feed/" rel="self" type="application/rss+xml" />
	<link>https://chokomon.com</link>
	<description>ちょこっと頭を良くするIQパズル問題集</description>
	<lastBuildDate>Mon, 17 Oct 2022 01:51:36 +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>難易度-1000 - IQパズルステップ</title>
	<link>https://chokomon.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>【paizaの森練習問題コンテスト6】採点 (paizaランク C)-解答例-PHP編</title>
		<link>https://chokomon.com/42-forest_contest-06-06-00671/</link>
					<comments>https://chokomon.com/42-forest_contest-06-06-00671/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Mon, 17 Oct 2022 01:51:35 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[練習問題コンテスト]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクC]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=7018</guid>

					<description><![CDATA[【paizaの森練習問題コンテスト6】過去問題6 > 採点 (paizaランク C 相当) [難易度: 1067 ±70] ※リンク先へ移動するためには[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_scoring" target="_blank" rel="noreferrer noopener">過去問題6 > 採点 (paizaランク C 相当)</a> [難易度: <strong>1067 ±70</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-06-01.png" alt="" class="wp-image-7019"/></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 問あり、i (1 ≦ i ≦ n) 問目のパイザ君の解答結果は m_i でした。パイザ君の通う学校の先生の採点方式では、正答した場合は 2 点、不正解の場合は-1 点、無回答の場合は 0 点になります。この方式に従うときの合計点を求めてください。</p>



<p></p>



<p><strong>入力値（例）</strong><br>4<br>correct<br>correct<br>incorrect<br>no_answer</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));
    
    $score = 0;
    
    for($i=0; $i&lt;$n; $i++) {
        $m = trim(fgets(STDIN));
        
        switch($m) {
            case "correct":
                $score += 2;
                break;
            case "incorrect":
                $score -= 1;
                break;
            case "no_answer":
                $score += 0;
                break;
        }
    }
    
    echo $score;
?&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-06-02-1.png" alt="" class="wp-image-7021"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/42-forest_contest-06-06-00671/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【paizaの森練習問題コンテスト6】中央値 (paizaランク C)-解答例-PHP編</title>
		<link>https://chokomon.com/42-forest_contest-06-05-00670/</link>
					<comments>https://chokomon.com/42-forest_contest-06-05-00670/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Sat, 15 Oct 2022 13:18:06 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[練習問題コンテスト]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクC]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=7013</guid>

					<description><![CDATA[【paizaの森練習問題コンテスト6】過去問題6 > 中央値 (paizaランク C 相当) [難易度: 1117 ±64] ※リンク先へ移動するためには[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_median" target="_blank" rel="noreferrer noopener">過去問題6 > 中央値 (paizaランク C 相当)</a> [難易度: <strong>1117 ±64</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-05-01.png" alt="" class="wp-image-7014"/></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 科目受験し、それぞれの科目 i (1 ≦ i ≦ 5)の点数は m_i でした。 パイザ君の試験結果の中央値を求めてください。</p>



<p></p>



<p><strong>入力値（例）</strong><br>92<br>35<br>61<br>81<br>65</p>



<p><strong>出力値（例）</strong><br>65</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
    for($i=0; $i&lt;5; $i++) {
        $score[] = trim(fgets(STDIN));
    }
    
    sort($score);
    
    echo $score[2];
?&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-05-02.png" alt="" class="wp-image-7015"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/42-forest_contest-06-05-00670/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【paizaの森練習問題コンテスト6】最大の差 (paizaランク C)-解答例-PHP編</title>
		<link>https://chokomon.com/42-forest_contest-06-04-00669/</link>
					<comments>https://chokomon.com/42-forest_contest-06-04-00669/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Fri, 14 Oct 2022 08:58:39 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[練習問題コンテスト]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクC]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=7008</guid>

					<description><![CDATA[【paizaの森練習問題コンテスト6】過去問題6 > 最大の差 (paizaランク C 相当) [難易度: 1082 ±64] ※リンク先へ移動するためには[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_largest_diff" target="_blank" rel="noreferrer noopener">過去問題6 > 最大の差 (paizaランク C 相当)</a> [難易度: <strong>1082 ±64</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-04-01.png" alt="" class="wp-image-7009"/></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 科目受験し、それぞれの科目 i (1 ≦ i ≦ 5)の点数は m_i でした。 最も点の高かった科目と最も点の低かった科目の得点差を出力してください。</p>



<p></p>



<p><strong>入力値（例）</strong><br>35<br>48<br>51<br>67<br>72</p>



<p><strong>出力値（例）</strong><br>37</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
    for($i=0; $i&lt;5; $i++) {
        $score[] = trim(fgets(STDIN));
    }
    
    $min = min($score);
    $max = max($score);
    
    echo ($max-$min);
?&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-04-02.png" alt="" class="wp-image-7010"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/42-forest_contest-06-04-00669/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【累積和メニュー】区間の長さ 2 (paizaランク C)-解答例-PHP編</title>
		<link>https://chokomon.com/27-prefix_sum_problems-09-02-00652/</link>
					<comments>https://chokomon.com/27-prefix_sum_problems-09-02-00652/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Sun, 18 Sep 2022 04:06:57 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[累積和メニュー]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクC]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6901</guid>

					<description><![CDATA[【累積和メニュー】> 【区間の長さ】STEP: 2 区間の長さ 2 (paizaランク C 相当) [難易度: 1140 ±68] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/27-prefix_sum_problems/">累積和メニュー</a>】> <a href="https://paiza.jp/works/mondai/prefix_sum_problems/prefix_sum_problems__syakutori_length_step2" target="_blank" rel="noreferrer noopener">【区間の長さ】STEP: 2 区間の長さ 2 (paizaランク C 相当)</a> [難易度: <strong>1140 ±68</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/09/27-09-02-01.png" alt="" class="wp-image-6902"/></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>10 個の整数 a_1, a_2, ..., a_10 からなる数列 a が与えられます。</p>



<p>この数列において、総和が 15 以下の区間のうち、最大の長さを求めてください。</p>



<p></p>



<p><strong>入力値（例）</strong><br>1 5 9 1 20 5 3 6 5 4</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
    $a = explode(" ", trim(fgets(STDIN)));
    
    $k = 15;
    $maxLength = 0;
    
    for ($i=0; $i&lt;count($a); $i++) {
        $r = $i+1;
        $sectionSum = 0;
        while ($r &lt; count($a)+1) {
            $sectionSum += $a[$r-1];
            if ($sectionSum &gt; $k) break;
            $r++;
        }
        $maxLength = max($maxLength, $r-$i-1);
    }
    echo $maxLength;
?&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/09/27-09-02-02.png" alt="" class="wp-image-6903"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/27-prefix_sum_problems-09-02-00652/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【累積和メニュー】区間の数え上げ 3 (paizaランク C)-解答例-PHP編</title>
		<link>https://chokomon.com/27-prefix_sum_problems-08-03-00649/</link>
					<comments>https://chokomon.com/27-prefix_sum_problems-08-03-00649/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Fri, 16 Sep 2022 04:05:02 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[累積和メニュー]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクC]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6884</guid>

					<description><![CDATA[【累積和メニュー】> 【区間の数え上げ】STEP: 3 区間の数え上げ 3 (paizaランク C 相当) [難易度: 1188 ±62] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/27-prefix_sum_problems/">累積和メニュー</a>】> <a href="https://paiza.jp/works/mondai/prefix_sum_problems/prefix_sum_problems__syakutori_count_step3" target="_blank" rel="noreferrer noopener">【区間の数え上げ】STEP: 3 区間の数え上げ 3 (paizaランク C 相当)</a> [難易度: <strong>1188 ±62</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/09/27-08-03-01.png" alt="" class="wp-image-6885"/></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>1 行目に整数 K が与えられます。</p>



<p>2 行目に 10 個の整数 a_1, a_2, ..., a_10 からなる数列 a が与えられます。</p>



<p>この数列において、長さが 1 以上で総和が K 以下の区間がいくつあるか求めてください。</p>



<p></p>



<p><strong>入力値（例）</strong><br>15<br>1 5 9 1 20 5 3 6 5 4</p>



<p><strong>出力値（例）</strong><br>21</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));
    $a = explode(" ", trim(fgets(STDIN)));
    
    $count = 0;
    
    for ($i=0; $i&lt;count($a); $i++) {
        $r = $i+1;
        $sectionSum = 0;
        while ($r &lt; count($a)+1) {
            $sectionSum += $a[$r-1];
            if ($sectionSum &gt; $k) break;
            $r++;
        }
        $count += $r-$i-1;
    }
    echo $count;
?&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/09/27-08-03-02.png" alt="" class="wp-image-6886"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/27-prefix_sum_problems-08-03-00649/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【累積和メニュー】区間内の個数 (文字列) 1 (paizaランク C)-解答例-PHP編</title>
		<link>https://chokomon.com/27-prefix_sum_problems-04-01-00626/</link>
					<comments>https://chokomon.com/27-prefix_sum_problems-04-01-00626/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Sat, 10 Sep 2022 18:09:26 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[累積和メニュー]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクC]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6746</guid>

					<description><![CDATA[【累積和メニュー】> 【区間内の個数 (文字列)】STEP: 1 区間内の個数 (文字列) 1 (paizaランク C 相当) [難易度: 1192 ±39] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/27-prefix_sum_problems/">累積和メニュー</a>】> <a href="https://paiza.jp/works/mondai/prefix_sum_problems/prefix_sum_problems__string_count_step1" target="_blank" rel="noreferrer noopener">【区間内の個数 (文字列)】STEP: 1 区間内の個数 (文字列) 1 (paizaランク C 相当)</a> [難易度: <strong>1192 ±39</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/09/27-04-01-01.png" alt="" class="wp-image-6747"/></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>文字列 str を<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-light-orange-color"> <code>"bwwbwbbwbwbb"</code> </mark>とします。</p>



<p>文字列 str の 3 文字目から 8 文字目までの <code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-light-orange-color">'b'</mark></code> の個数を累積和を用いて求めてください。</p>



<p></p>



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



<p><strong>出力値（例）</strong><br>文字列 str の 3 文字目から 8 文字目までの <code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-light-orange-color">'b'</mark></code> の個数を出力してください。</p>



<p>末尾に改行を入れ、余計な文字、空行を含んではいけません。</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
    $str = "bwwbwbbwbwbb";
    
    $len = mb_strlen($str);
    
    for ($i=0; $i&lt;$len; $i++) {
        ($str[$i] == "b") ? $b[] = 1 : $b[] = 0;
    }
    $s[0] = 0;
    for ($i=0; $i&lt;$len; $i++) {
        $s[$i+1] = $s[$i]+$b[$i];
    }
    //print_r($s);
    echo $s[8]-$s[2];
?&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/09/27-04-01-02.png" alt="" class="wp-image-6748"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/27-prefix_sum_problems-04-01-00626/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【累積和メニュー】区間内の個数 3 (paizaランク C)-解答例-PHP編</title>
		<link>https://chokomon.com/27-prefix_sum_problems-03-03-623/</link>
					<comments>https://chokomon.com/27-prefix_sum_problems-03-03-623/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Fri, 09 Sep 2022 03:38:11 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[累積和メニュー]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクC]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6728</guid>

					<description><![CDATA[【累積和メニュー】> 【区間内の個数】STEP: 3 区間内の個数 3 (paizaランク C 相当) [難易度: 1179 ±38] ※リンク先へ移動するためには[paiza]へのログインが必要です。 解答例]]></description>
										<content:encoded><![CDATA[
<p>【<a href="https://chokomon.com/paiza_mondai/27-prefix_sum_problems/">累積和メニュー</a>】> <a href="https://paiza.jp/works/mondai/prefix_sum_problems/prefix_sum_problems__section_count_step3" target="_blank" rel="noreferrer noopener">【区間内の個数】STEP: 3 区間内の個数 3 (paizaランク C 相当)</a> [難易度: <strong>1179 ±38</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/09/27-03-03-01.png" alt="" class="wp-image-6729"/></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>1 行目に整数 X, Y が与えられます。</p>



<p>2 行目に 10 個の整数 a_0, a_1, a_2, ..., a_9 が与えられます。</p>



<p>この数列の a_X から a_Y までの偶数の個数を、累積和を使うことで求め、一行で出力してください。</p>



<p></p>



<p><strong>入力値（例）</strong><br>2 7<br>1 2 3 4 5 6 7 8 9 10</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
    list($x, $y) = explode(" ", trim(fgets(STDIN)));
    $a = explode(" ", trim(fgets(STDIN)));
    
    for ($i=0; $i&lt;10; $i++) {
        ($a[$i] % 2 == 0) ? $b[] = 1 : $b[] = 0;
    }
    $s[0] = 0;
    for ($i=0; $i&lt;10; $i++) {
        $s[$i+1] = $s[$i]+$b[$i];
    }
    //print_r($s);
    echo $s[$y+1]-$s[$x];
?&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/09/27-03-03-02.png" alt="" class="wp-image-6730"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/27-prefix_sum_problems-03-03-623/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【スキルチェック見本問題セット】Fizz Buzz (paizaランク C)-解答例-PHP編</title>
		<link>https://chokomon.com/31-skillcheck_sample-01-05-00592/</link>
					<comments>https://chokomon.com/31-skillcheck_sample-01-05-00592/#respond</comments>
		
		<dc:creator><![CDATA[東鳥子]]></dc:creator>
		<pubDate>Sun, 21 Aug 2022 20:53:00 +0000</pubDate>
				<category><![CDATA[paiza-問題集]]></category>
		<category><![CDATA[スキルチェック見本問題セット]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ランクC]]></category>
		<category><![CDATA[難易度-1000]]></category>
		<guid isPermaLink="false">https://chokomon.com/?p=6529</guid>

					<description><![CDATA[【スキルチェック見本問題セット】> Fizz Buzz (paizaランク C 相当) [難易度: 1029 ±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/fizz-buzz" target="_blank" rel="noreferrer noopener">Fizz Buzz (paizaランク C 相当)</a> [難易度: <strong>1029 ±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-05-01.png" alt="" class="wp-image-6530"/></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 が入力として与えられます。</p>



<p>1からNまでの整数を1から順に表示してください。</p>



<p>ただし、表示しようとしている数値が、</p>



<p>・3の倍数かつ5の倍数のときには、"Fizz Buzz"<br>・3の倍数のときには、"Fizz"<br>・5の倍数のときには、"Buzz"</p>



<p>を数値の代わりに表示してください。</p>



<p></p>



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



<p><strong>出力値（例）</strong><br>1<br>2<br>Fizz<br>4<br>Buzz</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));
    
    for ($i = 1; $i &lt;= $n; $i++) {
        if ($i % 15 == 0) {
            echo "Fizz Buzz". "\n";
            
        } elseif ($i % 3 == 0) {
            echo "Fizz". "\n";
            
        } else if ($i % 5 == 0) {
            echo "Buzz". "\n";
            
        } else {
            echo $i. "\n";
            
        }
    }
?&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="240" src="https://chokomon.com/wp-content/uploads/2022/08/31-01-05-02.png" alt="" class="wp-image-6531"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://chokomon.com/31-skillcheck_sample-01-05-00592/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>
	</channel>
</rss>
