11 2012 档案
摘要:C++ Priority Queue(优先队列)C++优先队列类似队列,但是在这个数据结构中的元素按照一定的断言排列有序。它的头文件为。由于适配器不支持迭代,一个 priority_queue 将有没有关联的迭代器。函数列表:empty() 如果优先队列为空,则返回真 pop() 删除第一个元素 push() 加入一个元素 size() 返回优先队列中拥有的元素的个数 top() 返回优先队列中有最高优先级的元素 /////////////////////////////////////////////////////////////////////////////////////构造函数ex
阅读全文
摘要:声明为pair类型的变量可以有三种赋值方法:1. 通过初始化赋值 直接声明的时候 后面加括号并且数据,如下a2. 通过.first .second 来赋值 如下b3. 通过 = make_pair() 来赋值, 如下c a. pair product1 ("tomatoes",3.25); pair product2; pair product3; b. product2.first = "lightbulbs"; // type of first is string product2.second = 0.99; // type of second i
阅读全文
摘要:H. Queries for Number of Palindromestime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got a string s = s1s2...s|s| of length|s|, consisting of lowercase English letters. There also areq queries, each query is described by two integersli,
阅读全文
摘要:Big NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17227 Accepted Submission(s): 7705Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data
阅读全文
摘要:Starship TroopersTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6276 Accepted Submission(s): 1692Problem DescriptionYou, the leader of Starship Troopers, are sent to destroy a base of the bugs. The base is built underground. It is actually a hug
阅读全文
摘要:Quoit DesignTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17773 Accepted Submission(s): 4563Problem DescriptionHave you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled
阅读全文
摘要:Shopping OffersIOI'95 In a certain shop, each kind of product has an integer price. For example, the price of a flower is 2 zorkmids (z) and the price of a vase is 5z. In order to attract more customers, the shop introduces some special offers.A special offer consists of one or more product item
阅读全文
摘要:NTATime Limit: 2 Seconds Memory Limit: 65536 KB The NTA (Non-deterministic Tree Automata) is a kind of tree structure device. The device is built in a set of operating rules. With these rules the device can produce several signals, which will form a signal system. In such a system, one signal is the
阅读全文
摘要:Riding the FencesFarmer John owns a large number of fences that must be repaired annually. He traverses the fences by riding a horse along each and every one of them (and nowhere else) and fixing the broken parts.Farmer John is as lazy as the next farmer and hates to ride the same fence twice. Your
阅读全文
摘要:Safe Or UnsafeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 863 Accepted Submission(s): 309Problem DescriptionJavac++ 一天在看计算机的书籍的时候,看到了一个有趣的东西!每一串字符都可以被编码成一些数字来储存信息,但是不同的编码方式得到的储存空间是不一样的!并且当储存空间大于一定的值的时候是不安全的!所以Javac++ 就想是否有一种方式是可以得到字符编码最小的空间值!显
阅读全文
摘要:Sweet ButterGreg Galperin -- 2001Farmer John has discovered the secret to making the sweetest butter in all of Wisconsin: sugar. By placing a sugar cube out in the pastures, he knows the N (1 #include
#include
#include
using namespace std;
ifstream cin("butter.in");
ofstream cout("but
阅读全文
摘要:Magic SquaresIOI'96 Following the success of the magic cube, Mr. Rubik invented its planar version, called magic squares. This is a sheet composed of 8 equal-sized squares:12348765In this task we consider the version where each square has a different color. Colors are denoted by the first 8 posi
阅读全文
摘要:Feed Ratios1998 ACM Finals, Dan Adkins Farmer John feeds his cows only the finest mixture of cow food, which has three components: Barley, Oats, and Wheat. While he knows the precise mixture of these easily mixable grains, he can not buy that mixture! He buys three other mixtures of the three grains
阅读全文
摘要:Spinning Wheels1998 ACM NE Regionals Each of five opaque spinning wheels has one or more wedges cut out of its edges. These wedges must be aligned quickly and correctly. Each wheel also has an alignment mark (at 0 degrees) so that the wheels can all be started in a known position. Wheels rotate in t
阅读全文

浙公网安备 33010602011771号