PageSourceSearch

https://ancar.app/_next/static/chunks/pages/contents/problems/knapsack-a2afa9b57a0ea8d3eddb.js

js ancar.app collected 2026-10-05 09:45:27 UTC 5,677 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[282],{60456:function(e,n,r){"use strict";var t=r(67294),i=r(20527),s=r.n(i);function l(){return(l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}var a=(0,t.memo)((function(e){var n=e.children,r=e.math,i=e.block,a=e.errorColor,o=e.renderError,c=e.settings,h=e.as,u=function(e,n){if(null==e)return{};var r,t,i={},s=Object.keys(e);for(t=0;t<s.length;t++)n.indexOf(r=s[t])>=0||(i[r]=e[r]);return i}(e,["children","math","block","errorColor","renderError","settings","as"]),x=h||(i?"div":"span"),m=null!=n?n:r,j=(0,t.useState)({innerHtml:""}),f=j[0],d=j[1];return(0,t.useEffect)((function(){try{var e=s().renderToString(m,l({displayMode:!!i,errorColor:a,throwOnError:!!o},c));d({innerHtml:e})}catch(e){if(!(e instanceof s().ParseError||e instanceof TypeError))throw e;d(o?{errorElement:o(e)}:{innerHtml:e.message})}}),[i,m,a,o,c]),"errorElement"in f?f.errorElement:t.createElement(x,Object.assign({},u,{dangerouslySetInnerHTML:{__html:f.innerHtml}}))}));n.Z=a},81391:function(e,n,r){"use strict";r.r(n),r.d(n,{__N_SSP:function(){return f},default:function(){return d}});var t=r(85893),i=(r(67294),r(91075)),s=r(5789),l=r(55673),a=r(53740),o=r(60456),c=a.Z.Title,h=a.Z.Paragraph,u=function(){return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(l.default,{justify:"space-between",children:[(0,t.jsx)(s.default,{xs:24,md:18,children:(0,t.jsxs)(a.Z,{children:[(0,t.jsx)(c,{level:1,children:"\u30ca\u30c3\u30d7\u30b5\u30c3\u30af\u554f\u984c"}),(0,t.jsx)(c,{id:"about",level:2,children:"\u6982\u8981"}),(0,t.jsxs)(h,{children:["\u30ca\u30c3\u30d7\u30b5\u30c3\u30af\u554f\u984c\u3068\u306f\u3001\u5bb9\u91cf\u304c\u3042\u308b\u30ca\u30c3\u30d7\u30b5\u30c3\u30af\u306e\u4e2d\u306b\u3044\u304f\u3064\u304b\u306e\u54c1\u7269\u3092\u8a70\u3081\u8fbc\u307f\u3001\u5165\u308c\u305f\u54
1c1\u7269\u306e\u7dcf\u4fa1\u5024\u3092\u6700\u5927\u306b\u3059\u308b\u3068\u3044\u3046\u554f\u984c\u3067\u3059\u3002",(0,t.jsx)("br",{})]}),(0,t.jsx)(l.default,{justify:"center",style:{margin:"32px 0"},children:(0,t.jsxs)("figure",{style:{textAlign:"center",maxWidth:300},children:[(0,t.jsx)("img",{src:"/assets/images/knapsack.png"}),(0,t.jsx)("figcaption",{children:"\u30ca\u30c3\u30d7\u30b5\u30c3\u30af\u554f\u984c\u306e\u4f8b"})]})}),(0,t.jsx)(c,{id:"formulation",level:2,children:"\u5b9a\u5f0f\u5316"}),(0,t.jsxs)(h,{children:["\u5165\u529b\u3068\u3057\u3066\u54c1\u7269\u306e\u96c6\u5408",(0,t.jsx)(o.Z,{math:"~I=\\{1,2,\\ldots,N\\}~"}),"\u3068\u30ca\u30c3\u30d7\u30b5\u30c3\u30af\u306e\u5bb9\u91cf",(0,t.jsx)(o.Z,{math:"~W~"}),"\u304c\u4e0e\u3048\u3089\u308c\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002 \u5404\u54c1\u7269",(0,t.jsx)(o.Z,{math:"~i \\in I~"}),"\u306b\u306f\u91cd\u307f",(0,t.jsx)(o.Z,{math:"~w_{i}~"}),"\u3068\u4fa1\u5024",(0,t.jsx)(o.Z,{math:"~v_{i}~"}),"\u304c\u3042\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002\u9078\u629e\u3059\u308b\u54c1\u7269\u3092\u8868\u3059\u6c7a\u5b9a\u5909\u6570",(0,t.jsx)(o.Z,{math:"~x_{i}~"}),"\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002",(0,t.jsx)(o.Z,{math:"x_{i}~"}),"\u306f\u54c1\u7269",(0,t.jsx)(o.Z,{math:"~i \\in I~"}),"\u3092\u9078\u629e\u3059\u308b\u5834\u5408\u306b",(0,t.jsx)(o.Z,{math:"~1"}),"\u3001\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306b",(0,t.jsx)(o.Z,{math:"~0~"}),"\u3092\u53d6\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002",(0,t.jsx)(o.Z,{block:!0,math:"x_{i}=\\begin{cases}1~&(\\text{\u54c1\u7269}~i~\\text{\u3092\u9078\u629e\u3059\u308b}) \\\\0~&(\\text{\u305d\u308c\u4ee5\u5916})\\end{cases}"}),"\u3053\u306e\u3068\u304d\u3001\u30ca\u30c3\u30d7\u30b5\u30c3\u30af\u554f\u984c\u3092\u6570\u5f0f\u3067\u8868\u73fe\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002",(0,t.jsx)(o.Z,{block:!0,math:"\\max~~~~\\sum_{i \\in I} v_i x_i"}),(0,t.jsx)(o.Z,{block:!0,math:"\\textrm{s.t.}~~~~\\sum_{i \\in I} w_i x_i \\leq W"})]}),(0,t.jsxs)(h,{children:["\u4e0a\u8a18\u306e\u5f0f\u3092\u6e80\u305f\u3059\u5834\u5408\u306b\u6700\u5c0f\u5024\u3092\u3068\u308b\u3088\u3046\u306b\u3001 \u30a4\u30b8\u30f3\u30b0\u30e2\u30c7\u30eb\u306e\u30a8\u30cd\u30eb\u30ae\u30fc\u95a2\u6570",(0,t.jsx)(o.Z,{math:"~H~"}),"\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3057\u307e\u3059\u3002",(0,t.jsx)(o.Z,{block:!0,math:"H = -\\sum_{i \\in I} v_i x_i + \\left(1-\\sum_{n=1}^{W} y_n\\right)^2 + \\left(\\sum_{n=1}^{W}ny_n - \\sum_{i \\in I} w_i x_i\\right)^2"})]}),(0,t.jsx)(c,{id:"simulation",level:2,children:"\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3"}),(0,t.jsx)(h,{children:"\u3053\u3053\u3067\u306f\u3001\u30ca\u30c3\u30d7\u30b5\u30c3\u30af\u306e\u5bb9\u91cf\u3092\u8a2d\u5b9a\u3057\u3066\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f53\u9a13\u3067\u304d\u307e\u3059\u3002"})]})}),(0,t.jsx)(s.default,{span:5,className:"only-pc",children:(0,t.jsxs)(i.Z,{offsetTop:80,children:[(0,t.jsx)(i.Z.Link,{href:"#about",title:"\u6982\u8981"}),(0,t.jsx)(i.Z.Link,{href:"#formulation",title:"\u5b9a\u5f0f\u5316"}),(0,t.jsx)(i.Z.Link,{href:"#simulation",title:"\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3"})]})})]})})},x=r(23046),m=r(62984),j=r(53352),f=!0,d=(0,m.withAuthUser)()((function(){return(0,t.jsxs)(j.X,{children:[(0,t.jsx)(x.Z,{title:"\u30ca\u30c3\u30d7\u30b5\u30c3\u30af\u554f\u984c"}),(0,t.jsx)(u,{})]})}))},33007:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/contents/problems/knapsack",function(){return r(81391)}])}},function(e){e.O(0,[573,5400,4031,422,3740,921,1075,3352,9774,2888,179],(function(){return n=33007,e(e.s=n);var n}));var n=e.O();_N_E=n}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.