add _static

This commit is contained in:
2026-04-27 09:44:16 +09:00
parent 695760da41
commit fe8128ab65
609 changed files with 107700 additions and 0 deletions

View File

@@ -0,0 +1,251 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BOJ 14889 - 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>스타트와 링크</h1>
</header>
<article class="section">
<h2>문제</h2>
<p>오늘은 스타트링크에 다니는 사람들이 모여서&nbsp;축구를 해보려고 한다. 축구는 평일 오후에 하고&nbsp;의무 참석도 아니다. 축구를 하기 위해 모인 사람은 총 N명이고 신기하게도 N은 짝수이다. 이제 N/2명으로 이루어진 스타트 팀과 링크 팀으로 사람들을 나눠야 한다.</p>
<p>BOJ를 운영하는 회사 답게 사람에게&nbsp;번호를 1부터 N까지로 배정했고, 아래와 같은 능력치를 조사했다. 능력치 S<sub>ij</sub>는 i번 사람과 j번 사람이 같은 팀에 속했을 때, 팀에 더해지는 능력치이다. 팀의 능력치는 팀에 속한 모든 쌍의 능력치 S<sub>ij</sub>의 합이다. S<sub>ij</sub>는 S<sub>ji</sub>와 다를 수도 있으며, i번 사람과 j번 사람이 같은 팀에 속했을 때, 팀에 더해지는 능력치는 S<sub>ij</sub>와 S<sub>ji</sub>이다.</p>
<p>N=4이고, S가 아래와 같은 경우를 살펴보자.</p>
<table class="table table-bordered" style="width:20%">
<thead>
<tr>
<th>i\j</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td>&nbsp;</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<th>2</th>
<td>4</td>
<td>&nbsp;</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<th>3</th>
<td>7</td>
<td>1</td>
<td>&nbsp;</td>
<td>2</td>
</tr>
<tr>
<th>4</th>
<td>3</td>
<td>4</td>
<td>5</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>예를 들어, 1, 2번이 스타트 팀, 3, 4번이 링크 팀에 속한 경우에 두 팀의 능력치는 아래와 같다.</p>
<ul>
<li>스타트 팀: S<sub>12</sub> + S<sub>21</sub> = 1 + 4 = 5</li>
<li>링크 팀: S<sub>34</sub> + S<sub>43</sub> = 2 + 5 = 7</li>
</ul>
<p>1, 3번이 스타트 팀, 2, 4번이 링크 팀에 속하면, 두 팀의 능력치는 아래와 같다.</p>
<ul>
<li>스타트 팀: S<sub>13</sub> + S<sub>31</sub> = 2 + 7 = 9</li>
<li>링크 팀: S<sub>24</sub> + S<sub>42</sub> = 6 + 4 = 10</li>
</ul>
<p>축구를 재미있게 하기 위해서 스타트 팀의 능력치와 링크 팀의 능력치의 차이를 최소로 하려고 한다. 위의 예제와 같은 경우에는 1, 4번이&nbsp;스타트 팀, 2, 3번 팀이 링크 팀에 속하면 스타트 팀의 능력치는 6, 링크 팀의 능력치는 6이 되어서 차이가 0이 되고 이 값이 최소이다.</p>
</article>
<article class="section">
<h2>입력</h2>
<p>첫째 줄에 N(4 &le; N &le; 20, N은 짝수)이 주어진다. 둘째&nbsp;줄부터 N개의 줄에 S가 주어진다. 각 줄은 N개의 수로 이루어져 있고, i번 줄의 j번째 수는 S<sub>ij</sub> 이다. S<sub>ii</sub>는 항상 0이고, 나머지 S<sub>ij</sub>는 1보다 크거나 같고, 100보다 작거나 같은 정수이다.</p>
</article>
<article class="section">
<h2>출력</h2>
<p>첫째 줄에 스타트 팀과 링크 팀의 능력치의 차이의 최솟값을 출력한다.</p>
</article>
<article class="section">
<h2>힌트</h2>
<p>예제 2의 경우에 (1, 3, 6), (2, 4, 5)로 팀을 나누면 되고, 예제 3의 경우에는 (1, 2, 4, 5), (3, 6, 7, 8)로 팀을 나누면 된다.</p>
</article>
<article class="section">
<h2>예제 입력 1 복사</h2>
<pre class="sampledata" id="sample-input-1">4
0 1 2 3
4 0 5 6
7 1 0 2
3 4 5 0
</pre>
</article>
<article class="section">
<h2>예제 입력 2 복사</h2>
<pre class="sampledata" id="sample-input-2">6
0 1 2 3 4 5
1 0 2 3 4 5
1 2 0 3 4 5
1 2 3 0 4 5
1 2 3 4 0 5
1 2 3 4 5 0
</pre>
</article>
<article class="section">
<h2>예제 입력 3 복사</h2>
<pre class="sampledata" id="sample-input-3">8
0 5 4 5 4 5 4 5
4 0 5 1 2 3 4 5
9 8 0 1 2 3 1 2
9 9 9 0 9 9 9 9
1 1 1 1 0 1 1 1
8 7 6 5 4 0 3 2
9 1 9 1 9 1 0 9
6 5 4 3 2 1 9 0
</pre>
</article>
<article class="section">
<h2>예제 출력 1 복사</h2>
<pre class="sampledata" id="sample-output-1">0
</pre>
</article>
<article class="section">
<h2>예제 출력 2 복사</h2>
<pre class="sampledata" id="sample-output-2">2
</pre>
</article>
<article class="section">
<h2>예제 출력 3 복사</h2>
<pre class="sampledata" id="sample-output-3">1
</pre>
</article>
</main>
</body>
</html>