STL
sprite_
这个作者很懒,什么都没留下…
展开
-
codeforces 244B Undoubtedly Lucky Numbers(set)
题目链接: http://codeforces.com/problemset/problem/244/B 题目大意: 有两个个位数x,y,可以组合成许多新的数,那么这些数的不同的位数最多为2,求出这些数小于等于n的个数。 思路: 因为要求组合出的数,所以可以通过对x,y进行枚举,得到小于n的数,放入set里面,最后set里面的数的数量就是答案。 代码: #include #inc原创 2015-09-15 21:09:03 · 772 阅读 · 0 评论 -
UVA Live 7146 Defeat the Enemy(贪心+set)
Long long ago there is a strong tribe living on the earth. They always have wars and eonquer others.One day, there is another tribe become their target. The strong tribe has decide to terminate them!!原创 2015-10-05 21:23:57 · 500 阅读 · 0 评论 -
codeforces 577B Modulo Sum(DP||set)
题目链接: http://codeforces.com/problemset/problem/577/B 题目大意: 给n个数,问他们之中的某些和能不能被m整除。 思路: 当n>m时,根据鸽巢原理,可以判断一定为YES。因为对于这些数,取模以后的范围为(0,m-1),那么当到第m+1个时候,至少这个取模后的数与前面中的一个有重复,此时肯定有两个相加能被m整除。 当n 代码: #原创 2015-09-21 20:01:11 · 436 阅读 · 0 评论 -
Codeforces Gym 100792K King's Rout(优先队列+拓扑排序)
K. King's Rout time limit per test 4 seconds memory limit per test 512 megabytes input standard input output standard output The great rout will be held this evening in原创 2015-10-28 21:02:09 · 1244 阅读 · 0 评论 -
hdu5437 Alisha’s Party(优先队列、模拟)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5437 题目大意:Alisha有k个朋友来他家,每个朋友来是有先后次序的,Alisha会开m次门,每次都是在第t个朋友到了以后,他会邀请p个朋友进家门,原则是邀请所带礼物价值高的朋友先进门,如果两个朋友的礼物价值相同,就叫先到的进门。最后等所有朋友都到了以后,Alisha会把他所有的朋友都叫进原创 2015-09-13 20:21:28 · 728 阅读 · 0 评论 -
hdu 1022 Train Problem I(栈的模拟)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1022 题目大意: 给定入栈顺序,问能否按照某个方式出栈。 思路: 直接模拟即可。 代码: #include #include #include #include #include #include using namespace std; char s1[15],s2[15]; i原创 2015-11-16 22:30:16 · 444 阅读 · 0 评论