上一页 1 ··· 5 6 7 8 9 10 11 下一页
摘要: #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long const int N=500005; int a[N],b[N],c[N],d[N],n,m=0; void ... 阅读全文
posted @ 2019-08-20 17:46 hh13579 阅读(121) 评论(0) 推荐(0)
摘要: 题目描述 温迪有一个国家,他想建立一支军队来保护他的国家。他收留了N个女孩和M个男孩,想把她们收留成他的士兵。征兵无特权,必须交纳一万元。女孩和男孩之间有一些关系,温迪可以利用这些关系来降低他的成本。如果X女孩和Y男孩有D关系,并且其中一个已经被收集,Windy可以用10000-D人民币收集另一个。 阅读全文
posted @ 2019-08-16 16:12 hh13579 阅读(409) 评论(0) 推荐(0)
摘要: Bessie搬到了一个新的农场,有时候他会回去看他的老朋友。但是他不想很快的回去,他喜欢欣赏沿途的风景,所以他会选择次短路,因为她知道一定有一条次短路。这个乡村有R(1<=R<=100000)条双向道路,每一条连接N(1<=N<=5000)个点中的两个。Bessie在1号节点,他的朋友家是n号节点I 阅读全文
posted @ 2019-08-16 14:43 hh13579 阅读(162) 评论(0) 推荐(0)
摘要: 恰逢 H 国国庆,国王邀请 n 位大臣来玩一个有奖游戏。 首先,他让每个大臣在左、右手上面分别写下一个整数,国王自己也在左、右手上各写一个整数。 然后,让这 n 位大臣排成一排,国王站在队伍的最前面。 排好队后,所有的大臣都会获得国王奖赏的若干金币,每位大臣获得的金币数分别是: 排在该大臣前面的所有 阅读全文
posted @ 2019-08-02 15:48 hh13579 阅读(592) 评论(0) 推荐(0)
摘要: http://www.51nod.com/Challenge/Problem.html#problemId=1212 代码 阅读全文
posted @ 2019-07-26 11:00 hh13579 阅读(152) 评论(0) 推荐(0)
摘要: 题目链接 https://codeforces.com/problemset/problem/1144/F 代码 阅读全文
posted @ 2019-07-23 23:17 hh13579 阅读(176) 评论(0) 推荐(0)
摘要: 链接 https://www.luogu.org/problemnew/show/P1551 代码 阅读全文
posted @ 2019-07-23 17:30 hh13579 阅读(288) 评论(0) 推荐(0)
摘要: 题目描述 Description Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the mo 阅读全文
posted @ 2019-07-23 16:32 hh13579 阅读(171) 评论(0) 推荐(0)
摘要: 题目链接:https://vjudge.net/problem/UVA-1152 这题题意就是在四个集合内。每个集合分别里挑一个数a,b,c,d,求a+b+c+d=0有多少种选法。 暴力的话就是四重循环,复杂度O(n^4)容易超时。稍微优化一点就是分别枚举其中三个集合里的元素a+b+c,然后用二分查 阅读全文
posted @ 2019-07-15 23:15 hh13579 阅读(144) 评论(0) 推荐(0)
摘要: 题目链接 https://vjudge.net/problem/UVA-1600 典型的bfs模拟题,但我实在是菜。 代码如下: 阅读全文
posted @ 2019-07-15 13:01 hh13579 阅读(164) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 下一页