自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

偷吃了老鼠的土豆

一个不知名的ACMer

  • 博客(29)
  • 收藏
  • 关注

原创 Number Sequence(斐波那契变形)

题目;A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n). InputThe input consists o...

2018-07-31 20:50:27 400

原创 百度之星资格赛——Problem A (快速幂+逆元)

题目:度熊手上有一本字典存储了大量的单词,有一次,他把所有单词组成了一个很长很长的字符串。现在麻烦来了,他忘记了原来的字符串都是什么,神奇的是他竟然记得原来那些字符串的哈希值。一个字符串的哈希值,由以下公式计算得到: H(s)=∏i≤len(s)i=1(Si−28) (mod 9973)H(s)=∏i=1i≤len(s)(Si−28) (mod 9973) SiSi代表 S[i] 字符的 ...

2018-07-31 16:01:27 194

原创 Combinations (乘法逆元)

题目:https://vjudge.net/contest/242287#problem/AGiven n different objects, you want to take k of them. How many ways to can do it?For example, say there are 4 items; you want to take 2 of them. So, ...

2018-07-31 15:18:14 170

原创 暑假集训

坚信一句话:有付出就有回报。2018年7月29日;学习了一些基础的算法知识:动态规划,贪心,二分,枚举,网络流,最短路,匹配,最小生成树等等,很多觉得自己很擅长,但是做起题来,错误满满,掌握得不是很好,每天的题目虽然写了不少,但是真正自己做对的,独立完成的,却少之又少。对于知识点的理解,挖掘等做的不好,题目不善与动手分析,急功近利,想要做出题目答案,这就是应该就是不够突出的原因吧,基础不好...

2018-07-31 00:49:02 187

原创 Help Hanzo(区间素数筛)

题目:Amakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hattori, the best ninja and the love of Nakururu. Aft...

2018-07-31 00:12:49 153

原创 Romantic(扩展欧几里得)

题目:The Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the Trees Trees are Shaking, Leaves are Falling. Lovers Walk passing, and so are You. ........................

2018-07-31 00:05:37 118

原创 Least Common Multiple (欧几里德算法的实现)

题目:The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and 15 is 105.  In...

2018-07-30 22:58:50 242

转载 sigma_function(因数和)

题目:Sigma FunctionTime Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1336DescriptionSigma function is an interesting function in Numb...

2018-07-30 22:25:48 512

原创 Pairs Forming LCM (数论)质因数分解+素数筛。

题目:https://vjudge.net/contest/242286#problem/DFind the result of the following code:long long pairsFormLCM( int n ) {    long long res = 0;    for( int i = 1; i <= n; i++ )        for( int j...

2018-07-30 20:29:57 199

原创 七夕节(筛选法)

题目:七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!" 人们纷纷来到告示前,都想知道谁才是自己的另一半.告示如下: 数字N的因子就是所有比N小又能被N整除的所有正整数,如12的因子有1,2,3,4,6. 你想知道你的另一半吗? Input输入数据的第一行是一个数字T(1<=T...

2018-07-30 19:04:37 145

原创 Goldbach`s Conjecture(数论)素数筛

题目:https://vjudge.net/contest/242286#problem/AGoldbach's conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states:Every even integer, greater than 2,...

2018-07-30 16:36:40 482

原创 Ignatius and the Princess IV (dp)

传送门:https://vjudge.net/problem/HDU-1029题目:给一列数,找出出现(n+1)/2次的数字:我们可以设一个标志,通过输入更新标志,来实现;如果输入的数和前边的数不同,就time--,否则,time++;如果time<=0了,我们就更新标志。因为他给的奇数,所以总有一个数会出现会多一次,所以不用担心会出现别的情况。#include <ios...

2018-07-27 22:39:57 1403

原创 Airport(最小生成树)

题目:https://vjudge.net/contest/241417#problem/C分析:如果修路的费用大于建一个机场的费用,那就建一个机场,cnt++,最终的机场数目等于cnt+集合数目。#include <iostream>#include <math.h>#include <stdio.h>#include <string.h...

2018-07-27 00:29:51 300

原创 连接的管道(最小生成树)

题目:老 Jack 有一片农田,以往几年都是靠天吃饭的。但是今年老天格外的不开眼,大旱。所以老 Jack 决定用管道将他的所有相邻的农田全部都串联起来,这样他就可以从远处引水过来进行灌溉了。当老 Jack 买完所有铺设在每块农田内部的管道的时候,老 Jack 遇到了新的难题,因为每一块农田的地势高度都不同,所以要想将两块农田的管道链接,老 Jack 就需要额外再购进跟这两块农田高度差相等长度的...

2018-07-26 19:09:02 314

原创 畅通工程再续(最小生成树)

题目:相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。当然,为了节省资金,只要求实现...

2018-07-26 19:01:51 199

原创 president's path(floyd+dp)

题目:Good old Berland has n cities and m roads. Each road connects a pair of distinct cities and is bidirectional. Between any pair of cities, there is at most one road. For each road, we know its len...

2018-07-25 22:05:09 302

原创 transaction transaction transaction (SPFA)

题目:https://vjudge.net/contest/241123#problem/CKelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens will read a book n...

2018-07-25 17:23:40 154

原创 敌兵布阵(线段树)

传送门:https://vjudge.net/contest/66989#problem/A分析:求区间和,但是每个区间的值会有改变。因此想到了线段树。这是我写的第一到关于线段树的题。线段树讲解 我的ac代码:#include <iostream>#include <stdio.h>#define maxn 50005using namespace ...

2018-07-25 00:23:19 332

原创 Okabe and Boxes(栈)

题目:Okabe and Super Hacker Daru are stacking and removing boxes. There are n boxes numbered from 1 to n. Initially there are no boxes on the stack.Okabe, being a control freak, gives Daru 2n comman...

2018-07-23 22:24:15 393

原创 Restructuring Company(并查集)

题目:https://vjudge.net/contest/240521#problem/CEven the most successful company can go through a crisis period when you have to make a hard decision — to restructure, discard and merge departments, f...

2018-07-23 19:15:45 385

原创 Jin Ge Jin Qu hao(dp)

题目:https://vjudge.net/contest/240161#problem/G01背包问题;#include <iostream>#include <stdio.h>#include <algorithm>#include <string.h>using namespace std;int T;int n,mt;...

2018-07-23 15:54:22 199

原创 最大子矩阵和(dp)最大子段和变形

题目:一个M*N的矩阵,找到此矩阵的一个子矩阵,并且这个子矩阵的元素的和是最大的,输出这个最大的值。例如:3*3的矩阵: -1 3 -12 -1 3-3 1 2 和最大的子矩阵是: 3 -1-1 31 2Input第1行:M和N,中间用空格隔开(2 <= M,N <= 500)。 第2 - N + 1行:矩阵中的元素,每行M个数...

2018-07-23 15:49:05 377

原创 Wavio Sequence(dp)

题目:https://vjudge.net/contest/240161#problem/C这道题是最长上升子序列的变形,利用求最长上身子序列的O(nlogn)的做法(具体参考:https://blog.csdn.net/dangwenliang/article/details/5728363)。正向求一次最长,逆向求一次最长,去两个中的较小的,*2-1,便得到答案。Ps:每一次初始化的时候要...

2018-07-23 15:26:49 162

原创 rescue(广搜)

题目:https://vjudge.net/contest/240161#problem/A Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, a...

2018-07-23 13:11:46 117

原创 Machine(模拟)

There is a machine with m(2≤m≤30)m(2≤m≤30) coloured bulbs and a button.When the button is pushed, the rightmost bulb changes. For any changed bulb, if it is red now it will be green; if it is green...

2018-07-22 15:24:28 490

原创 sum problem

Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge). In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. InputThe input will consist of a series of integers n, one ...

2018-07-22 15:03:55 120

原创 Invitation Cards(dijkstra算法+堆优化)Poj 1151

题目:http://poj.org/problem?id=1511In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, m...

2018-07-18 20:20:11 282

原创 POJ3660cow contest(floyd求传递闭包)

Cow ContestN (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rati...

2018-07-17 16:16:25 89

原创 kuangbin系列之最短路联系(MPI Maelstrom )

BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee's research advi...

2018-07-16 00:16:20 147

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除