摘要:
传送门 贪心---->后悔大法好。。具体来说,能卖就卖,卖不了,就去前面找,如果买得最多的比这个多,就把他的抢回来,卖给现在这个人。。好无厘头,但就是这种贪心方法。。。#include#include#include#include#include#include#define... 阅读全文
摘要:
传送门 神奇的bitset() 我太弱才学会bitset 。用来制造一个超大的二进制数存东西,对于这道题就是用来存那个数能被求出。bitset还用来加速求的过程,bitset|=bitset#include#include#include#include#include#defin... 阅读全文
摘要:
传送门:http://cogs.pro/cogs/problem/problem.php?pid=2089 第一眼看就是“银河英雄传说”,其实只是类似,异或和有神奇的地方。 首先,find时,只有fx!=find(fx)时,才更改sum[x],因为维护的是前缀和(感... 阅读全文
摘要:
传送门:http://cogs.pro/cogs/problem/problem.php?pid=2558 教室数很小,路又很多,考虑用floyd.(开始把k打里面了,颜面扫地。。) 因为只能提交m个,所以数组就是三维,f[i][j][0/1].i表示第几节课,j表示到i时选... 阅读全文
摘要:
问题 B: [Usaco2007 Open]Fliptile 翻格子游戏时间限制: 5 Sec 内存限制: 128 MB题目描述Farmer John knows that an intellectually satisfied cow is a happy cow who will give ... 阅读全文