考察优先队列,以及对队列的一系列操作
#include
#include
#define maxn 10000+10
using namespace std;
struct stu
{
string name;
int rp;
friend bool operator<(stu x,stu y)
{
if(x.rp==y.rp) return x.name<y.name;
ret...
分类:
其他好文 时间:
2015-04-21 16:09:20
阅读次数:
154
10246 Asterix and Obelix
After winning a gruesome battle against the Romans in a faraway land, Asterix and his dearest friend Obelix are now returning home. However Obelix is not with Asterix now. He...
分类:
其他好文 时间:
2015-04-20 09:36:18
阅读次数:
178
Ikki's Story IV - Panda's TrickTime Limit:1000MSMemory Limit:131072KTotal Submissions:8437Accepted:3101Descriptionliympanda, one of Ikki’s friend, lik...
分类:
其他好文 时间:
2015-04-19 19:18:04
阅读次数:
152
题意:找出比n大的 最小的数,要求每个位上的数字 乘积 与n每个位上的数字 乘积要相等。
参考了别人的题解
做法:如果有0 ,特殊处理。分为末尾只有一个0,不是这种情况。
1、如果只有个位一个0,就从十位上往高位找,找不是9的,找到加1,结束。找的过程遇到9,都改为0。如果都是9,就在数字最左边加一个1。
2、如果有0,且不是上诉情况,那就直接从个位往高位走,遇到9,变0,遇到非9 ,加1,结束。
3、如果没有0的话,把从个位开始,素数分解,并记录所有的素数。分解完一位,就判断下分解出来的素数能不能组...
分类:
其他好文 时间:
2015-04-19 11:36:23
阅读次数:
134
ZOJ 3327 Friend Number(数学啊 )...
分类:
其他好文 时间:
2015-04-18 23:51:14
阅读次数:
278
Once again Tavas started eating coffee mix without water! Keione told him that it smells awful, but he didn't stop doing that. That's why Keione told his smart friend, SaDDas to punish him! SaDDas too...
分类:
其他好文 时间:
2015-04-16 23:45:21
阅读次数:
3739
【每日一歌】今天给大家推荐的Lenka的一首经典老歌-《Trouble is a friend》。曲名虽和trouble 有关,我听到的却是欢快。 个人认为好音乐总是有好序曲,过门蹑手蹑脚的就出来了,原来trouble 也很心虚。而好声线也总充满磁性,自身带有回响。多听几遍后,恍然大悟,不是trouble蹑手蹑脚,而是我们躲躲藏藏想甩掉它。似有趣的迷藏,美好的游戏时光。 不想多说了,一起摇头晃脑的...
分类:
其他好文 时间:
2015-04-16 22:01:15
阅读次数:
219
阅读程序:
#include
using namespace std;
class Time
{
public:
Time(int h,int m,int s):hour(h),minute(m),sec(s) {}
void display1(); //display1是成员函数
friend void display2(Time &); //d...
分类:
其他好文 时间:
2015-04-15 19:45:45
阅读次数:
164
STL智能指针使用方法auto_ptr pi(new int(1024));定义智能指针类(使用计数)实现代码:class RealPtr {
friend class AutoPtr;
int *ip;
size_t use;
RealPtr(int *p) : ip(p), use(1) {}
~RealPtr() { delete ip; }...
分类:
其他好文 时间:
2015-04-13 09:41:23
阅读次数:
194
Problem
It's opening night at the opera, and your friend is the prima donna (the lead female singer). You will not be in the audience, but you want to make sure she receives a standing ovation -- w...
分类:
其他好文 时间:
2015-04-12 14:48:24
阅读次数:
200