07 2018 档案

摘要:题目链接:https://vjudge.net/contest/239445#problem/H 题目大意:输入n,k,有n*n* n*n的网格,要求每行每列刚好有k个*,每n*n的小方格内也刚好有k个*。 思路:不是自己写出来的,大概思路就是从第一排开始放,放满k个,然后跳到下一行,在这行的基础上 阅读全文
posted @ 2018-07-31 10:46 执||念 阅读(119) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/contest/241341#problem/G Indonesia, as well as some neighboring Southeast Asian countries and some other East Asian countries, 阅读全文
posted @ 2018-07-30 19:18 执||念 阅读(254) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1325 Is It A Tree? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tota 阅读全文
posted @ 2018-07-30 18:16 执||念 阅读(161) 评论(0) 推荐(0)
摘要:算法学习:https://blog.csdn.net/qq_16234613/article/details/77431043 http://www.cnblogs.com/chenchengxun/p/4718698.html 题目链接:https://vjudge.net/contest/219 阅读全文
posted @ 2018-07-30 10:08 执||念 阅读(243) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/contest/241341#problem/I 题目大意:输入t,t组样例,输入n,m,有n个圆槽,m个硬币,接下来m行代表每个硬币所在的位子,要求你移动硬币使得相邻的硬币距离相等,输出最小的最大移动步数(这里所指的是 一个硬币最大移动的步数) 个人 阅读全文
posted @ 2018-07-29 17:33 执||念 阅读(281) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/contest/241341#problem/C Tree Land Kingdom is a prosperous and lively kingdom. It has N cities which are connected to each oth 阅读全文
posted @ 2018-07-29 11:14 执||念 阅读(304) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/contest/239445#problem/E E - Problem Statement You are given nn strings str1,str2,…,strnstr1,str2,…,strn , each consisting of 阅读全文
posted @ 2018-07-28 20:31 执||念 阅读(706) 评论(0) 推荐(0)
摘要:学习博客:https://www.cnblogs.com/zhangming-blog/p/5414514.html 其实就是加点法:从不属于这个集合的点中找从本集合可以找到的最小边,加入本集合 看代码 阅读全文
posted @ 2018-07-28 16:18 执||念 阅读(550) 评论(0) 推荐(0)
摘要:思路:其实就是加一个pre数组,用来存当前顶点的前一个顶点的值。 看代码 阅读全文
posted @ 2018-07-28 15:42 执||念 阅读(287) 评论(0) 推荐(0)
摘要:思路:感觉有点像暴力啊,反正我是觉得很暴力,比如求d[i][j],用这个方法求的话,就直接考虑会不会经过点k(k是任意一点) ,最终求得最小值 看代码 阅读全文
posted @ 2018-07-28 12:23 执||念 阅读(366) 评论(0) 推荐(0)
摘要:思路:先找出最短的一个点,也就是起点,从起点出发,找最短的边,同时标记起点为true(代表已经访问过),访问过的点就不用再访问了,依次下去,保证每一次找到的边都是最短的边 到最后没有边可以更新了就代表结束 看代码 阅读全文
posted @ 2018-07-28 11:56 执||念 阅读(2176) 评论(0) 推荐(0)
摘要:单源最短路问题是固定一个起点,求它到任意一点最短路的问题。 记从起点出发到顶点 i 的最短距离为d[i],则有以下等式成立 d[i]=min{d[j]+(从j到 i 的边的权值) 看代码 阅读全文
posted @ 2018-07-28 10:51 执||念 阅读(976) 评论(0) 推荐(0)
摘要:题目大意:给定具有n个顶点m条边的图。要给每个顶点上色,并且要求相邻的顶点颜色不同,问的是能否用两种颜色进行染色,题目保证没有重边和自环 限制条件:1<=m,n<=1000 输入 n=3,m=3 0 1 0 2 1 2 输出 NO 输入 n=4 m=4 0 1 0 3 1 3 2 3 输出 YES 阅读全文
posted @ 2018-07-27 16:37 执||念 阅读(212) 评论(0) 推荐(0)
摘要:学习链接:https://blog.csdn.net/a272846945/article/details/50829610?locationNum=7 阅读全文
posted @ 2018-07-27 13:57 执||念 阅读(194) 评论(0) 推荐(0)
摘要:学习链接:https://www.cnblogs.com/weekbo/p/8202754.html 大概就是如果在结构体变量之间用到了赋值的话,如果有指针变量,要用自定义函数 阅读全文
posted @ 2018-07-27 13:22 执||念 阅读(244) 评论(0) 推荐(0)
摘要:学习链接:http://www.runoob.com/cplusplus/cpp-stl-tutorial.html kandaima 阅读全文
posted @ 2018-07-27 10:54 执||念 阅读(200) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/contest/237394#problem/E A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, the 阅读全文
posted @ 2018-07-26 10:26 执||念 阅读(220) 评论(0) 推荐(0)
摘要:题目链接:http://codeforces.com/problemset/problem/55/D D. Beautiful numbers time limit per test 4 seconds time limit per test memory limit per test 256 me 阅读全文
posted @ 2018-07-25 14:33 执||念 阅读(302) 评论(0) 推荐(0)
摘要:题目链接:http://poj.org/problem?id=3252 Round Numbers Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 15688 Accepted: 6408 Description The cows 阅读全文
posted @ 2018-07-25 11:40 执||念 阅读(156) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4734 F(x) Time Limit: 1000/500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submissi 阅读全文
posted @ 2018-07-24 19:08 执||念 阅读(694) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2089 不要62 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submiss 阅读全文
posted @ 2018-07-24 19:06 执||念 阅读(178) 评论(0) 推荐(0)
摘要:题目链接:http://codeforces.com/problemset/problem/669/D D. Little Artem and Dance time limit per test 2 seconds time limit per test memory limit per test 阅读全文
posted @ 2018-07-22 15:09 执||念 阅读(268) 评论(0) 推荐(0)
摘要:博客学习:https://blog.csdn.net/yas12345678/article/details/52601454 介绍一下 *max_element(a,a+n) 求取数组最大的元素 与之对应的是*min_element(a,a+n) 阅读全文
posted @ 2018-07-22 11:13 执||念 阅读(911) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/contest/237394#problem/C Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn th 阅读全文
posted @ 2018-07-20 16:03 执||念 阅读(241) 评论(0) 推荐(0)
摘要:关于map的学习:https://www.cnblogs.com/fnlingnzb-learner/p/5833051.html Map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据 处理能力,由于这个特性,它完 阅读全文
posted @ 2018-07-20 15:51 执||念 阅读(267) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/contest/237394#problem/B There are n pictures delivered for the new exhibition. The i-th painting has beauty ai. We know that 阅读全文
posted @ 2018-07-20 10:57 执||念 阅读(297) 评论(0) 推荐(0)
摘要:学习:https://blog.csdn.net/angle555945/article/details/7417722 题目链接:https://vjudge.net/contest/231317#status/1751151850/E/0/ 有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取 阅读全文
posted @ 2018-07-19 15:52 执||念 阅读(194) 评论(0) 推荐(0)
摘要:算法学习:http://www.cnblogs.com/George1994/p/7710886.html 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1541 Astronomers often examine star maps where st 阅读全文
posted @ 2018-07-18 18:00 执||念 阅读(278) 评论(0) 推荐(0)
摘要:首先介绍这两种函数是什么意思 upper_bound是找到大于t的最小地址,如果没有就指向末尾 lower_bound是找到大于等于t的最小地址 题目链接:https://vjudge.net/contest/231314#problem/E You are given n integers a1, 阅读全文
posted @ 2018-07-16 11:14 执||念 阅读(4400) 评论(0) 推荐(1)
摘要:题目链接:https://vjudge.net/contest/231314#problem/D Peter Parker wants to play a game with Dr. Octopus. The game is about cycles. Cycle is a sequence of 阅读全文
posted @ 2018-07-16 09:46 执||念 阅读(289) 评论(0) 推荐(0)
摘要:题目:硬币游戏1,Alice和Bob在玩这样一个游戏。给定k个数字a1,a2,···ak。 一开始,有x枚硬币,Alice和Bob轮流取硬币。每次所取硬币的枚数 一定要在a1,a2···,ak当中。Alice先取,取走最后一枚硬币的一方获胜。当双方都采取最有策略时,谁会获胜?假定a1a2···ak中 阅读全文
posted @ 2018-07-15 15:19 执||念 阅读(3596) 评论(0) 推荐(0)
摘要:题目大意:输入n,代表有n种数,接下来n个数代表n种数,再接下来n个数代表每种数有多少个,在输入K,代表用这些数要加成的和 问你是否能加为K,能输出yes,不能输出no 这是一个典型的多重背包问题,可以用dp来求解,。但是如何定义递推关系会影响到最终的复杂度,首先我们先看一下如下定义: dp[i+1 阅读全文
posted @ 2018-07-15 09:23 执||念 阅读(420) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/contest/237052#problem/J The magical world looks like a 2-D R*C grid. Initially there are many civilizations, each civilizatio 阅读全文
posted @ 2018-07-14 16:37 执||念 阅读(184) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/contest/237052#problem/H Here we go! Let's define the diversity of a list of numbers to be the difference between the largest 阅读全文
posted @ 2018-07-14 13:17 执||念 阅读(919) 评论(0) 推荐(0)
摘要:感觉很多贪心的题目只要想到怎么贪心就很快能解决,但是没有想到的话代码量就会很大,而且很容易出错,所有贪心还是要多做题目,掌握各种贪心的题目 题目链接:https://vjudge.net/contest/231313#problem/D A factory produces products pac 阅读全文
posted @ 2018-07-13 12:09 执||念 阅读(935) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/contest/216347#problem/C Alice gets two sequences A and B. A easy problem comes. How many pair of sequence A' and sequence B' 阅读全文
posted @ 2018-07-11 14:44 执||念 阅读(1133) 评论(0) 推荐(0)
摘要:首先介绍什么是线段树: 线段树是擅长处理区间一种数据结构。主要求区间的和,最大值,最小值,区间更新~~~~~ 下面直接看题 题目链接:https://vjudge.net/contest/217846#problem/D C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下T 阅读全文
posted @ 2018-07-10 20:25 执||念 阅读(205) 评论(0) 推荐(0)
摘要:fill是按照单元来赋值的,所以可以填充一个区间的任意值 memset函数一般只用于赋初值为0或者-1 阅读全文
posted @ 2018-07-10 10:30 执||念 阅读(1235) 评论(0) 推荐(0)
摘要:学习了01背包,现在进一步探讨递推关系,完全背包问题 题目:有n种重量和价值分别为wi,vi的物品,从这些物品种选出总重量不超过W的物品,求出挑选物品价值总和的最大值。在这里,每种物品可以挑选任意多件 限制条件:1<=n<=100,1<=wi,vi<=100,1<=W<=10000 输入:n=3 ( 阅读全文
posted @ 2018-07-09 11:08 执||念 阅读(201) 评论(0) 推荐(0)
摘要:二分搜索,通过不断缩小解可能存在的范围,从而求得最优解的方法 题目链接:https://vjudge.net/contest/236677#problem/G There are K hours left before Agent Mahone leaves Amman! Hammouri does 阅读全文
posted @ 2018-07-08 10:54 执||念 阅读(223) 评论(0) 推荐(0)
摘要:关于set的学习:http://www.360doc.com/content/17/0526/22/10408243_657567440.shtml 题目链接:https://vjudge.net/contest/236677#problem/D 题目大意:有n个桌子,q条指令,每个桌子有多少椅子按 阅读全文
posted @ 2018-07-07 10:46 执||念 阅读(637) 评论(0) 推荐(0)
摘要:01背包是在M件物品取出若干件放在空间为W的背包里,每件物品的体积为W1,W2至Wn,与之相对应的价值为P1,P2至Pn。01背包是背包问题中最简单的问题。01背包的约束条件是给定几种物品,每种物品有且只有一个,并且有权值和体积两个属性。在01背包问题中,因为每种物品只有一个,对于每个物品只需要考虑 阅读全文
posted @ 2018-07-05 11:26 执||念 阅读(238) 评论(0) 推荐(0)
摘要:矩阵快速幂的学习: https://blog.csdn.net/wust_zzwh/article/details/52058209 n>>1是指n的二进制数向右移一位 n&1等价n%2 https://vjudge.net/contest/231312#problem/F 阅读全文
posted @ 2018-07-05 10:46 执||念 阅读(96) 评论(0) 推荐(0)
摘要:第一次使用结构体,感觉特别方便,记录下来,防止以后忘记怎么使用 https://vjudge.net/contest/231312#problem/G 阅读全文
posted @ 2018-07-05 10:41 执||念 阅读(134) 评论(0) 推荐(0)