题意:n道题,每道题需要一个模板,现在手头有m个模板(标号1~m),解题的时候,如果没有需要的模板,可以向朋友借,但是用完之后必须在还给朋友一个模板(也就是说保持手头拥有m个模板),求解完n道题最少需要向朋友请求多少次帮助. 思路:贪心,每次抛弃模板的时候抛弃下次使用最靠后的那一个.(怎么想到的..怎么证明.) #include<iostream> #include<stdio.h> #include<map> #include<set> using nam…
中等偏易题.操作系统理论中的最优页面调度算法,贪心.当需要淘汰某个模版时,淘汰掉当前手中在最远的将来才会被用到(或者以后永远不再用到)的那个. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <algorithm> #include <string> #incl…
B - Alice and Bob Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Description Alice and Bob's game never ends. Today, they introduce a new game. In this game, both of them have N different rectangular cards respectively.…
题意描述半天描述不好,直接粘贴了 Now your team is participating a programming contest whose rules are slightly different from ICPC. This contest consists of N problems, and you must solved them in order: Before you solve the (i+1)th problem, you must solve the ith p…
How many people give up, because of YOU. Continue... 先实践,最后需要总结. 1. 数据流中的数据按照一定的格式<T>提取 -------> 放在vector中. 2. 注意 vector.begin(), vector.front()的区别. 3. accumulate()求sum.(与valarrary貌似有一拼,孰优孰劣?---- 可能后者效率更高) 4. multiplies<int>()   c++ -->…
目录 . C++标准模版库(Standard Template Library STL) . C++ STL容器 . C++ STL 顺序性容器 . C++ STL 关联式容器 . C++ STL 容器适配器 . C++ STL算法 . C++ STL边界限制 1. C++标准模版库(STL) STL就是Standard Template Library,标准模板库.从根本上说 . STL是一些"容器"集合 . STL也是算法和其他一些组件的集合 . 这里的"容器"…
Problem Description After AC all the hardest problems in the world , the ACboy 8006 now has nothing to do . One day he goes to an old library to find a part-time job .It is also a big library which has N books and M users.The user's id is from 1 to M…
http://calibre-ebook.com/ Library Management E-book conversion Syncing to e-book reader devices Downloading news from the web and converting it into e-book form Comprehensive e-book viewer Content server for online access to your book collection E-bo…
hdu 4825 Xor Sum(trie+贪心) 刚刚补了前天的CF的D题再做这题感觉轻松了许多.简直一个模子啊...跑树上异或x最大值.贪心地让某位的值与x对应位的值不同即可. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #define CLR(a,b) memset((a),(b),sizeof(…
django升级2.1python升级3.7时出现如下的错误: "trying to load '%s': %s" % (entry[1], e) django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'crispy_forms.templatetags.crispy_forms_utils':…