{"problem":{"name":"106. Geiger Counter","description":{"content":"Geiger Counter You're in a large maze, and unfortunately the maze is filled with differing amounts of uranium ore, which could potentially expose you to dangerous amounts of radioactivity. Luckily, y","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269106"},"statements":[{"statement_type":"Markdown","content":"Geiger Counter\n\nYou're in a large maze, and unfortunately the maze is filled with differing amounts of uranium ore, which could potentially expose you to dangerous amounts of radioactivity. Luckily, you have brought your trusty Geiger Counter with you, so you can measure the radioactivity of any given part of the maze in counts per minute (CPM). \n\nYou start at the top left corner of the maze, and you are trying to travel to the bottom of the maze. For any path through the maze, its _radioactivity value_ is defined as the maximum CPM across all cell in the maze that you travel through on the path. Your task is to find the path through the maze with the lowest radioactivity value, in other words, find the highest CPM you have to expose yourself to if you travel on the optimal path.\n\nYou're allowed to move in any direction (except diagonally), and you can visit the same cell twice (although it is never necessary to).\n\nNote that since the constraints on the size of the maze are fairly large, a brute force (complete search) solution that tries all possible paths,will not work.\n\nThe first line of input contains two space-separated positive integers $n$ and $m$: the number of rows and columns in the maze, respectively. $n$ and $m$ will be less than 100. The next $n$ lines each contain a string containing $m$ digits (between 0 and 9), representing the radioactivity of each space in the maze in CPM.\n\nOutput a single positive integer: the maximum amount of radioactivity that you have to expose yourself to, if you travel optimally through the maze and minimize this value.\n\nIf you aren't sure where to start, try thinking of the maze as a graph.\n\nAlso, you should add these two lines to the top of your code if you're going to use recursion in your solution and you're coding in Python:\n\n_import sys_\n\n_sys.setrecursionlimit(20000)_\n\n## Input\n\nThe first line of input contains two space-separated positive integers $n$ and $m$: the number of rows and columns in the maze, respectively. $n$ and $m$ will be less than 100. The next $n$ lines each contain a string containing $m$ digits (between 0 and 9), representing the radioactivity of each space in the maze in CPM.\n\n## Output\n\nOutput a single positive integer: the maximum amount of radioactivity that you have to expose yourself to, if you travel optimally through the maze and minimize this value.\n\n[samples]\n\n## Note\n\nIf you aren't sure where to start, try thinking of the maze as a graph.Also, you should add these two lines to the top of your code if you're going to use recursion in your solution and you're coding in Python:_import sys__sys.setrecursionlimit(20000)_","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n, m \\in \\mathbb{Z}^+ $ denote the number of rows and columns of the maze, with $ n, m < 100 $.  \nLet $ G = (V, E) $ be a grid graph where each cell $ (i, j) $, for $ 0 \\le i < n $, $ 0 \\le j < m $, is a vertex, and edges connect horizontally and vertically adjacent cells.  \nLet $ c(i, j) \\in \\{0, 1, \\dots, 9\\} $ be the radioactivity (CPM) at cell $ (i, j) $, given as a digit in the input string.\n\n**Constraints**  \n1. Start at $ (0, 0) $.  \n2. End at any cell in row $ n-1 $ (i.e., bottom row).  \n3. Movement allowed: up, down, left, right (no diagonals).  \n4. Cells may be revisited (but optimal path will not require it).  \n5. Path must be connected and finite.\n\n**Objective**  \nFind the path $ P $ from $ (0, 0) $ to some $ (n-1, j) $, $ 0 \\le j < m $, that minimizes:  \n$$\n\\max_{(i,j) \\in P} c(i, j)\n$$  \nOutput the minimal possible value of this maximum.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269106","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}