- 博客(51)
- 资源 (5)
- 收藏
- 关注
原创 单调栈四种模板
前提给你一串数字;1.求出其中任意一个数字的左边距离他最近并且比他小的数字是多少;数组实现栈#include <iostream>#include <cstdio>using namespace std;const int maxx=1e6+7;int stk[maxx];int main(){ int n; cin >>n...
2019-09-28 21:14:25 494
原创 Summer Vacation 贪心
Problem StatementThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.You can take and complete at most...
2019-09-28 16:33:33 198
原创 AtCoder Beginner Contest 136 D - Gathering Children模拟 思维
Problem StatementGiven is a string S consisting of L and R.Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th...
2019-09-28 16:13:12 324
原创 poj 2492 A Bug's Life 二分图 并查集
BackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gende...
2019-09-28 15:46:35 155
原创 K-Dominant Character CodeForces - 888C
You are given a string s consisting of lowercase Latin letters. Character c is called k-dominant iff each substring of s with length at least k contains this character c.You have to find minimum k su...
2019-09-22 22:34:35 193
原创 洛谷 P1162 填涂颜色(巧妙DFS)
题目描述由数字00组成的方阵中,有一任意形状闭合圈,闭合圈由数字11构成,围圈时只走上下左右44个方向。现要求把闭合圈内的所有空间都填写成22.例如:6 \times 66×6的方阵(n=6n=6),涂色前和涂色后的方阵如下:0 0 0 0 0 00 0 1 1 1 10 1 1 0 0 11 1 0 0 0 11 0 0 0 0 11 1 1 1 1 10 0 0 0 0 00...
2019-09-21 16:57:00 602 2
原创 Crossing River(poj 1700)
题目来源:Crossing RiverA group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row...
2019-09-21 16:14:45 189
原创 2048 Game(分治法)
You are playing a variation of game 2048. Initially you have a multiset s of n integers. Every integer in this multiset is a power of two.You may perform any number (possibly, zero) operations with t...
2019-09-20 21:54:09 668
原创 How many integers can you find HDU - 1796(容斥定理应用)
Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integers in the set. For example, N=12, and M-integer s...
2019-09-19 17:45:05 210
原创 Ekka Dokka LightOJ - 1116( 暴力枚举)
Ekka and his friend Dokka decided to buy a cake. They both love cakes and that’s why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and Dokka ...
2019-09-19 16:01:25 155
原创 Teacher Bo HDU - 5762(暴力+抽屉原理)
Teacher BoBo is a geography teacher in the school.One day in his class,he marked N points in the map,the i-th point is at (Xi,Yi).He wonders,whether there is a tetrad (A,B,C,D)(A<B,C<D,A≠CorB≠D)...
2019-09-18 23:31:31 128
原创 吃糖果 HDU - 1205(排列组合+抽屉原理)
HOHO,终于从Speakless手上赢走了所有的糖果,是Gardon吃糖果时有个特殊的癖好,就是不喜欢将一样的糖果放在一起吃,喜欢先吃一种,下一次吃另一种,这样;可是Gardon不知道是否存在一种吃糖果的顺序使得他能把所有糖果都吃完?请你写个程序帮忙计算一下。Input第一行有一个整数T,接下来T组数据,每组数据占2行,第一行是一个整数N(0<N<=1000000),第二行是N个...
2019-09-18 22:50:04 521
原创 Find a multiple POJ - 2356(鸽巢原理/抽屉原理)
The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000. This numbers are not necessarily different (so it may happen that two or...
2019-09-18 22:29:11 173
原创 桌面打开codeblocks提示错误default.conf
今天上午打开coldblocks时,突然就打不开了,以前用的好好的,说不能用就不能用了;提示错误如下:.在网上查了一下,提示的错误信息是 : 在你的codebocks目录里面default.conf这个配置文件出现错误;解决办法,简单粗暴,直接进入目录,路径为:C:\users\“用户名字”\Appdata\Roaming\CodeBlocks目录删除default.conf文件即可...
2019-09-18 10:37:51 2053
原创 容斥定理+鸽巢原理
今天开会了,刷到剩了18个人,好残酷好悲伤,幸运的是我留了下来,竞争激烈,但我可以的。呵…明天来更新这个算法,先洗洗澡睡觉,打了四个小时的球,累的像狗一样,晚安…...
2019-09-16 23:28:11 981
原创 Cow Hurdles POJ - 3615(Floyd的变形)
Farmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practicing jumping over hurdles. They are getting tired, though, so they want to be able to use as ...
2019-09-10 16:24:06 157
原创 Dijkstra算法和Floyd算法超详解以及区别
鉴于之前我看到过非常好的博客,如果自己总结的话,大多也是按照别的博主的思路来解释,所以就直接推荐给大家这些优秀的博客;Dijkstra:最短路径dijkstra算法精品代码(超详解)Floyd:Floyd 算法最短路径问题精品(超详解)关于代码模板,我还是想展示自己的模板,毕竟自己的用着才是最舒服的(其实都大同小异,自己写一遍才能成为自己的东西)Dijkstra模板:#include &...
2019-09-09 16:56:26 27691 11
原创 最短路 HDU - 2544(Floyd算法模板&&Dijkstra算法模板)
在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口是赛场所在...
2019-09-09 15:05:39 173
原创 Frogger POJ - 2253(dijkstra变形)
Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists’ sun...
2019-09-08 16:58:16 155
原创 Constructing Roads HDU - 1102(最小生成树)
There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B are connected, if and only if t...
2019-09-07 11:17:56 141
原创 畅通工程再续 HDU - 1875(最小生成树)
相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。当然,为了节省资金,只要求实现任意2个小...
2019-09-06 16:57:55 86
原创 Highways POJ - 2485(最小生成树)
The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem. They’re pla...
2019-09-06 16:36:55 212
原创 Zjnu Stadium HDU - 3047(加权并查集)
In 12th Zhejiang College Students Games 2007, there was a new stadium built in Zhejiang Normal University. It was a modern stadium which could hold thousands of people. The audience Seats made a circl...
2019-09-06 10:23:43 162
原创 How Many Tables HDU - 1213(并查集)
Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a...
2019-09-06 07:57:36 168
原创 Dragon Balls HDU - 3635(类似加权并查集)
Five hundred years later, the number of dragon balls will increase unexpectedly, so it’s too difficult for Monkey King(WuKong) to gather all of the dragon balls together.His country has N cities and...
2019-09-05 23:23:35 149
原创 Cube Stacking POJ - 1988(带权并查集)
Farmer John and Betsy are playing a game with N (1 <= N <= 30,000)identical cubes labeled 1 through N. They start with N stacks, each containing a single cube. Farmer John asks Betsy to perform ...
2019-09-05 08:53:40 121
原创 Ubiquitous Religions POJ - 2524(并查集)
There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your university beli...
2019-09-04 08:34:32 88
原创 还是畅通工程 HDU - 1233
某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)/2行对应村庄间的距离,每行给出一对正整数...
2019-09-03 22:08:27 96
原创 畅通工程 HDU - 1232(并查集)
某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,每行给出一对正...
2019-09-03 21:58:24 148
原创 The Suspects POJ - 1611(并查集)
Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to s...
2019-09-03 21:46:33 91
原创 青蛙的约会 POJ - 1061(扩展欧几里得算法)
两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,...
2019-09-03 17:08:09 119
原创 青蛙的约会 POJ - 1061
两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,...
2019-09-03 16:42:53 132
原创 Large Division LightOJ - 1214
给定两个整数a和b,你应该检查a是否可以被b整除。我们知道,当且仅当存在整数c使得a = b * c时,整数a才能被整数b整除。Input开始会输入一个数字 T (≤ 525), 代表了样例数.每个样例会给两个整数a (-10200 ≤ a ≤ 10200) and b (|b| > 0, b fits into a 32 bit signed integer). 数字不会包含前导零....
2019-09-03 16:25:11 226
原创 Integer Divisibility LightOJ - 1078
If an integer is not divisible by 2 or 5, some multiple of that number in decimal notation is a sequence of only a digit. Now you are given the number and the only allowable digit, you should report t...
2019-09-03 16:19:55 123
原创 新手必看系列——如何获取CSDN的积分?(新手必看)
下载积分攻略:个人设置里进行手机绑定CSDN账户 奖励50分 (右上角设置-账户安全-手机绑定)完成任务送若干分积分 http://task.csdn.net/上传有效资源获取积分(上传非法,广告资源用户,将被扣除一定积分,严重者封号)。· 上传自己设分资源被下载,下载量×资源分,100分封顶。· 上传0分资源被下载,下载量×系统奖励1分,100封顶评论资源获取积分(所下载...
2019-09-03 10:44:38 8583 319
原创 Romantic HDU - 2669(扩展欧几里得)
The Sky is Sprite.The Birds is Fly in the Sky.The Wind is Wonderful.Blew Throw the TreesTrees are Shaking, Leaves are Falling.Lovers Walk passing, and so are You.…Write in English class by yifen...
2019-09-03 10:36:03 236
原创 A/B HDU - 1576(扩展欧几里得)
要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。Output对应每组数据输出(A/B)%9973。Sample Input21000 53...
2019-09-03 10:12:32 249
matlab灰度预测超详细可任意修改代码.rar
2020-05-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人