-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eefbb20
commit 5d99b8b
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<link rel="stylesheet " type="text/css" href="/cses.css?0" id="styles"> | ||
<link rel="stylesheet alternate" type="text/css" href="/cses-dark.css?0" id="styles-dark"> | ||
<meta name="theme-color" content="white" id="theme-color"> | ||
<script type="application/json" id="darkmode-enabled">false</script> | ||
<script src="/ui.js"></script> | ||
<link rel="stylesheet" type="text/css" href="/lib/fontawesome/css/all.min.css"> | ||
</head> | ||
<body class="with-sidebar "> | ||
<div class="header"> | ||
<div> | ||
<a href="/" class="logo"><img src="/logo.png?1" alt="CSES"></a> | ||
<a class="menu-toggle" onclick="document.body.classList.toggle('menu-open');"> | ||
<i class="fas fa-bars"></i> | ||
</a> | ||
<div class="controls"> | ||
<a class="account" href="/login">Login</a> | ||
<span>—</span> | ||
<a href="/darkmode" title="Toggle dark mode" onclick="return toggle_theme()"><i aria-label="Dark mode" class="fas fa-adjust"></i><span>Dark mode</span></a> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="skeleton"> | ||
|
||
<div class="navigation"> | ||
<div class="title-block"> | ||
<h3><a href="/problemset/list/">CSES Problem Set</a></h3> | ||
<h1>Counting Rooms</h1> | ||
<ul class="nav"> | ||
<li><a href="/problemset/task/1192/" class="current">Task</a></li> | ||
<li><a href="/problemset/stats/1192/" >Statistics</a></li> | ||
</ul> | ||
</div> | ||
<div class="sidebar"></div> | ||
</div> | ||
|
||
<div class="content-wrapper"> | ||
|
||
<div class="content"> | ||
|
||
|
||
<title>CSES - Counting Rooms</title><link rel="stylesheet" href="/lib/katex/katex.min.css"> | ||
<script defer src="/lib/katex/katex.min.js"></script> | ||
<script defer src="/lib/katex/contrib/copy-tex.min.js"></script> | ||
<script defer src="/lib/google-code-prettify/run_prettify.js"></script> | ||
<script> | ||
addEventListener("DOMContentLoaded", function (e) { | ||
const mathElements = document.getElementsByClassName("math"); | ||
const macros = {}; | ||
for (let element of mathElements) { | ||
katex.render(element.textContent, element, { | ||
displayMode: element.classList.contains("math-display"), | ||
throwOnError: false, | ||
globalGroup: true, | ||
macros, | ||
}); | ||
} | ||
}); | ||
</script> | ||
<ul class="task-constraints"> | ||
<li><b>Time limit:</b> 1.00 s</li> | ||
<li><b>Memory limit:</b> 512 MB</li> | ||
</ul> | ||
<input type="hidden" name="course" value="problemset"> | ||
<input type="hidden" name="task" value="1192"> | ||
<div class="md"><p>You are given a map of a building, and your task is to count the number of its rooms. The size of the map is <span class="math math-inline">n \times m</span> squares, and each square is either floor or wall. You can walk left, right, up, and down through the floor squares.</p> | ||
<h1 id="input">Input</h1> | ||
<p>The first input line has two integers <span class="math math-inline">n</span> and <span class="math math-inline">m</span>: the height and width of the map.</p> | ||
<p>Then there are <span class="math math-inline">n</span> lines of <span class="math math-inline">m</span> characters describing the map. Each character is either <code>.</code> (floor) or <code>#</code> (wall).</p> | ||
<h1 id="output">Output</h1> | ||
<p>Print one integer: the number of rooms.</p> | ||
<h1 id="constraints">Constraints</h1> | ||
<ul> | ||
<li><span class="math math-inline">1 \le n,m \le 1000</span></li> | ||
</ul> | ||
<h1 id="example">Example</h1> | ||
<p>Input:</p> | ||
<pre>5 8 | ||
######## | ||
#..#...# | ||
####.#.# | ||
#..#...# | ||
######## | ||
</pre> | ||
<p>Output:</p> | ||
<pre>3 | ||
</pre></div> </div> | ||
<div class="nav sidebar"> | ||
<h4>Graph Algorithms</h4><a class="current" href="/problemset/task/1192">Counting Rooms<span class="task-score icon "></span></a><a href="/problemset/task/1193">Labyrinth<span class="task-score icon "></span></a><a href="/problemset/task/1666">Building Roads<span class="task-score icon "></span></a><a href="/problemset/task/1667">Message Route<span class="task-score icon "></span></a><a href="/problemset/task/1668">Building Teams<span class="task-score icon "></span></a><a href="/problemset/task/1669">Round Trip<span class="task-score icon "></span></a><a href="/problemset/task/1194">Monsters<span class="task-score icon "></span></a><a href="/problemset/task/1671">Shortest Routes I<span class="task-score icon "></span></a>... | ||
<hr /> |