这个题目来自我大一上学期编程Online Challenges,我认为是我那个学期经历的最棘手的问题(没有之一)QwQ
本篇文章仅包含题目的内容,感兴趣的朋友一起讨论交流,我会在之后的文章里分享我的思路和代码~
首先是原汁原味的英文:
カルクドク
Bored of sudoku? Try calcudoku!
The puzzle is simple. Upon a square n×n grid, each row and column must contain a permutation of the numbers from 1 to n. Consequently, each row or column must contain each of these exactly once.
Overlaid upon the grid are a number of cages. Each cage consists of one or more contiguous cells, and contains a label. A label is a target value V, and optionally an operator, which may be any one of +, −, ∗, /.
A player must place numbers in every cage such that its indicated condition is satisfied. The rule for a given cage depends on its operator:
<