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,258 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BOJ 16236 - 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>N&times;N 크기의 공간에 물고기 M마리와 아기 상어 1마리가 있다. 공간은 1&times;1 크기의 정사각형 칸으로 나누어져 있다. 한 칸에는 물고기가 최대 1마리 존재한다.</p>
<p>아기 상어와 물고기는 모두 크기를 가지고 있고, 이 크기는 자연수이다. 가장 처음에 아기 상어의 크기는 2이고, 아기 상어는 1초에 상하좌우로 인접한 한 칸씩 이동한다.</p>
<p>아기 상어는 자신의 크기보다 큰 물고기가 있는 칸은 지나갈 수 없고, 나머지 칸은 모두 지나갈 수 있다. 아기 상어는 자신의 크기보다 작은 물고기만 먹을 수 있다. 따라서, 크기가 같은 물고기는 먹을 수 없지만, 그 물고기가 있는 칸은 지나갈 수 있다.</p>
<p>아기 상어가 어디로 이동할지 결정하는 방법은 아래와 같다.</p>
<ul>
<li>더 이상 먹을 수 있는 물고기가 공간에 없다면 아기 상어는 엄마 상어에게 도움을 요청한다.</li>
<li>먹을 수 있는 물고기가 1마리라면, 그 물고기를 먹으러 간다.</li>
<li>먹을 수 있는 물고기가 1마리보다 많다면, 거리가 가장 가까운 물고기를 먹으러 간다.
<ul>
<li>거리는 아기 상어가 있는 칸에서 물고기가 있는 칸으로 이동할 때, 지나야하는 칸의 개수의 최솟값이다.</li>
<li>거리가 가까운 물고기가 많다면, 가장&nbsp;위에 있는 물고기, 그러한 물고기가 여러마리라면, 가장 왼쪽에 있는 물고기를 먹는다.</li>
</ul>
</li>
</ul>
<p>아기 상어의 이동은 1초 걸리고, 물고기를 먹는데 걸리는 시간은 없다고 가정한다. 즉, 아기 상어가 먹을 수 있는 물고기가 있는 칸으로 이동했다면, 이동과 동시에 물고기를 먹는다. 물고기를 먹으면, 그 칸은 빈 칸이 된다.</p>
<p>아기 상어는 자신의 크기와 같은 수의 물고기를 먹을 때 마다 크기가 1 증가한다. 예를 들어, 크기가 2인 아기 상어는 물고기를 2마리 먹으면 크기가 3이 된다.</p>
<p>공간의 상태가 주어졌을 때, 아기 상어가 몇 초 동안 엄마 상어에게 도움을 요청하지 않고 물고기를 잡아먹을 수&nbsp;있는지 구하는 프로그램을 작성하시오.</p>
</article>
<article class="section">
<h2>입력</h2>
<p>첫째 줄에 공간의 크기 N(2&nbsp;&le; N &le; 20)이 주어진다.</p>
<p>둘째 줄부터 N개의 줄에 공간의 상태가 주어진다. 공간의 상태는 0, 1, 2, 3, 4, 5, 6, 9로 이루어져 있고, 아래와 같은 의미를 가진다.</p>
<ul>
<li>0: 빈 칸</li>
<li>1, 2, 3, 4, 5, 6: 칸에 있는 물고기의 크기</li>
<li>9: 아기 상어의 위치</li>
</ul>
<p>아기 상어는 공간에 한 마리 있다.</p>
</article>
<article class="section">
<h2>출력</h2>
<p>첫째 줄에 아기 상어가 엄마 상어에게 도움을 요청하지 않고 물고기를 잡아먹을 수 있는 시간을 출력한다.</p>
</article>
<article class="section">
<h2>예제 입력 1 복사</h2>
<pre class="sampledata" id="sample-input-1">3
0 0 0
0 0 0
0 9 0
</pre>
</article>
<article class="section">
<h2>예제 입력 2 복사</h2>
<pre class="sampledata" id="sample-input-2">3
0 0 1
0 0 0
0 9 0
</pre>
</article>
<article class="section">
<h2>예제 입력 3 복사</h2>
<pre class="sampledata" id="sample-input-3">4
4 3 2 1
0 0 0 0
0 0 9 0
1 2 3 4
</pre>
</article>
<article class="section">
<h2>예제 입력 4 복사</h2>
<pre class="sampledata" id="sample-input-4">6
5 4 3 2 3 4
4 3 2 3 4 5
3 2 9 5 6 6
2 1 2 3 4 5
3 2 1 6 5 4
6 6 6 6 6 6
</pre>
</article>
<article class="section">
<h2>예제 입력 5 복사</h2>
<pre class="sampledata" id="sample-input-5">6
6 0 6 0 6 1
0 0 0 0 0 2
2 3 4 5 6 6
0 0 0 0 0 2
0 2 0 0 0 0
3 9 3 0 0 1
</pre>
</article>
<article class="section">
<h2>예제 입력 6 복사</h2>
<pre class="sampledata" id="sample-input-6">6
1 1 1 1 1 1
2 2 6 2 2 3
2 2 5 2 2 3
2 2 2 4 6 3
0 0 0 0 0 6
0 0 0 0 0 9
</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">3
</pre>
</article>
<article class="section">
<h2>예제 출력 3 복사</h2>
<pre class="sampledata" id="sample-output-3">14
</pre>
</article>
<article class="section">
<h2>예제 출력 4 복사</h2>
<pre class="sampledata" id="sample-output-4">60
</pre>
</article>
<article class="section">
<h2>예제 출력 5 복사</h2>
<pre class="sampledata" id="sample-output-5">48
</pre>
</article>
<article class="section">
<h2>예제 출력 6 복사</h2>
<pre class="sampledata" id="sample-output-6">39
</pre>
</article>
</main>
</body>
</html>