righthand

版主
  • 内容数

    98
  • 注册日期

  • 最后上线

righthand 发表的所有内容

  1. 谜题玩家作品

    Just One Cell一格数独 规则:在下面的标准数独有多个解,但在所有的解中有一个格子中填入的数字是不变的,请找到这个格子及其应该填入的数。
  2. 谜题玩家作品

    Tapa 规则:将盘面中某些空格涂黑,使得涂黑区域互相连续。格内的数字表示周围八格涂黑的情况,每个数字代表一组连续格位,两组连续格位之间至少有一个空白格隔开,不可同时涂黑2×2区域。
  3. 谜题玩家作品

    克隆数独:无马+无VX 规则一:遵循标准数独规则,同时,任意一格与在其上放一个象棋中的马能一步跳到的格子中的数字不相同。 规则二:遵循标准数独规则,同时,任意相邻两格的数字之和不能为5或者10。 在线做题:http://www.sudokufans.org.cn/2008/index2.php?ti=5...8...9...4.3.....7...8...3.....9.2...3...1.7.....3...3...5.....3.5...6...7...3 (这里只按标准数独规则判断,是否符合无马、无VX的条件需要自行判断)
  4. 谜题玩家作品

    摇啊摇Shakashaka 规则:将图中一些白格中填入三角形(◢ ◣ ◤ ◥),一个白格最多填入一个三角形,使得图中给出的数字恰好等于其相邻四格中填入三角形的格子的数量。且图中空白的区域形成一些互不相邻的矩形(含正方形)。 难度:容易 在线做题:http://www.sudokufans.org.cn/puzzle/p.html?shakashaka/10/10/hdhbziaccxacezjccg
  5. 谜题玩家作品

    数回SlitherLink 规则:在图中经过给定的点沿水平或垂直方向画一条不交叉的回路,图中给出的数字表示其周围4条边线中回路经过的边线数量。 下面是我做的一道数回谜题,难度为中级。 在线做题:http://www.sudokufans.org.cn/puzzle/p.html?slither/10/10/678bh2bi82d7dj3d28826b2chdb5dhci702dg81bg2bhdgb
  6. 谜题玩家作品

    Scrabble是国外很流行的一种填字游戏,可以多人对抗,也有很多专门的比赛。在谜题中Scrabble要求将给定的一组单词按从左到右或从上到下填入图中,每格填一个字母,最后形成一个连通的整体,且不能出现未给定的单词。 Scrabble Loop是在Scrabble基础上演变出来的一个题型,规则如下: 将给定的单词按从左到右或从上到下填入图中,每格填一个字母,最后形成一个连通的整体,且不能出现未给定的单词。每个单词的首字母必须填在用颜色标出的格子中。填入完成后,经过所有未填入字母的格子中心沿水平或垂直方向可以画一条不交叉的回路。 下面是我做的一个Scrabble Loop谜题,难度为容易。用的单词都是独数之道群里的id,不过非常的id改成了feic(sorry)。感兴趣的可以试试看。
  7. 谜题玩家作品

    Cave洞穴 规则:在图中沿格子的边线画一条不分叉的单一的回路,将所有数字围在回路中。数字表示从该格向上下左右四个方向能看到的格子之和,包括该格本身。如果同一行或列的两个格子之间被回路边线隔开,那么这两个格子互相看不见,否则互相可以看见。 难度:中级。 在线做题:http://www.sudokufans.org.cn/puzzle/p.html?bag/10/10/g2h2h5q8g3j4i3h7q5g2j9g4q4h5i6j4gcq3h3h6g
  8. 谜题玩家作品

    Masyu珍珠 规则:在图中经过一些格子的中心沿水平或垂直方向画一条不交叉的回路经过所有的圈(也就是珍珠)。回路经过白圈时不能改变方向,但必须在白圈前一格和后一格中至少一格改变方向。回路经过黑格时必须改变方向,但在进入黑格前一格和离开黑格之后的一格中不能改变方向。 难度:容易。 在线做本题:http://www.sudokufans.org.cn/puzzle/p.html?mashu/10/10/00019oic0000002i99o00000029kic0000
  9. 谜题玩家作品

    自行车Bicycle 规则:图中一些格子中画有圆圈,请将所有这些圆圈两两配对并用横或竖线连接起来组成自行车,自行车长度可以为2-4格,且任意两辆自行车不能交叉或共用圆圈。图外的数字代表该行横向的自行车数量或该列纵向的自行车数量。 难度:容易
  10. 谜题玩家作品

    仙人指路Yajilin 规则:将图中一些格子涂黑,涂黑的格子不能相连。带箭头的数字代表该方向的黑格数量,有数字的格子不能涂黑。然后经过所有没有涂黑也没有数字的格子的中心,沿水平或垂直方向画一条不交叉也不分叉的回路。 难度:中等 在线做本题:http://www.sudokufans.org.cn/puzzle/p.html?yajilin/10/10/e41f23o31d42b32c11r21c42b20d41o12f31e
  11. 谜题玩家作品

    数墙Nurikabe 规则:将图中的一些格子涂黑,使得黑格彼此相连,且任意2X2的格子不能都是黑格。这些黑格将剩余的白格划分成一些岛,每个岛中正好包含一个带数字的格子,其中的数字等于岛中包含的白格的数量。带数字的格子不能被涂黑。 难度:难 在线做本题:http://www.sudokufans.org.cn/puzzle/p.html?nurikabe/10/10/q6h5m5s4j2v3xam4h6q
  12. 谜题玩家作品

    数连 规则:图中相同的数字用一根线连起来,不同数字间的连线不能交叉,且线只能经过格子中心沿水平或垂直方向前进。 难度:容易 在线做本题:http://www.sudokufan...n5g4zn356h7t2o1
  13. 上面的信息有些出入。 出题人是俄罗斯的Andrey Bogdanov 主题是:7武士 其实就是7种传统谜题,但是都做成了连体的形式,称为“武士”。 每道题都可以视为两个独立的谜题,但是连体部分对于两个谜题来说是相同的。
  14. 在数独玩家论坛看到一篇不错的文章,转过来大家共享一下,原文地址为: http://forum.enjoysu...arks-t3640.html Solving without pencilmarks by RW » Sat Mar 25, 2006 7:40 am The more I read posts on this forum, the more I get the feeling that I'm the only person in the world who solve exclusively without pencilmarks, regardless off difficulty. I often read comments like "no other than the easiest puzzles can be solved without pencilmarks" or "techniques that are impossible for human solvers.". Now I wish to show you that none of those are true. First I'll give you some tips that I've found usefull, then I'll take you through a step by step solution of a couple of extreme puzzles, the way I solve them, and hope that you can follow without making any own pencilmarks. If anybody else has got any good tips on solving without pencilmarks, please post them here and we can try to make a little collection of these techniques. First of all, whenever I say that I solve without pencilmarks, peoples first reaction is: "then you must have a really good memory". My answer is yes, but I hardly ever use it. The most important thing I've learned so far is to choose what information to memorize. There is simply so much information to be found in any grid, that one can't remember it all. Most of this information is useless. When I started doing Sudoku I often found myself trying to memorize possible values for cells, drawing a mental pencilmarkgrid. When I finally realised that this is pointless, my solving improved significantly. Most puzzles can be solved exclusively with naked or hidden singles, then what's the point in knowing that a cell can hold numbers 1,2,6 and 7? In fact, all numbers are solved by naked or hidden singles, all other techniques only reduce possibilities. So what I’m interrested in is these reduced possibilities. Instead of memorizing possible candidates, I memorize impossible candidates. As most of the impossibles can be read from the column, row and box of each cell, there isn’t really that much to remember. Only when I make a reduction through some other technique, like x-wing, uniqueness etc., I memorize the reduced candidates. Apart from this I memorize locations of pairs and triplets, but the rest of the information about each cell I put aside as soon that I can see that it doesn’t help me at the moment. I guess most of you use pencilmarks to spot singles, so the most important thing to improve if you want to solve without pencilmarks is not your memory, but your ability to spot singles. The hidden singles are usually easy to spot, just picture horisontal and vertical lines going through all instances of a particular number and find the only empty square. Naked are harder to find. Going through the whole puzzle cell by cell is very timeconsuming. I rather look for them one row or column at a time. I start with the rows/columns that have most numbers already, then I count from 1 to 9, leaving out all the numbers already in the row. Example: *-----------*|..1|..2|35.||...|...|2..||.8.|4..|.91||---+---+---||5.9|31.|4..||...|7.4|...||..7|.25|8.3||---+---+---||86.|..9|.3.||..3|...|...||.74|1..|5..|*-----------*If I wanted to find naked singles in this puzzle, I would start with row 4 that already has 5 numbers, then count: “. 2 . . . 6 7 8 .” These are the 4 numbers that go in the four empty cells, so now I compare each cell against these numbers. R4c2 has 6, 7 and 8 in the same column, so there’s a naked single (2). This trick is also efficient when looking for hidden singles in rows or columns (try it on row 6). If you systematically go through all rows like this you will find all naked singles in no time. So when do I need the good memory? That’s only when I can’t find anything else and start “trailing”. Trailing is a common term I like to use for any technique that involves reading many steps ahead. The different trails I’m looking for are trails that lead to contradictions, double solutions or forcing chains (which obviously involves at least two trails). Almost any puzzle can be solved with relatively short (<5 steps) trails, only the most evil puzzles require longer. Reading many steps ahead requires a lot of practise, but it’s not in any way impossible to learn. You may start your practise on easy puzzles that you can effectively solve without marks already. Instead of writing in an obvious number, try to find one or two other numbers solved by your original number and then write them in all at a time. Then you can gradually extend the trail. I used to have problems reading more than 3 steps ahead, now I usually solve all puzzles up to moderate level in my local newspaper one number at a time - don’t write down anything until I solved all instances of the number. This might seem hard at first, but with proper training anybody can run a marathon. Another question I often get is ”how can you use advanced techniques like coloring or XYWhatever-wing without pencilmarks?” The answer is very simple, I don’t use them. Techniques like these are in my opinion not at all advanced, but limitations of the real techniques behind them. They are limitations in the sence that they actually apply different trailing techniques, but only on very special patterns that somebody has predefined for you as they can be seen in a pencilmarkgrid. When programming your solver software this might be neccessary, but as a human solver you should be able to see the logic in any situation. Take for example “multiple colors”. When I first got Simple Sudoku I opened a “multiple colors”-example to see what it was about. First I solved it in my way, then I checked how SS would have done it. I found that it colored all cells with candidate 2 in five different colors, then removed some candidates of number 2. I could see that all these candidates shared an unit with a 2 that I had solved with a short forcing chain. I then checked all the other examples of multiple colors and found that in every case a cell connecting all removed candidates could be solved with a simple forcing chain. So apparently this is a technique that you can use instead of a forcing chain if it considers only one candidate number, if all instances form a specific pattern and if you have a good set of crayons. Well, then I prefer the forcing chain as it applies to endless situations where the crayons won’t help you. Guess you want to see the example: *-----------*|78.|3..|.1.||615|.8.|.32||3.9|.1.|8..||---+---+---||1.8|..3|.6.||.73|462|1..||.6.|1.8|7.3||---+---+---||..1|.3.|6..||85.|.4.|3.1||.3.|..1|..5|*-----------*I used this forcing chain:if r1c3=2 => r9c5=2 => r4c7=2 if r3c2=2 => r6c1 or r6c3=2 =>r4c7=2 Simple sudokus advanced spread of colors across the grid ended up in removing candidate 2 from r4c2, r6c8 and r9c7, which I obviously also could do after solving r4c7 with the forcing chain. My last tip before getting on with the actual puzzles is this: UNIQUENESS!! Uniqueness patterns are everywhere and they often provide a very easy solution to extreme puzzles. The best thing with them is that they are very easy to spot. Again, don’t limit yourself to the reductions explained in different forums, be creative. My approach is that whenever I see two corners of a uniqueness square in place, I put in a third corner and read ahead to see if it gives me the forth. Actually, whenever I could make any move that results in three corners of the square in place I read ahead to see if the forth falls in place. It often does, so these are very good spots to start your trails from if you're stuck. Now let’s have a look at some extreme puzzles. I recommend that you copy them into some sudoku program (without pencilmarks) and follow as we go along. To help you follow without pencilmarks I’ll use these abbreviations on how I solve each number: Ce = only possible number that can go in the cell Co = only possible cell for number in column R = only possible cell for number in row B = only possible cell for number in box First an extreme from Simple Sudoku: Puzzle 1 *-----------*|.2.|1.8|..5||1..|.76|.3.||7..|4..|...||---+---+---||..7|...|2..||48.|...|.59||..2|...|6..||---+---+---||...|..9|..1||.5.|74.|..6||6..|8.1|.7.|*-----------*First the obvious ones:r7c2=7 ( r1c7=7 ( r6c9=7 ( r5c6=7 ( r8c3=1 ( I can’t see anymore obvious cells by drawing lines, but I can see two pairs: r78c1={2,8} ® and r23c3={5,8} ( . Next I start checking rows, starting with row 1. Two pairs there also: c1&5={3,9} and c3&8={4,6}. This is enough to solve the next number: [edit: typo there, the first pair should read r78c1={2,8} (Co) = the two numbers cannot go anywhere else in the column.] r9c3=9 (Co) This gives me another pair: r7c3 and r9c2={3,4} – so far 5 pairs to remember. Now I see a very obvious trail: if r1c1=9 => r3c2=3 ( => r9c2=4 (Co) => r1c3=4 ( => nowhere to place 6 in box 1. This gives me: r1c1=3 (Ce) r1c5=9 (Ce) At this point I can tell that 5 cannot go in r4c4 or r6c4 ({9,5} uniqueness square with c1), always worth to notice. I decide to check the other pair of row 1 and find: if r1c3=6 => r1c8=4 => r4c9=4 ( and if r1c3=6 => r2c2=4 => r9c2=3 => nowhere to place 3 in column 9. This gives me: r1c3=4 (Ce) r1c8=6 (Ce) r3c2=6 ( r5c3=6 ( r7c3=3 (Ce) r9c2=4 ( r2c2=9 ( Now I have: *-----------*|324|198|765||19.|.76|.3.||76.|4..|...||---+---+---||..7|...|2..||486|..7|.59||..2|...|6.7||---+---+---||.73|..9|..1||.51|74.|..6||649|8.1|.7.|*-----------*Still can’t see any obvious so I have a look at column 9, missing numbers 2,3,4 and 8. This gives me an idea that I have to check out and this is what I see: if r3c5 or r3c6=2 =>r2c9=2 ( and if r2c4=2 => r2c3=5 ® => r3c3=8 => r3c9=2 (Ce) Anyway, r9c9 cannot be 2. This gives me a 2 in either r7c8 or r8c8 that not only forms an x-wing with c1 but also lets me exclude 8 from both squares (uniqueness). Thanks to this I can go on: r8c6=3 (Ce) r9c5=2 ( r5c4=2 ( r3c6=2 ( r2c9=2 ( and so on... rest of the puzzle is only singles so I guess you can do it yourself. There the puzzle was solved with a few short trails, max 4 steps. Could you follow without pencilmarks? If you could, then you can also do this yourself. If you try enough short trails you will find lots of reductions like the ones I made here. As you could see the only neccessary memorizing I did was the 5 pairs, that soon could be forgotten as they were solved (or made obvious by filling in the rest of the boxes), and then i memorized max 4 numbers at a time while trailing. Let’s have a look at one more puzzle, this is a Solo extreme, that Simple Sudoku cannot provide a logical solution for. Let’s find out how hard it really is: Puzzle 2 *-----------*|1..|.32|5..||5..|...|.92||7..|5..|4..||---+---+---||...|.2.|71.||...|4.8|...||.21|.5.|...||---+---+---||..8|..5|..7||31.|...|..6||..7|84.|..9|*-----------*First the singles:r3c9=1 (Co) r5c2=7 ( r1c8=7 ( r1c9=8 (Ce) r2c6=4 ( r4c1=8 ( r3c3=2 ( r5c5=1 ( r2c4=1 ( r2c5=7 ( r2c2=8 ® r3c5=8 ( r9c6=1 ( r7c7=1 ( r7c5=6 ® r8c5=9 (Ce) r7c4=3 ( r8c4=2( r8c6=7 (Ce) r6c4=7 ( r8c7=8 (Ce) r6c8=8 ( This is the situation: *-----------*|1..|.32|578||58.|174|.92||7.2|58.|4.1||---+---+---||8..|.2.|71.||.7.|418|...||.21|75.|.8.||---+---+---||..8|365|1.7||31.|297|8.6||..7|841|..9|*-----------*At this point I can’t see any more obvious cells, so I start reading through rows and columns. In column 1 I react on r5c1 that has to hold 6 or 9. This tells me that if r5c7=9 => r5c1=6 (Ce) => r6c7=6 ( . That’s three corners of the uniqueness square so I decide to follow the trail a bit further. And, not to my suprise, I find three steps ahead: if r5c7=9 => r5c1=6 (Ce) => r6c7=6 ( => r3c8=6 ( => r3c6=9 (Ce) => r6c1=9 ® => Double solution. I can remove that option and go on: r6c7=9 ( r5c1=9 (Ce) r7c2=9 ( r1c3=9 ( r3c6=9 ( r4c4=9 ( r1c4=6 (Ce) r1c2=4 (Ce) Current situation: *-----------*|149|632|578||58.|174|.92||7.2|589|4.1||---+---+---||8..|92.|71.||97.|418|...||.21|75.|98.||---+---+---||.98|365|1.7||31.|297|8.6||..7|841|..9|*-----------*Now this trail immediately jumps into my face: if r4c2=3 => r6c6=3 ( => r6c1=6 ® => no way to fit numbers 3 and 6 into column 3. I can remove that option and continue: r3c2=3 (Co) r2c3=6 (Ce) ...you may fill in the remaining singles. That wasn’t so hard, was it? This time I didn’t actually memorize anything except the two short trails. I hope I have showed by this that memory isn’t the biggest issue when solving harder puzzles without pencilmarks, but learning to see patterns and short trails. Don’t focus on trails you’ve read about in technique guides, because (a) you won’t see them (they are defined by possible candidates) and ( they are very limited. With pure logic and the ability to read 5 steps ahead you can solve almost any puzzle this way. regards, RW PS. Seems my trails have a lot in common with what you call nice loops. If so, feel free to translate them into the "correct" language that I don't really master yet.
  15. 不久前在对匈牙利名城艾格尔附近的一座古堡进行的考古活动中,考古学家们发掘出一些神秘的羊皮古卷,上面的字迹已经斑驳不清,难以辨识。但其中一部分仍能依稀分辨出由横竖条纹和粗线分隔而成的方格和区域,其中部分方格中还隐约能辨识出一些字迹。 经过哈佛大学著名的罗伯特•兰登教授的研究发现,这些古卷很可能是出自一个神秘的古代宗教派别“帕泽狂热主义”(Puzzle Enthusiasm),该教派的信徒自称为“怕滋乐”(Puzzler),以解决一些玄妙而虚无的问题为乐。该教派至今仍在世界各地有不少分支,其中在遥远的中国有一个自称为“数多酷繁思”(Sudokufans)的支派,兰登教授相信这次发现的古卷与该支派有着某种神秘的联系。 通过对古卷的仔细研究,兰登教授还原了古卷上的部分字迹,并根据还原的文字将其中两张古卷分别命名为:“韦里道酷”(Verydaoku)和“里弗卡多酷”(Leafcardoku)。据兰登教授推断,韦里道酷应该是由verydao7个字母组成,在每行、列和粗线分隔的区域中都恰好包含这7个字母,而残存的字迹中,v可能是y的一部分,c可能是adeo的一部分;而里弗卡多酷则很可能是由LEAFCARD8个字母组成,其中A出现了两次。在每行、列和粗线分隔的区域中都包含这8个字母,残存的字迹中的I可能是DEFLR的一部分,L或F都可能是E的一部分,-可能是AEF的一部分。 但是由于兰登教授本人对于帕泽教派的了解并不多,他本打算求助于他的好友,哈佛大学博士,目前在斯坦福大学进行研究活动的汤姆爵士(Sir Tom),汤姆爵士在帕泽教派有着广泛而崇高的声望,是解决此问题的极佳人选。然而汤姆爵士似乎正卷入了世界帕泽教派信徒的一项狂热的宗教活动中而失去了联系。因此,兰登教授决定向数多酷繁思的信徒们请教,看看他们能否向他提供帮助,把古卷上的内容还原出来。 以下是兰登教授部分还原的两张古卷,请您帮助他完成他的工作吧。 verydaoku: leafcardoku:
  16. 这位“繁思”果然厉害,不但帮兰登教授解决了Leafcardoku,而且还看出来Verydaoku中的问题,看来兰登教授向中国的数多酷繁思请教的主意是非常正确的。我向兰登教授报告了NTC_SDK的结果,教授经过认真研究古卷,又从上面依稀识别出来几个印迹,希望能对verydaoku的解决有所帮助。下面是更新后的verydaoku:
  17. 关于Tapa的命名,我查到的情况如下: Tapa是Turkish Art Paint的缩写。 Tapa是土耳其谜题创作者Serkan Yürekli发明的题型,他说:Tapa is a Turkish word for a device used as a plug. But Tapa puzzle is based on continuity, and its name represent opposite, there is an irony. Tapa puzzle wants to continue, but Tapa device want to stop continuity. 意思是:Tapa在土耳其语中是塞子的意思,但是Tapa谜题恰好相反是基于连通性的。颇具讽刺意味的是,Tapa谜题要求连通,而Tapa这种东西却阻止连通。
  18. 本次比赛的成绩已经出来了。这个题我最终得到了9分,前面有6个更好的答案,其中两个是“玩赖”。下面把高手们的答案分享一下: 玩赖的答案很简单,做一个N*1的盘面,盘面两端各放一个1,其它的数字都不用。由于原题只说了把2组1-7的数字放进去,没说要全放进去,因此这样也能得到一个唯一解,而且盘面可以是无限大。 除此之外,另外的一些答案包括: 这个答案是除玩赖的两个之外的唯一一个13分,但是奇怪的是只是11*11,黑格42格。而且答题者输入的答案有一个坐标是错的,不过显然裁判和我一样帮他改过来了 这个17*16格,黑格48格,角上两个7和两翼的6、3距离之远非常漂亮,不得不佩服。利用墙的长度来限制墙延伸到外面的技巧也运用的非常好,这个应该是本次的最佳答案了。 16*16,46黑格,对称性跟我的答案一样,但是压的更扁,4、5利用的更充分。 这个跟我的答案一样是15*15,但以多出两个黑格胜出。看来我是被角上的1、3组合蒙住了眼睛了,需要反省一下。
  19. 填涂类谜题

    发现了上面的方法后,当然要进行应用。于是比完赛后我回家打开了janko.at(这是一个德语网站,有很多类型的谜题,喜欢谜题的朋友可以经常上去练习),该网站有一道难度最高的扫雷,我之前一直没有做出来。 题目如下: 用逻辑推理可以推导出如下的局势: 这时候我已经无法直观推出下一个雷了,当然利用唯一性(几乎所有的谜题都是只有唯一解的,因此可以利用唯一性来进行推导,数独中也有使用唯一性的技巧,如唯一矩阵、BUG等,但其它谜题中唯一性应用的更广泛)还能推导出几个不是雷的格,但对于整体没有帮助。 下面使用分割计数法进行区域分割: 注意右下部那个较大的框内至少有4个雷,不像之前划分的区域那样简明。 根据划好的区域,很容易推出如下的局势: 这时新的麻烦出来了,右下部的红框内虽然雷数知道了,但仍然很难推出雷的位置。 这时我们需要用到解谜题的利器,也就是上面提到过的“唯一性”。 请看下图: 右下角的2周围,易知2和上面的4之间的两格至少有一个雷,如果只有一个的话,剩余一个雷可以在画了绿圈的6格中的任一格,违反了唯一性,因此,2和4之间的两格都是雷。同理,3下面的蓝色圈标注的3格内如果有1个或2个雷也会违反唯一性,因此必须都是雷或都不是雷,都是雷很容易推出矛盾,因此3格都不是雷。 之后的事情就很简单了,不再赘述。
  20. 谜题赛事

    一些附加信息: 每错一题扣5分; 可以延期10分钟,每延期一分钟扣6分。 跟上次的摩天楼不太一样,有兴趣参加的要注意一下
  21. 逻辑谜题

    既然TTHsieh兄如此说,只好做一遍了,否则倒显得小气了。不过除了增加轻、重几个字外,实在跟上面的差不多,累赘的紧。 此外,鉴于问题一条件较宽泛,可改为:有 13 枚钱币,其中有一伪币重量与真币不同,请用天平称三次找出此伪币。这样我之前的答案就能用上了,不至于白敲那么多字。 input {v1, v2, ...., v12}if v1+v2+v3+v4 = v5+v6+v7+v8 then if v9+v10 = v11+v1 then if v12 > v1 then print "第12个币是伪币,较重" else print "第12个币是伪币,较轻" end if elseif v9+v10 > v11+v1 then if v9 = v10 then print "第11个币是伪币,较轻" elseif v9 < v10 then print "第10个币是伪币,较重" else print "第9个币是伪币,较重" end if else if v9 = v10 then print "第11个币是伪币,较重" elseif v9 > v10 then print "第10个币是伪币,较轻" else print "第9个币是伪币,较轻" end if end ifelseif v1+v2+v3+v4 > v5+v6+v7+v8 then if v1+v2+v5+v6 = v3+v7+v9+v10 then if v4=v1 then print "第8个币是伪币,较轻" else print "第4个币是伪币,较重" end if elseif v1+v2+v5+v6 > v3+v7+v9+v10 then if v1=v2 then print "第7个币是伪币,较轻" elseif v1>v2 then print "第1个币是伪币,较重" else print "第2个币是伪币,较重" end if else if v5=v6 then print "第3个币是伪币,较重" elseif v5>v6 then print "第6个币是伪币,较轻" else print "第5个币是伪币,较轻" end if end ifelse if v1+v2+v5+v6 = v3+v7+v9+v10 then if v4=v1 then print "第8个币是伪币,较重" else print "第4个币是伪币,较轻" end if elseif v1+v2+v5+v6 < v3+v7+v9+v10 then if v1=v2 then print "第7个币是伪币,较重" elseif v1<v2 then print "第1个币是伪币,较轻" else print "第2个币是伪币,较轻" end if else if v5=v6 then print "第3个币是伪币,较轻" elseif v5<v6 then print "第6个币是伪币,较重" else print "第5个币是伪币,较重" end if end ifend if
  22. 逻辑谜题

    不好意思,没看到要判断轻重,这样的话,只能12个币了。方法大致相同,就不赘述了
  23. 逻辑谜题

    这两个问题都可以改成13个币。 试解答第2题: input {v1, v2, ...., v13}if v1+v2+v3+v4 = v5+v6+v7+v8 then if v9+v10 = v11+v1 then if v12 = v1 then print "第13个币是伪币" else print "第12个币是伪币" end if elseif v9+v10 > v11+v1 then if v9 = v10 then print "第11个币是伪币" elseif v9 < v10 then print "第10个币是伪币" else print "第9个币是伪币" end if else if v9 = v10 then print "第11个币是伪币" elseif v9 > v10 then print "第10个币是伪币" else print "第9个币是伪币" end if end ifelseif v1+v2+v3+v4 > v5+v6+v7+v8 then if v1+v2+v5+v6 = v3+v7+v9+v10 then if v4=v1 then print "第8个币是伪币" else print "第4个币是伪币" end if elseif v1+v2+v5+v6 > v3+v7+v9+v10 then if v1=v2 then print "第7个币是伪币" elseif v1>v2 then print "第1个币是伪币" else print "第2个币是伪币" end if else if v5=v6 then print "第3个币是伪币" elseif v5>v6 then print "第6个币是伪币" else print "第5个币是伪币" end if end ifelse if v1+v2+v5+v6 = v3+v7+v9+v10 then if v4=v1 then print "第8个币是伪币" else print "第4个币是伪币" end if elseif v1+v2+v5+v6 < v3+v7+v9+v10 then if v1=v2 then print "第7个币是伪币" elseif v1<v2 then print "第1个币是伪币" else print "第2个币是伪币" end if else if v5=v6 then print "第3个币是伪币" elseif v5<v6 then print "第6个币是伪币" else print "第5个币是伪币" end if end ifend if [编辑注记]显示缩排 TTHsieh