<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="th">
	<id>https://theory.cpe.ku.ac.th/wiki/index.php?action=history&amp;feed=atom&amp;title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552%2F%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%82%E0%B8%9B%E0%B8%A3%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B8%A1%E0%B8%9E%E0%B8%A5%E0%B8%A7%E0%B8%B1%E0%B8%95_I%2F%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2</id>
	<title>418531 ภาคต้น 2552/โจทย์ปัญหาการโปรแกรมพลวัต I/เฉลยข้อ 2 - ประวัติรุ่นแก้ไข</title>
	<link rel="self" type="application/atom+xml" href="https://theory.cpe.ku.ac.th/wiki/index.php?action=history&amp;feed=atom&amp;title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552%2F%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%82%E0%B8%9B%E0%B8%A3%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B8%A1%E0%B8%9E%E0%B8%A5%E0%B8%A7%E0%B8%B1%E0%B8%95_I%2F%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2"/>
	<link rel="alternate" type="text/html" href="https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%82%E0%B8%9B%E0%B8%A3%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B8%A1%E0%B8%9E%E0%B8%A5%E0%B8%A7%E0%B8%B1%E0%B8%95_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;action=history"/>
	<updated>2026-04-19T01:07:44Z</updated>
	<subtitle>ประวัติรุ่นแก้ไขของหน้านี้ในวิกิ</subtitle>
	<generator>MediaWiki 1.33.1</generator>
	<entry>
		<id>https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%82%E0%B8%9B%E0%B8%A3%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B8%A1%E0%B8%9E%E0%B8%A5%E0%B8%A7%E0%B8%B1%E0%B8%95_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7653&amp;oldid=prev</id>
		<title>Aoy: หน้าที่ถูกสร้างด้วย &#039;ให้ &lt;math&gt; OPT(i) \,&lt;/math&gt; เป็น penalty ที่น้อยที่สุดที่พิจารณาการเ…&#039;</title>
		<link rel="alternate" type="text/html" href="https://theory.cpe.ku.ac.th/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%82%E0%B8%9B%E0%B8%A3%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B8%A1%E0%B8%9E%E0%B8%A5%E0%B8%A7%E0%B8%B1%E0%B8%95_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7653&amp;oldid=prev"/>
		<updated>2009-10-03T09:43:30Z</updated>

		<summary type="html">&lt;p&gt;หน้าที่ถูกสร้างด้วย &amp;#039;ให้ &amp;lt;math&amp;gt; OPT(i) \,&amp;lt;/math&amp;gt; เป็น penalty ที่น้อยที่สุดที่พิจารณาการเ…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;หน้าใหม่&lt;/b&gt;&lt;/p&gt;&lt;div&gt;ให้ &amp;lt;math&amp;gt; OPT(i) \,&amp;lt;/math&amp;gt; เป็น penalty ที่น้อยที่สุดที่พิจารณาการเดินทางจากตำแหน่งที่ &amp;lt;math&amp;gt; i \,&amp;lt;/math&amp;gt; ถึงตำแหน่งที่ &amp;lt;math&amp;gt; n \,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
พิจารณากรณีที่ &amp;lt;math&amp;gt; i = n \,&amp;lt;/math&amp;gt; จะได้ว่า &amp;lt;math&amp;gt; OPT(n) = 0 \,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
กรณีที่ &amp;lt;math&amp;gt; i &amp;lt; n \,&amp;lt;/math&amp;gt; จะได้ว่า &amp;lt;math&amp;gt; OPT(i) = min_{(i+1) \leq j \leq n}((200-(a_j - a_i))^2+OPT(j)) \,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
คือถ้าพิจารณาการเดินทางที่มาหยุดที่ตำแหน่งที่ &amp;lt;math&amp;gt; i \,&amp;lt;/math&amp;gt; ใด ๆ ที่ไม่ใช่ตำแหน่งสุดท้ายแล้ว การตัดสินใจต่อไปคือจะไปหยุดที่ตำแหน่งไหนเป็นตำแหน่งต่อไป ซึ่งตำแหน่งที่เราสามารถหยุดได้คือ ตำแหน่งที่ &amp;lt;math&amp;gt; a_j \,&amp;lt;/math&amp;gt; โดยที่ &amp;lt;math&amp;gt; (i+1) \leq j \leq n \,&amp;lt;/math&amp;gt; นั่นเอง แล้วเราต้องเลือกหยุดตำแหน่งที่ทำให้ penalty น้อยที่สุดด้วย&lt;br /&gt;
&lt;br /&gt;
เขียนเป็น pseudocode ได้ดังนี้&lt;br /&gt;
&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
TRAVEL(a,n)&lt;br /&gt;
    M[n] = 0&lt;br /&gt;
    for i = 1 to n do&lt;br /&gt;
        min = infinity&lt;br /&gt;
        for j = i+1 to n do&lt;br /&gt;
            if (200-(a[j]-a[i]))^2 + M[j] &amp;lt; min then&lt;br /&gt;
                min = (200-(a[j]-a[i]))^2 + M[j]&lt;br /&gt;
        M[i] = min&lt;br /&gt;
    return M[0] // ส่ง ค่า M[0] เป็นคำตอบที่เป็น penalty ที่น้อยที่สุดที่พิจารณาการเดินทางจากตำแหน่ง 0 ไป n เป็นคำตอบ   &lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
</feed>