- 博客(24)
- 问答 (1)
- 收藏
- 关注
原创 Gym 101498L The Shortest Path(两种写法 spfa和暴力)
题目链接:https://vjudge.net/problem/Gym-101498L在大佬那学了一手: https://blog.csdn.net/qq_35781950/article/details/78561131#commentBox题目: ou are given a directed weighted graph with N nodes and M edges. Yo...
2018-04-28 21:42:52 445
转载 Restore Points Gym - 101498M dfs暴力搜
转自一位大佬:https://blog.csdn.net/lifelikes/article/details/77620063题目链接:http://codeforces.com/gym/101498/problem/M题意: 有n个点 排列在一条直线上 题目给出任意两个点之间距离。 要你给出一种方案(存在多解),使之满足题目条件。 按坐标升序排列。 题目保证总有一个点在原点,点可...
2018-04-27 23:04:16 208
原创 Cooking Time Gym - 101498F (思维+贪心+优先队列)
题目链接:https://vjudge.net/problem/Gym-101498F题目: While cooking your dinner, you will need n ingredients. Initially, all ingredients are in the refrigerator.You are not allowed to keep more than k i...
2018-04-27 21:03:49 358
原创 Super Subarray Gym - 101498G(枚举+思维)
题目链接:https://vjudge.net/problem/Gym-101498G**题目:**In this problem, subarray is defined as non-empty sequence of consecutive elements.We define a subarray as Super Subarray if the summation of all ...
2018-04-27 19:00:20 331
原创 Counting Paths Gym - 101498D(组合数取模)
题目链接:https://vjudge.net/problem/Gym-101498D**题目:**A binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child.Co...
2018-04-27 18:51:10 256
原创 Spilt the String Gym - 101498J (枚举)
题目链接:https://vjudge.net/problem/Gym-101498J题目: Given a string s consisting of lowercase English letters and spaces, find a way to split the string s into multiple lines of the same length. Leading ...
2018-04-27 18:17:40 476
原创 H - Palindrome Number Gym - 101498H(思维)
题目: A palindrome number is a number that can be read the same way from left to right and from right to left. For example: 961169, 111, 554455 are palindromes, while 856, 10180, 7226 are not.Find th...
2018-04-27 18:07:54 424
原创 ZOJ 3261(逆向并查集)学了一手map+pair的用法
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3261借鉴了这位大佬的题意:https://www.cnblogs.com/cenariusxz/p/4792930.html题意: 有很多颗星球,各自有武力值,星球间有一些联系通道,现在发生战争,有一些联系通道会被摧毁,而一些星球会通过还没有被摧毁的联系通...
2018-04-26 12:25:32 207
转载 poj1988(并查集)
转自:https://www.cnblogs.com/geloutingyu/p/6048326.html 题目链接:http://poj.org/problem?id=1988 题意:有n个箱子,初始时每个箱子单独为一列;接下来有p行输入,M, x, y 或者 C, x;对于M,x,y:表示将x箱子所在的一列箱子搬到y所在的一列箱子上;对于C,x:表示求箱子x下面有多少个箱子;...
2018-04-25 11:07:39 212
原创 poj1703(种类并查集)
题目链接:http://poj.org/problem?id=1703题目: 警方决定捣毁两大犯罪团伙:龙帮和蛇帮,显然一个帮派至少有一人。该城有N个罪犯,编号从1至N(N<=100000。将有M(M<=100000)次操作。 D a b 表示a、b是不同帮派 A a b 询问a、b关系 Input 多组数据。第一行是数据总数 T (1 <= T <= 20)...
2018-04-24 20:21:59 574
原创 UVa1152 - 4 Values whose Sum is 0(hash、二分两种写法)
借鉴了两位大佬的博客: https://blog.csdn.net/a197p/article/details/46575743 https://blog.csdn.net/qq_21057881/article/details/50531784 hash结构体:struct Hash_map{ sta...
2018-04-24 10:51:15 449 2
原创 Problem G GentleBots(对结构体的使用值得学习)
题目链接:https://vjudge.net/problem/Gym-101606G题目: Rainforest Inc. is opening a large new automated warehouse in the far Northern reaches of the UK—some place they call “Walthamstow”. The robotic wor...
2018-04-21 14:01:39 351
原创 2070: Seating Chart(归并排序求逆序数)
题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=2070题目: Description Bilbo’s birthday is coming up, and Frodo and Sam are in charge of all the party planning! They have invited all the hobb...
2018-04-18 19:29:08 425
原创 2069: Saruman’s Level Up(思维枚举+质数分解求组合数)
题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=2069题目: Description Saruman’s army of orcs and other dark minions continuously mine and harvest lumber out of the land surrounding his might...
2018-04-16 20:34:54 439 2
转载 CSU 2020 Card Hand Sorting(枚举排序+最长公共子序列)
转自:https://blog.csdn.net/qq_38786088/article/details/79793849题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=2020题目: Description When dealt cards in the card game Plump it is a good idea...
2018-04-11 10:40:18 411
原创 CSU2020:Artwork(并查集)
题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=2022题目: Description A template for an artwork is a white grid of n × m squares. The artwork will be created by painting q horizontal and ver...
2018-04-09 22:10:19 867
原创 D - ShaatChara Gym - 101353D(尼姆博弈)
题目链接:https://vjudge.net/problem/Gym-101353D题目:Score: 100 CPU: 1s Memory: 1024MB Meena and Razu have been playing Shaat Chara for many years. But they think the game is too violent. So, they ca...
2018-04-06 23:09:20 239
原创 Max and Alexis Plan to Conquer the World Gym - 101353B(一个数多少次方要有敏感性,两边取对数)
题目链接:https://vjudge.net/problem/Gym-101353B题目: B. Max and Alexis Plan to Conquer the World Score: 100 CPU: 1.25s Memory: 1024MB There is this kitten Alexis....
2018-04-06 22:56:01 441
转载 hdu1811 Rank of Tetris(拓扑排序+并查集)
转自: https://blog.csdn.net/su20145104009/article/details/47337581题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1811题目思路:1:先建图,然后寻找入读为0的顶点2:然后找到与这个顶点有关的边和点,删去边,点的入度-13.继续寻找下一个入度为0的顶点。。重复2.对...
2018-04-05 11:45:13 111
原创 hdu1598 find the most comfortable road(并查集+贪心)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1598题目思路:把所有的边从小到大排序,然后从最小的边开始枚举。代码:#include <iostream>#include <stdio.h>#include <math.h>#include <stdlib.h>#include...
2018-04-04 17:13:29 114
原创 hdu1102 Constructing Roads 基础最小生成树(并查集)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1102代码:#include <iostream>#include <stdio.h>#include <math.h>#include <string.h>#include <string>#include <stdl...
2018-04-02 21:17:43 200
原创 hdu1213 How Many Tables (基础并查集)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1213题意: 首先输入一个数T为案例数,每一个案例的第一行输入一个N和一个M,N代表有多少个人(编号从1到N),M表示有几组人是朋友,随后的M行,表示谁和谁是朋友。注意朋友的朋友也互为朋友,只有朋友才能坐在同一个桌子,求需要的最少的桌子数。代码:#include <iostream...
2018-04-02 21:14:21 128
原创 CSU2026- Daydreaming Stockbroker(贪心)
题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=2026题意: 题意就是一个炒股票的过程,给你连续几天的 每一股的价格,你最开始有100块钱,你最多可以买十万份股票,你每一天可以既可以买股票也可以卖股票,求最后最多的钱。思路: 注意longlong就行,简单贪心。代码:#include <iostream&...
2018-04-01 23:57:50 313
转载 Gym - 101466 J. Jeronimo's List 桶排序
转自:https://blog.csdn.net/prolightsfxjh/article/details/79321161题目链接:http://codeforces.com/gym/101466/problem/J题意:一共n个数字(3<=n<=3e7, 0<=ai<3e7 ),给出前面的m个(3<=m<=min(100, n)), a[i...
2018-04-01 22:01:50 219
空空如也
谁能帮我写一个java抽奖小程序
2018-01-02
TA创建的收藏夹 TA关注的收藏夹
TA关注的人