//题意:把n*n分成n个形状不一样的图形,用G.Y,B,R给这些矩形上色(如果相邻俩个图形颜色一样,就和并在一起了,不成立),存在输出n*n的矩形(用G,Y,B,R表示),不存在输出No solution!;
//思路:2,3,4不成立,6要自己构造,其它基本都是一个思路,大致上图片的意思,具体思路大家输出来看看,我也不知道该怎么描述;
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream...
阅读全文
Cash Machine
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 22011
Accepted: 7723
Description
A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominations, say Dk, k=1,N, and for each denomination Dk the machine has a supply
of nk bills. F...
阅读全文
Divisibility
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 9199
Accepted: 3197
Description
Consider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expressions that evaluate to different values. Let us, for example, take the sequence: 17, 5, -21, 15. There are
eight possible e...
阅读全文
Balance
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 8227
Accepted: 5000
Description
Gigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.
It orders two arms of negligible weight and each arm's length is 15. Some hooks are attached to these arms and Gigel wants to hang up some weights from his c...
阅读全文
Tian Ji -- The Horse Racing
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 9328
Accepted: 2866
Description
Here is a famous story in Chinese history.
That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.
Both of Tian and the king have three horses in different classes, namely, ...
阅读全文
Mayor's posters
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 33753
Accepted: 9788
Description
The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally decided to build an electoral wall for placing the posters
and introduce...
阅读全文
Candies
Time Limit: 1500MS
Memory Limit: 131072K
Total Submissions: 20467
Accepted: 5421
Description
During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the kids loved candies very much and often compared the numbers
of candies they ...
阅读全文
Is the Information Reliable?
Time Limit: 3000MS
Memory Limit: 131072K
Total Submissions: 9890
Accepted: 3067
Description
The galaxy war between the Empire Draco and the Commonwealth of Zibu broke out 3 years ago. Draco established a line of defense called Grot. Grot is a straight line with N defense stations. Because of the cooperation of the stations, Zibu’s Marine
Glory can...
阅读全文
King
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 8777
Accepted: 3305
Description
Once, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed: ``If my child was a son and if only he was a sound king.'' After nine months her child was born, and indeed, she gave birth to a nice son.
Unfortunately, as it used to happen in royal fami...
阅读全文
Dining
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 7589
Accepted: 3472
Description
Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others.
Farmer John has cooked fabulous meals for his cows, but he forgot to check his menu against their preferences. Although he might not be able to stuff everybody, he ...
阅读全文