<p>Political parties in Bangladesh show their muscle by calling for regular hartals (strikes), which cause considerable economic damage. For our purposes, each party may be characterized by a positive integer h called the hartal parameter that denotes th…

2020年1月17日 0条评论 1755点热度 0人点赞 code 阅读全文

<p>A poker deck contains 52 cards. Each card has a suit of either clubs, diamonds, hearts, or spades (denoted C, D, H, S in the input data). Each card also has a value of either 2 through 10, jack, queen, king, or ace (denoted 2, 3, 4, 5, 6, 7, 8, 9, T, …

2020年1月17日 0条评论 986点热度 0人点赞 code 阅读全文

<p>Australian ballots require that voters rank all the candidates in order of choice. Initially only the first choices are counted, and if one candidate receives more than 50% of the vote then that candidate is elected. However, if no candidate receives …

2020年1月17日 0条评论 1099点热度 0人点赞 code 阅读全文

A sequence of n > 0 integers is called a jolly jumper if the absolute values of the differences between successive elements take on all possible values 1 through n - 1. For instance, 1 4 2 3 is a jolly jumper, because the absolute differences are 3, 2, and …

2020年1月17日 0条评论 1236点热度 0人点赞 code 阅读全文

Graphical editors such as Photoshop allow us to alter bit-mapped images in the same way that text editors allow us to modify documents. Images are represented as an M x N array of pixels, where each pixel has a given color. Your task is to write a program whic…

2020年1月17日 0条评论 1575点热度 0人点赞 code 阅读全文

A certain computer has ten registers and 1,000 words of RAM. Each register or RAM location holds a three-digit integer between 0 and 999. Instructions are encoded as three-digit integers and stored in RAM. The encodings are as follows: <P align=justify> …

2020年1月17日 0条评论 936点热度 0人点赞 code 阅读全文