220 lines
21 KiB
HTML
220 lines
21 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>BOJ 34423 - Offline</title>
|
|
<style>
|
|
:root {
|
|
--bg: #fafaf8;
|
|
--paper: #ffffff;
|
|
--ink: #1e1f24;
|
|
--muted: #6a6d75;
|
|
--line: #d8dce3;
|
|
--accent: #0d6e6e;
|
|
--code-bg: #f4f6fb;
|
|
}
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
margin: 0;
|
|
background:
|
|
radial-gradient(circle at 15% 0%, #f0efe9 0%, transparent 42%),
|
|
radial-gradient(circle at 85% 20%, #e7f1f2 0%, transparent 38%),
|
|
var(--bg);
|
|
color: var(--ink);
|
|
font-family: "Noto Sans KR", "Pretendard", "Apple SD Gothic Neo", sans-serif;
|
|
line-height: 1.65;
|
|
}
|
|
main {
|
|
max-width: 980px;
|
|
margin: 0 auto;
|
|
padding: 24px 16px 56px;
|
|
}
|
|
.header {
|
|
background: var(--paper);
|
|
border: 1px solid var(--line);
|
|
border-radius: 14px;
|
|
padding: 18px 20px;
|
|
margin-bottom: 18px;
|
|
}
|
|
.header h1 { margin: 0 0 6px; font-size: 1.5rem; }
|
|
.header p { margin: 0; color: var(--muted); font-size: 0.95rem; }
|
|
.header a { color: var(--accent); text-decoration: none; }
|
|
.section {
|
|
background: var(--paper);
|
|
border: 1px solid var(--line);
|
|
border-radius: 14px;
|
|
padding: 16px 18px;
|
|
margin-bottom: 14px;
|
|
overflow-x: auto;
|
|
}
|
|
h2 {
|
|
margin: 0 0 10px;
|
|
font-size: 1.05rem;
|
|
color: var(--accent);
|
|
border-bottom: 1px solid var(--line);
|
|
padding-bottom: 8px;
|
|
}
|
|
pre, code {
|
|
font-family: "JetBrains Mono", "Fira Code", monospace;
|
|
background: var(--code-bg);
|
|
}
|
|
pre {
|
|
padding: 12px;
|
|
border-radius: 10px;
|
|
border: 1px solid #e7ebf2;
|
|
overflow: auto;
|
|
}
|
|
blockquote {
|
|
margin: 14px 0;
|
|
padding: 16px 16px 14px 22px;
|
|
border-left: 4px solid var(--accent);
|
|
border-radius: 10px;
|
|
background: linear-gradient(90deg, #eef8f8 0%, #f9fdfd 100%);
|
|
color: #24313a;
|
|
font-weight: 600;
|
|
position: relative;
|
|
}
|
|
blockquote::before {
|
|
content: "“";
|
|
position: absolute;
|
|
left: 8px;
|
|
top: 2px;
|
|
font-size: 1.35rem;
|
|
line-height: 1;
|
|
color: #0b5f5f;
|
|
opacity: 0.7;
|
|
}
|
|
blockquote > :first-child { margin-top: 0; }
|
|
blockquote > :last-child { margin-bottom: 0; }
|
|
q {
|
|
color: #114f50;
|
|
font-weight: 700;
|
|
background: #edf8f8;
|
|
border-radius: 6px;
|
|
padding: 0 4px;
|
|
}
|
|
.math-inline math {
|
|
font-size: 1em;
|
|
vertical-align: middle;
|
|
}
|
|
.math-block {
|
|
margin: 10px 0;
|
|
padding: 8px 10px;
|
|
overflow-x: auto;
|
|
background: #f8fbff;
|
|
border: 1px solid #e2ecf8;
|
|
border-radius: 8px;
|
|
}
|
|
.math-block math {
|
|
font-size: 1.04em;
|
|
display: block;
|
|
}
|
|
table { border-collapse: collapse; width: 100%; }
|
|
th, td { border: 1px solid var(--line); padding: 6px 8px; }
|
|
img { max-width: 100%; height: auto; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<header class="header">
|
|
<h1>Delivery Driver</h1>
|
|
</header>
|
|
<article class="section">
|
|
<h2>문제</h2>
|
|
<p>As a delivery driver for a food delivery service, you can work in one of three different cities each day: Denver, Ft. Collins, or Colorado Springs.</p>
|
|
|
|
<p>While working for the past few years, you have collected data on your net profit from working in each city and applied a predictive machine learning model that allows you to know exactly how much net profit you can make from working in each city for the next <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>N</mi></mrow></math></span> days.</p>
|
|
|
|
<p>The model shows that you can make different amounts of money on each day, depending on the location. Naturally, you want to work in the city where you can make the most money each day. However, driving from one city to the next is not without cost, so in some cases it may be better to stay where you are and make slightly less but not have to drive to a different city.</p>
|
|
|
|
<p>The cost to drive between cities (<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><msub><mi>c</mi><mn>1</mn></msub></mrow></math></span> and <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><msub><mi>c</mi><mn>2</mn></msub></mrow></math></span>) is given by <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>T</mi><mo stretchy="false">(</mo><msub><mi>c</mi><mn>1</mn></msub><mo>,</mo><msub><mi>c</mi><mn>2</mn></msub><mo stretchy="false">)</mo></mrow></math></span>, a constant representing how costly it is to drive from <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><msub><mi>c</mi><mn>1</mn></msub></mrow></math></span> to <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><msub><mi>c</mi><mn>2</mn></msub></mrow></math></span>. Note that <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>T</mi><mo stretchy="false">(</mo><msub><mi>c</mi><mn>1</mn></msub><mo>,</mo><msub><mi>c</mi><mn>2</mn></msub><mo stretchy="false">)</mo></mrow></math></span> is always equivalent to <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>T</mi><mo stretchy="false">(</mo><msub><mi>c</mi><mn>2</mn></msub><mo>,</mo><msub><mi>c</mi><mn>1</mn></msub><mo stretchy="false">)</mo></mrow></math></span>.</p>
|
|
|
|
<p>You want to determine which city to work in on each of the next <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>N</mi></mrow></math></span> days such that your total net profit across all of the days is maximized. (Net profit is calculated by taking the total earnings and subtracting both the operating costs for each day as well as any transition costs incurred by driving between cities.)</p>
|
|
|
|
<p>Consider the following example (which describes the first sample input). You are planning for the next <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>3</mn></mrow></math></span> days and have calculated the profit you could make in each of the cities as shown in the table below:</p>
|
|
|
|
<table class="table table-bordered table-center-30">
|
|
<tbody>
|
|
<tr>
|
|
<th>City</th>
|
|
<th>Day 1</th>
|
|
<th>Day 2</th>
|
|
<th>Day 3</th>
|
|
</tr>
|
|
<tr>
|
|
<td>Denver</td>
|
|
<td><span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>\</mi></mrow></math></span>251<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo><</mo><mo>/</mo><mi>t</mi><mi>d</mi><mo>></mo><mo><</mo><mi>t</mi><mi>d</mi><mo>></mo></mrow></math></span>\<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>78</mn></mrow></math></span></td>
|
|
<td><span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>\</mi></mrow></math></span>398<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo><</mo><mo>/</mo><mi>t</mi><mi>d</mi><mo>></mo><mo><</mo><mo>/</mo><mi>t</mi><mi>r</mi><mo>></mo><mo><</mo><mi>t</mi><mi>r</mi><mo>></mo><mo><</mo><mi>t</mi><mi>d</mi><mo>></mo><mi>F</mi><mi>t</mi><mo>.</mo><mi>C</mi><mi>o</mi><mi>l</mi><mi>l</mi><mi>i</mi><mi>n</mi><mi>s</mi><mo><</mo><mo>/</mo><mi>t</mi><mi>d</mi><mo>></mo><mo><</mo><mi>t</mi><mi>d</mi><mo>></mo></mrow></math></span>\<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>174</mn></mrow></math></span></td>
|
|
<td><span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>\</mi></mrow></math></span>92<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo><</mo><mo>/</mo><mi>t</mi><mi>d</mi><mo>></mo><mo><</mo><mi>t</mi><mi>d</mi><mo>></mo></mrow></math></span>\<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>410</mn></mrow></math></span></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Colorado Springs</td>
|
|
<td><span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>\</mi></mrow></math></span>148<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo><</mo><mo>/</mo><mi>t</mi><mi>d</mi><mo>></mo><mo><</mo><mi>t</mi><mi>d</mi><mo>></mo></mrow></math></span>\<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>151</mn></mrow></math></span></td>
|
|
<td><span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>\</mi></mrow></math></span>402$</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Further, assuming that \begin{align*} T(\text{Denver}, \text{Ft. Collins}) &= \$20, \\ T(\text{Denver}, \text{Colorado Springs}) &= \<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>17</mn><mo>,</mo><mtext>and</mtext><mspace linebreak="newline" /><mi>T</mi><mo stretchy="false">(</mo><mtext>Colorado Springs</mtext><mo>,</mo><mtext>Ft. Collins</mtext><mo stretchy="false">)</mo><mi>&</mi><mo>=</mo><mi>\</mi></mrow></math></span>34, \end{align*} if you choose to work from Denver on day <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>1</mn></mrow></math></span>, Colorado Springs on day <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>2</mn></mrow></math></span> and day <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>3</mn></mrow></math></span>, then your total net profit would be: \begin{align*} P_\text{total} &= \underbrace{\<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>251</mn><msub><mi>}</mi><mtext>{</mtext></msub><mi>D</mi><mi>a</mi><mi>y</mi></mrow></math></span>1<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>p</mi><mi>r</mi><mi>o</mi><mi>f</mi><mi>i</mi><mi>t</mi><mi>}</mi><mo>−</mo><munder><mrow><mi>\</mi></mrow><mo>⏟</mo></munder></mrow></math></span>17}_\text{Denver to Colorado Springs} + \underbrace{\<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>151</mn><msub><mi>}</mi><mtext>{</mtext></msub><mi>D</mi><mi>a</mi><mi>y</mi></mrow></math></span>2<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>p</mi><mi>r</mi><mi>o</mi><mi>f</mi><mi>i</mi><mi>t</mi><mi>}</mi><mo>+</mo><munder><mrow><mi>\</mi></mrow><mo>⏟</mo></munder></mrow></math></span>402}_\text{Day <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>3</mn></mrow></math></span> profit} = \<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>787</mn><mi>\end{align*}</mi><mi>w</mi><mi>h</mi><mi>e</mi><mi>r</mi><mi>e</mi><mi>a</mi><mi>s</mi><mi>i</mi><mi>f</mi><mi>y</mi><mi>o</mi><mi>u</mi><mi>c</mi><mi>h</mi><mi>o</mi><mi>s</mi><mi>e</mi><mi>t</mi><mi>o</mi><mi>w</mi><mi>o</mi><mi>r</mi><mi>k</mi><mi>f</mi><mi>r</mi><mi>o</mi><mi>m</mi><mi>D</mi><mi>e</mi><mi>n</mi><mi>v</mi><mi>e</mi><mi>r</mi><mi>o</mi><mi>n</mi><mi>d</mi><mi>a</mi><mi>y</mi></mrow></math></span>1<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo>,</mo><mi>C</mi><mi>o</mi><mi>l</mi><mi>o</mi><mi>r</mi><mi>a</mi><mi>d</mi><mi>o</mi><mi>S</mi><mi>p</mi><mi>r</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi>s</mi><mi>o</mi><mi>n</mi><mi>d</mi><mi>a</mi><mi>y</mi></mrow></math></span>2<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo>,</mo><mi>a</mi><mi>n</mi><mi>d</mi><mi>F</mi><mi>t</mi><mo>.</mo><mi>C</mi><mi>o</mi><mi>l</mi><mi>l</mi><mi>i</mi><mi>n</mi><mi>s</mi><mi>o</mi><mi>n</mi><mi>d</mi><mi>a</mi><mi>y</mi></mrow></math></span>3$, then your total net profit would be: \begin{align*} P_\text{total} &= \underbrace{\$251}_\text{Day <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>1</mn></mrow></math></span> profit} - \underbrace{\<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>17</mn><msub><mi>}</mi><mtext>Denver to Colorado Springs</mtext></msub><mo>+</mo><munder><mrow><mi>\</mi></mrow><mo>⏟</mo></munder></mrow></math></span>151}_\text{Day <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>2</mn></mrow></math></span> profit} - \underbrace{\<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>34</mn><msub><mi>}</mi><mtext>Colorado Springs to Ft. Collins</mtext></msub><mo>+</mo><munder><mrow><mi>\</mi></mrow><mo>⏟</mo></munder></mrow></math></span>410}_\text{Day <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>3</mn></mrow></math></span> profit} = \<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>761</mn><mo>.</mo><mi>\end{align*}</mi><mo><</mo><mo>/</mo><mi>p</mi><mo>></mo><mo><</mo><mi>p</mi><mo>></mo><mi>C</mi><mi>l</mi><mi>e</mi><mi>a</mi><mi>r</mi><mi>l</mi><mi>y</mi><mo>,</mo><mi>t</mi><mi>h</mi><mi>e</mi><mi>f</mi><mi>i</mi><mi>r</mi><mi>s</mi><mi>t</mi><mi>o</mi><mi>p</mi><mi>t</mi><mi>i</mi><mi>o</mi><mi>n</mi><mi>i</mi><mi>s</mi><mi>b</mi><mi>e</mi><mi>t</mi><mi>t</mi><mi>e</mi><mi>r</mi><mo>!</mo><mi>E</mi><mi>v</mi><mi>e</mi><mi>n</mi><mi>t</mi><mi>h</mi><mi>o</mi><mi>u</mi><mi>g</mi><mi>h</mi><mi>i</mi><mi>t</mi><mi>m</mi><mi>a</mi><mi>y</mi><mi>b</mi><mi>e</mi><mi>t</mi><mi>e</mi><mi>m</mi><mi>p</mi><mi>t</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi>t</mi><mi>o</mi><mi>g</mi><mi>o</mi><mi>t</mi><mi>o</mi><mi>F</mi><mi>t</mi><mo>.</mo><mi>C</mi><mi>o</mi><mi>l</mi><mi>l</mi><mi>i</mi><mi>n</mi><mi>s</mi><mi>o</mi><mi>n</mi><mi>D</mi><mi>a</mi><mi>y</mi></mrow></math></span>3<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo>,</mo><mi>t</mi><mi>h</mi><mi>e</mi><mi>c</mi><mi>o</mi><mi>s</mi><mi>t</mi><mi>o</mi><mi>f</mi><mi>d</mi><mi>r</mi><mi>i</mi><mi>v</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi>t</mi><mi>h</mi><mi>e</mi><mi>r</mi><mi>e</mi><mi>f</mi><mi>r</mi><mi>o</mi><mi>m</mi><mi>C</mi><mi>o</mi><mi>l</mi><mi>o</mi><mi>r</mi><mi>a</mi><mi>d</mi><mi>o</mi><mi>S</mi><mi>p</mi><mi>r</mi><mi>i</mi><mi>n</mi><mi>g</mi><mi>s</mi><mi>i</mi><mi>s</mi><mi>t</mi><mi>o</mi><mi>o</mi><mi>g</mi><mi>r</mi><mi>e</mi><mi>a</mi><mi>t</mi><mo>.</mo><mo><</mo><mo>/</mo><mi>p</mi><mo>></mo><mo><</mo><mi>p</mi><mo>></mo><mi>C</mi><mi>a</mi><mi>n</mi><mi>y</mi><mi>o</mi><mi>u</mi><mi>w</mi><mi>r</mi><mi>i</mi><mi>t</mi><mi>e</mi><mi>a</mi><mi>p</mi><mi>r</mi><mi>o</mi><mi>g</mi><mi>r</mi><mi>a</mi><mi>m</mi><mi>w</mi><mi>h</mi><mi>i</mi><mi>c</mi><mi>h</mi><mi>t</mi><mi>e</mi><mi>l</mi><mi>l</mi><mi>s</mi><mi>y</mi><mi>o</mi><mi>u</mi><mi>w</mi><mi>h</mi><mi>i</mi><mi>c</mi><mi>h</mi><mi>c</mi><mi>i</mi><mi>t</mi><mi>y</mi><mi>t</mi><mi>o</mi><mi>w</mi><mi>o</mi><mi>r</mi><mi>k</mi><mi>f</mi><mi>r</mi><mi>o</mi><mi>m</mi><mi>f</mi><mi>o</mi><mi>r</mi><mi>e</mi><mi>a</mi><mi>c</mi><mi>h</mi><mi>o</mi><mi>f</mi><mi>t</mi><mi>h</mi><mi>e</mi><mi>n</mi><mi>e</mi><mi>x</mi><mi>t</mi></mrow></math></span>N<span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>d</mi><mi>a</mi><mi>y</mi><mi>s</mi><mi>s</mi><mi>u</mi><mi>c</mi><mi>h</mi><mi>t</mi><mi>h</mi><mi>a</mi><mi>t</mi><mi>t</mi><mi>o</mi><mi>t</mi><mi>a</mi><mi>l</mi><mi>n</mi><mi>e</mi><mi>t</mi><mi>p</mi><mi>r</mi><mi>o</mi><mi>f</mi><mi>i</mi><mi>t</mi></mrow></math></span>P$ across all of the days is maximized? Note that you can start and end in any city you wish, and the start and end cities do not have to be the same.</p>
|
|
</article>
|
|
<article class="section">
|
|
<h2>입력</h2>
|
|
<p>The first line contains three, space-separated integers representing the values of <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>T</mi><mo stretchy="false">(</mo><mtext>Denver</mtext><mo>,</mo><mtext>Ft. Collins</mtext><mo stretchy="false">)</mo></mrow></math></span>, <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>T</mi><mo stretchy="false">(</mo><mtext>Denver</mtext><mo>,</mo><mtext>Colorado Springs</mtext><mo stretchy="false">)</mo></mrow></math></span>, and <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>T</mi><mo stretchy="false">(</mo><mtext>Colorado Springs</mtext><mo>,</mo><mtext>Ft. Collins</mtext><mo stretchy="false">)</mo></mrow></math></span>, respectively.</p>
|
|
|
|
<p>The next line contains a single integer <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>2</mn><mo>≤</mo><mi>N</mi><mo>≤</mo><mn>100</mn></mrow></math></span>, the number of days that you have to plan for.</p>
|
|
|
|
<p>The next <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>3</mn></mrow></math></span> lines contain a list of <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>N</mi></mrow></math></span> space-separated integers representing the potential profit for the next <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>N</mi></mrow></math></span> days in Denver, Ft. Collins, and Colorado Springs, respectively.</p>
|
|
|
|
<p>All monetary numbers will be integers between <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>0</mn></mrow></math></span> and <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mn>100</mn><mspace width="0.167em" /><mn>000</mn></mrow></math></span>.</p>
|
|
</article>
|
|
<article class="section">
|
|
<h2>출력</h2>
|
|
<p>The first and only line of output is the maximum total net profit <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>P</mi></mrow></math></span> across all <span class="math-inline"><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>N</mi></mrow></math></span> days in dollars.</p>
|
|
</article>
|
|
<article class="section">
|
|
<h2>예제 입력 1 복사</h2>
|
|
<pre class="sampledata" id="sample-input-1">20 17 34
|
|
3
|
|
251 78 398
|
|
174 92 410
|
|
148 151 402
|
|
</pre>
|
|
</article>
|
|
<article class="section">
|
|
<h2>예제 입력 2 복사</h2>
|
|
<pre class="sampledata" id="sample-input-2">5 5 5
|
|
3
|
|
6 1 0
|
|
0 5 7
|
|
0 0 0
|
|
</pre>
|
|
</article>
|
|
<article class="section">
|
|
<h2>예제 입력 3 복사</h2>
|
|
<pre class="sampledata" id="sample-input-3">2 1 3
|
|
3
|
|
0 2 3
|
|
0 1 0
|
|
10 1 0
|
|
</pre>
|
|
</article>
|
|
<article class="section">
|
|
<h2>예제 출력 1 복사</h2>
|
|
<pre class="sampledata" id="sample-output-1">787
|
|
</pre>
|
|
</article>
|
|
<article class="section">
|
|
<h2>예제 출력 2 복사</h2>
|
|
<pre class="sampledata" id="sample-output-2">13
|
|
</pre>
|
|
</article>
|
|
<article class="section">
|
|
<h2>예제 출력 3 복사</h2>
|
|
<pre class="sampledata" id="sample-output-3">14
|
|
</pre>
|
|
</article>
|
|
</main>
|
|
</body>
|
|
</html>
|