随笔分类 - ACM-PC
摘要:Little Bishops A bishop is a piece used in the game of chess which can only move diagonally from its current position. Two bishops attack each other if one is on the path of the other. In the figure below, the dark squares represent the reachable locations for bishop B1 from its current position. Bi
阅读全文
摘要:The Tourist Guide Mr. G. works as a tourist guide in Bangladesh. His current assignment is to show a group of tourists a distant city. As in all countries, certain pairs of cities are connected by two-way roads. Each pair of neighboring cities has a bus service that runs only between those two citie
阅读全文
摘要:Playing with Wheels Consider the following mathematical machine. Digits ranging from 0 to 9 are printed consecutively (clockwise) on the periphery of each wheel. The topmost digits of the wheels form a four-digit integer. For example, in the following figure the wheels form the integer 8,056. Each w
阅读全文
摘要:Bicoloring The four-color theoremstates that every planar map can be colored using only four colors in such a way that no region is colored using the same color as a neighbor. After being open for over 100 years, the theorem was proven in 1976 with the assistance of a computer.Here you are asked to
阅读全文
摘要:110104 LC-DisplayA friend of yours has just bought a new computer. Before this, the most powerful machine he ever used was a pocket calculator. He is a little disappointed because he liked the LCD display of his calculator more than the screen on his new computer! To make him happy, write a program
阅读全文
摘要:The 3n+1 problemConsider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process with the new value of n, terminating when n = 1. For example, the following sequence of numbers will be ge
阅读全文
摘要:The TripA group of students are members of a club that travels annually to different locations. Their destinations in the past have included Indianapolis, Phoenix, Nashville, Philadelphia, San Jose, and Atlanta. This spring they are planning a trip to Eindhoven.The group agrees in advance to share e
阅读全文
摘要:这个题我都快吐血了!!!老是格式错误(Presentation Error)最后终于知道了原来是输出案例时要空一行最后一个不要换行;由于是任意案例以0 0结束,故0 0的上一行不能有换行。AC的好纠结呀!!!!题意:给你n*m的矩阵,‘ * ’代表雷,‘ . ’代表空白处;输出空白去有多少雷;MinesweeperHave you ever played Minesweeper? This cute little game comes with a certain operating system whose name we can't remember. The goal of th
阅读全文