- 博客(18)
- 收藏
- 关注
原创 poj 1182 食物链 三重并查集问题
#include#includeusing namespace std;int father[150010];int findd(int x){ return father[x]==x ? x : father[x]=findd(father[x]);}bool jiance(int x,int y){ return findd(
2018-01-31 20:03:02 143
原创 FZU - 2214 C - Knapsack problem 超大背包
Given a set of n items, each with a weight w[i] and a value v[i], determine a way to choose the items into a knapsack so that the total weight is less than or equal to a given limit B and the total va
2018-01-29 19:51:10 197
原创 poj 3414 路径输出的bfs(pre)
#include #include using namespace std; #include #include #include struct cup { int x, y; int step; int flag;//标记操作 cup *pre;//记录路径 }; queueQ
2018-01-29 18:45:55 172
原创 poj3984 带路径输出的BFS
#include #include #include #include #include #include #include using namespace std;struct node{ int x, y;};int arr[5][5];bool vis[5][5];int dx[4] = {0, 1,
2018-01-29 17:27:21 176
原创 POJ - 1426 Find The Multiple
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there
2018-01-28 21:25:59 115
原创 poj 1852 Ants
DescriptionAn army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it immediatelly falls off it. When two ant
2018-01-28 18:46:44 132
原创 New Year and Curling 计算几何
Carol is currently curling.She has n disks each with radius r on the 2D plane.Initially she has all these disks above the line y = 10100.She then will slide the disks towards the line y
2018-01-25 16:47:21 216
原创 POJ3321:Apple Tree DFS序+树状数组
DescriptionThere is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.
2018-01-24 17:14:16 183
原创 HDU 3887 DFS序+树状数组
Problem DescriptionYou are given a tree, it’s root is p, and the node is numbered from 1 to n. Now define f(i) as the number of nodes whose number is less than i in all the succeeding nodes of nod
2018-01-24 16:57:22 316
原创 B. New Year's Eve 异或运算
Since Grisha behaved well last year, at New Year's Eve he was visited by Ded Moroz who brought an enormous bag of gifts with him! The bag contains n sweet candies from the good ol' bakery, each labe
2018-01-24 15:43:38 444
原创 EOJ Monthly 2018.1 F1. 最小 OR 路径 (EASY) 新的建图方式+vis同时记录点和代价
Memory limit: 512 megabytes给定一个有 n 个点和 m 条边的无向图,其中每一条边 ei 都有一个权值记为 wi。对于给出的两个点 a 和 b,求一条a 到 b 的路径,使得路径上的边权的 OR(位或)和最小,输出这个值。(也就是说,如果将路径看做边的集合 {e1,e2,…,ek},那
2018-01-23 15:26:55 476
原创 C. Party Lemonade 很像背包的贪心
A New Year party is not a New Year party without lemonade! As usual, you are expecting a lot of guests, and buying lemonade has already become a pleasant necessity.Your favorite store sells lemona
2018-01-22 15:36:20 469 2
原创 A. Modular Exponentiation
The following problem is well-known: given integers n and m, calculate,where 2n = 2·2·...·2 (n factors), and denotes the remainder of division of x by y.You are asked to solve the "re
2018-01-22 12:39:41 299
原创 Hello 2018 B. Christmas Spruce
B. Christmas Sprucetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputConsider a rooted tree. A rooted tree ha
2018-01-22 11:46:56 218
原创 Hello 2018 D. Too Easy Problems
You are preparing for an exam on scheduling theory. The exam will last for exactly T milliseconds and will consist of nproblems. You can either solve problem i in exactly ti milliseconds or ignore
2018-01-22 11:28:32 319
原创 2018 蓝桥杯省赛 B 组模拟赛(一)-数列求值
对于一个含有 n+2n+2 个元素的数列,A_0, A_1, \cdots A_nA0,A1,⋯An,满足这样的递归公式\displaystyle A_i = \frac{A_{i-1} + A_{i + 1}}{2} - C_i\ \ \ 1 \le i \le nAi=2Ai−1+Ai+1−Ci 1≤i≤n现在我们知道 A_0, A_{n +
2018-01-22 09:32:19 1388
原创 CF915D Almost Acyclic Graph
给出一个n" role="presentation" style="margin: 0px; padding: 0px; display: inline; line-height: normal; font-size: 14px; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none
2018-01-19 13:42:10 252
原创 Educational Codeforces Round 36 (Rated for Div. 2) C 不大于某个数的序列变换
C. Permute Digitstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two positive integer numbers a and b. Permute (change order) of the
2018-01-19 12:42:46 274 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人