随笔分类 - DFS 学习笔记
摘要:Problem DescriptionGiven two positive integersnandk, you are asked to generate a new integer, saym, by changing some (maybe none) digits ofn, such that the following properties holds:mcontains no leading zeros and has the same length asn(We considerzeroitself a one-digit integer without leading zero
阅读全文
摘要:题意:把奶牛分成3组,只要有两组大于1/2量,用深搜剪枝 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxn=220; 7 struct node 8 { 9 int key,id;10 bool operator xx.key;13 }14 }data[maxn];15 16 bool cmp(const node &p,const node &q)17 {18 return p.keyn*500&&sum[n+n]-ans>n*500).
阅读全文
摘要:Problem DescriptionWhen a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a strong signal. However, the channels used by each repeater must be carefully chosen so that nearby repeaters do not interfere with one another. Thi
阅读全文
摘要:DescriptionThe 2012 Europe Cup was over and Spain won the Championship. The fans of Spain want to hold some activities to celebrate. But there is a question. Some of them are the fans of F.C Barcelona and the others are Real Madrid. It is well-known that the relation of these two clubs is very bad.
阅读全文
摘要:DescriptionThe European Cup final is coming. The past two World Cup winners, Spain and Italy, will contest the decider at Kiev's Olympic Stadium. Italy-Spain Euro final promises to be *** of polar opposites, so it's difficult to say which team will win.Now there areMfans in ZJU,Nof them su
阅读全文
摘要:DescriptionMichael takes theDiscrete Mathematicscourse in this semester. Now it's close to the final exam, and he wants to take a complete review of this course.The whole book he needs to review hasNchapter, because of the knowledge system of the course is kinds of discrete as its name, and due
阅读全文
摘要:DescriptionThere is a fire in LTR ’ s home again. The fire can destroy all the things intseconds, so LTR has to escape intseconds. But there are some jewels in LTR ’ s rooms, LTR love jewels very much so he wants to take his jewels as many as possible before he goes to the exit. Assume that theith r
阅读全文
摘要:Problem DescriptionThe Leiden University Library has millions of books. When a student wants to borrow a certain book, he usually submits an online loan form. If the book is available, then the next day the student can go and get it at the loan counter. This is the modern way of borrowing books at t
阅读全文
摘要:Problem DescriptionContinuous Same Game is a simple game played on a grid of colored blocks. Groups of two or more connected (orthogonally, not diagonally) blocks that are the same color may be removed from the board. When a group of blocks is removed, the blocks above those removed ones fall down i
阅读全文
摘要:Problem Description一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m=1.m=0退出.Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,每行1条路线.每行首先输出是第几条路线.然后个一个: 后列出经过的城市.参看Sample outputSample Input2 5 201 3 122 4 103 5 81 4 65 7 196 8 174 7 98 10 16
阅读全文
摘要:Problem DescriptionXCOM-Enemy Unknown是一款很好玩很经典的策略游戏.在游戏中,由于未知的敌人--外星人入侵,你团结了世界各大国家进行抵抗.随着游戏进展,会有很多的外星人进攻事件.每次进攻外星人会选择3个国家攻击,作为联盟的指挥者,你要安排有限的联盟军去支援其中一个国家,抵抗进攻这个国家的外星人.战斗胜利之后这个被支援的国家恐慌值就会-2点(恐慌值最少减为1),而其他两个未被支援的国家恐慌值就会+2点,同时和这两个国家在相同大洲的其他国家恐慌值也会+1点.当一个国家的恐慌值超过5点,这个国家就会对联盟失去信心从而退出联盟.现在给你外星人将会进攻的地点,问你最多
阅读全文
摘要:Problem DescriptionYou have just been put in charge of developing a new shredder for the Shredding Company Although a "normal" shredder would just shred sheets of paper into little pieces so that the contents would become unreadable, this new shredder needs to have the following unusual ba
阅读全文
摘要:Problem DescriptionSudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The other cells are empty. The goal is to fill the empty cells with decimal digits from 1
阅读全文
摘要:Problem DescriptionThe cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies, chainsaw-wielding psychopaths, hippies, and other terrors on their quest to find the exit.One popular maze-walking strategy guarantees that the visitor
阅读全文
摘要:Problem DescriptionIt's almost summer time, and that means that it's almost summer construction time! This year, the good people who are in charge of the roads on the tropical island paradise of Remote Island would like to repair and upgrade the various roads that lead between the various to
阅读全文
摘要:Problem DescriptionA university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetworks in order to minimize traffic between parts.A disgruntled computer science student Vasya, after being exp
阅读全文
摘要:Problem DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a pointN(0 ≤N≤ 100,000) on a number line and the cow is at a pointK(0 ≤K≤ 100,000) on the same number line. Farmer John has two modes of transportation: walking and tel
阅读全文
摘要:Problem Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 char map[1001][1001]; 8 int vis[1001.
阅读全文
摘要:Problem DescriptionBackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journeyaround the world. Whenever a knight moves, it is two squares in one direction and one square perpendicular to this. The world of a knight is the chessb
阅读全文
摘要:Problem DescriptionIt is year 2500 A.D. and there is a terrible war between the forces of the Earth and the Mars. Recently, the commanders of the Earth are informed by their spies that the invaders of Mars want to land some paratroopers in them×ngrid yard of one their main weapon factories in o
阅读全文

浙公网安备 33010602011771号