
STL
我的指针和我一样已找到对象
退役的ACMer。现在:智能媒体计算、大数据
展开
-
Internet of Lights and Switches 湖南2015省赛I题 (异或+map)
题意:有N盏灯和M个开关,每一个开关控制多盏灯(比如N=4,"1010"就代表这个开关控制第1和第3盏灯),初始所有的灯都是开着的。问你有多少种按开关的方法使得所有的灯都熄灭?(只能选择一段连续的开关区间,区间长度在[a,b]范围内。)思路:先知道前缀异或和sum,这个sum[i]保存开关[1~i]的异或和,那个开关区间[l,R]能产生的作用就是sum[R]^sum[L].用map保存原创 2015-09-02 13:23:41 · 1241 阅读 · 1 评论 -
HDU 5289 - Assignment(multiset + 尺取法)
题意:给出一个序列,求序列中有多少个子序列(子序列要求任意两个数差值小于k)分析:从左到右把数字加入multiset。multiset存储子序列,新数字与multiset里面的最大值和最小值比较,差值小于k则可以加入,否则,按顺序出multiset直到新数字可以加入每次新加入数字时ans+=multiset.size()http://acm.hdu.edu.cn/sho原创 2015-07-28 21:40:47 · 452 阅读 · 0 评论 -
uva11572 唯一的雪花 做法:滑动窗口 set 或 map
找到一个最长的子序列,里面的元素都不相同原创 2015-03-15 20:57:16 · 716 阅读 · 0 评论 -
Matrix Chain Multiplication UVA442 矩阵连乘 stack
题目链接http://www.bnuoj.com/v3/problem_show.php?pid=17581Matrix Chain Multiplication Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are ma原创 2015-02-16 17:37:12 · 449 阅读 · 0 评论 -
Rails VUA 514 栈的运用,车站调度,
题目链接 Rails There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extr原创 2015-02-16 12:30:55 · 591 阅读 · 0 评论 -
Ugly Numbers UVA 136 priority_queue+set
题目链接 Ugly Numbers Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...shows the fi原创 2015-02-16 11:01:59 · 520 阅读 · 0 评论 -
Team Queue UVA 540 queue+map LRJ做法
点击打开链接#include#include#include#includeusing namespace std;const int maxt = 1000+10;int main(){int t,cas=1;while(scanf("%d",&t)&&t!=0){ printf("Scenario #%d\n",cas++);原创 2015-02-15 11:18:16 · 440 阅读 · 0 评论 -
The SetStack Computer UVA12096 STL set map LRJ做法
点击打开链接#include#include#include#include#include#include#include#define ALL(x) x.begin(),x.end()#define INS(x) inserter(x,x.begin())using namespace std;typedef setSet;mapIDcache;vector原创 2015-02-15 10:08:55 · 497 阅读 · 0 评论 -
Ananagrams (uva 156,bnu 17295) map用法,单词标准化
点击打开题目链接AnanagramsTime Limit: 3000msMemory Limit: 131072KBThis problem will be judged on UVA. Original ID: 15664-bit integer IO format: %lld Java class name: MainP原创 2015-02-06 17:43:38 · 495 阅读 · 0 评论 -
Andy's First Dictionary(uva 10815) set用法
Andy's First DictionaryTime Limit: 3000msMemory Limit: 131072KBThis problem will be judged on UVA. Original ID: 1081564-bit integer IO format: %lld Java class name: MainPrev原创 2015-02-03 13:46:34 · 1775 阅读 · 0 评论