poj Candies】的更多相关文章

http://poj.org/problem?id=3159 #include<cstdio> #include<queue> #include<cstring> #include<algorithm> #include<cmath> #define max1 30005 #define max2 150005 using namespace std; int head[max1],next[max2]; int dis[max1]; bool…
Candies Time Limit: 1500MS   Memory Limit: 131072K Total Submissions: 20067   Accepted: 5293 Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large b…
题目链接:http://poj.org/problem?id=3159 Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the k…
POJ 3159 Candies (图论,差分约束系统,最短路) Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse's class a large bag of candies and had flymouse distribute them. All the kids…
题目传送门 #include <cstdio> #include <cstring> #define lson l, m, rt << 1 #define rson m+1, r, rt << 1 | 1 + ; ]; struct node { ]; int val; }boy[MAX_N<<]; int ans[MAX_N]; int id; int n, k; void build(int l, int r, int rt) { sum[r…
http://poj.org/problem?id=3159 Time Limit: 1500MS   Memory Limit: 131072K Total Submissions: 33328   Accepted: 9349 Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of fly…
Language:Default Candies Time Limit: 1500MS   Memory Limit: 131072K Total Submissions: 43021   Accepted: 12075 Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse…
Candies Time Limit: 1500MS   Memory Limit: 131072K Total Submissions: 22177   Accepted: 5936 Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse's class a large b…
POJ 2886 题目大意是说有n个人围成一圈,游戏的起点是k,每个人持有一个数字(非编号)num,每次当前的人退出圈,下一个人是他左边的第num个(也就是说下一个退出的是k+num, k可以为负数,表示右边的第num个),这里的num的范围是1e9, 现在一直如果一个人是第i个推出的,那么他的得分就是i的约束的个数,球得分最高的那个人的编号 这里有两个地方稍微不好处理: 1: num  < 1e9 这里只需要模拟一下就可以了,如果当前在k,往右走num,还剩下rest个人,那么下一步应该往右走…
题目链接:http://poj.org/problem?id=3159 题意:给出m给 x 与y的关系.当中y的糖数不能比x的多c个.即y-x <= c  最后求fly[n]最多能比so[1] 多多少糖? 差分约束问题, 就是求1-n的最短路,  队列实现spfa 会超时了,改为栈实现,就可以 有负环时,用栈比队列快 数组开小了,不报RE,报超时 ,我晕 #include <iostream> #include <cstdlib> #include <cstdio>…