自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 资源 (3)
  • 收藏
  • 关注

原创 UVa7352 dance recital(暴力+记忆化搜索)

题意:给出 t 个序列,求其中两两之间相同的字母的总和最小。链接:UVA live 7352 –dance recital知识点:对数组 a 进行全排列#include<algorithm>next_permutation(a , a + n )代码:#include <iostream>#include <cstdio>#include <cstring>#include <cstdlib>

2016-08-26 10:15:58 275

原创 line them up(判断字符串的升降)

An eccentric coach asks players on the team to line up alphabetically at the start of practice. The coach does not tell the players whether they need to line up in increasing or decreasing order, so th

2016-08-25 13:26:04 513

原创 机器人走方格(dp)

题意:M * N的方格,一个机器人从左上走到右下,只能向右或向下走。有多少种不同的走法?由于方法数量可能很大,只需要输出Mod 10^9 + 7的结果。链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1118代码:#include <iostream>#include <cstdio>#include <cstr

2016-08-24 17:15:47 719

原创 中国剩余定理

题意:一个正整数K,给出K Mod 一些质数的结果,求符合条件的最小的K。例如,K % 2 = 1, K % 3 = 2, K % 5 = 3。符合条件的最小的K = 23。链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1079代码:#include <iostream>#include <cstdio>#in

2016-08-24 17:04:27 177

原创 Naive and Silly Muggles(判断钝角与三点共园)

题意:给出四点,前三点都在圆上或者圆内,判断第四点是否在圆上或者圆内。链接:HDU 4720代码:#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>#include <iostream>using namespace std;struct point{ double x, y;} a[

2016-08-24 11:52:05 407

原创 Linux学习(实验楼输出命令)

cd Desktoptouch pm.c(touch创建)gesit pm.c(gedit编译器)

2016-08-23 10:50:53 747

原创 环状序列(UVa1584)

题意:长度为n的环状串,求字典序最小的表示。 刘汝佳《算法竞赛入门经典2》p52代码:#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <ctype.h>using namespace std;char n[110];int len;int les(int x, in

2016-08-18 11:18:38 266

原创 背包问题

题意:如题链接: https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1085代码:#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <cstdlib>#include <algorithm>using n

2016-08-17 10:10:08 197

原创 easy problem from rujia liu

题意:给出一个数在序列中第k次出现的位置。思路:用map#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <cstdlib>#include <algorithm>#include <string>#include <map>#include <vector>#include

2016-08-16 14:00:39 244

原创 Ignatius and the Princess IV

题意:给出一个奇数n,再给出n个数,求出现了至少(n+1)/2次的那个数。(反正不会出现两个以上)链接:http://acm.hdu.edu.cn/showproblem.php?pid=1175代码:#include <cstdio>#include <cstring>const int maxn = 1e6;int vis[maxn];int main(){ int n;

2016-08-15 16:28:02 225

原创 最长公共子序列

题意:给出两个序列,求最长公共子序列。链接: https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1006思路:状态转移方程:if(a[i-1] == b[j-1]) dp[i][j] = dp[i-1][j-1] + 1;else dp[i][j] = max(dp[i-1][j], dp[i][j

2016-08-15 11:30:13 219

转载 大数与小数模板(乘法,加法)

代码:#include <stdio.h> #include <string.h> //大数乘小数void mult(char c[],int m,char t[]) { char s[100]; int len=strlen(c); for(int i=0; i<len; i++) s[len-i-1]=c[i]-'0';

2016-08-13 16:44:47 1154

原创 最大连续子序列

题意:给出一个序列,求这个序列的最大连续子序列。链接:http://acm.hdu.edu.cn/showproblem.php?pid=1003思路:从输入开始,四个变量:ma:记录每次的最大值。st:序列开始,当res小于0时,从下一个开始。en:序列尾,每当当前值大于原先的ma时,en就等于当前,不能直接令en加1。res : 记录每次加上输入的值后的总值,以res判定是否大于原先的最

2016-08-13 15:11:24 468

原创 interesting drink(二分)

题意:给出n个数,再给出q个数,求小于等于的个数链接:http://codeforces.com/contest/706/problem/B思路:直接排序加二分代码:#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <cstdlib>#include <algorithm>usin

2016-08-12 09:51:12 205

原创 凸包问题(模板)

Andrew算法模板:具体实现: 1.把所有点按照x从小到大进行排序 (x同则y用y进行排序) 2.删除重复序列后得到序列p1,p2.。。, 3.让后把p1 p2放入凸包中 从p3开始。当新点在凸包“前进”方向的左边时继续,否则依此删除最近加入凸包的点 直到新点在左边 这个算法你可以理解为逆时针画圆 每次半个圆int Cross(point A,point B)//叉积 {

2016-08-11 11:22:19 269

原创 子段求和(线段树)

题意:给出一个长度为N的数组,进行Q次查询,查询从第i个元素开始长度为l的子段所有元素之和。链接: https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1081代码:#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#inclu

2016-08-10 10:49:14 473

原创 大数乘法

链接: https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1027#include<cstdio>#include<cstring>#include<iostream>#include <cmath>using namespace std;const int maxn = 1010;char a[maxn],b[

2016-08-10 08:50:55 208

原创 下沙的沙子有几粒?(递推)

题意:给m个H和n个D,从左开始数H的累积个数总是不比D的累计数少的排列有多少种。链接:http://acm.hdu.edu.cn/showproblem.php?pid=1267思路: 递推公式:a[m][n] = a[m-1][n] + a[m][n-1];代码:#include <iostream>#include <cstdio>#include <cstring>#include

2016-08-09 15:42:29 405

原创 求抛物线与直线相交面积

题意:给出三点,其中第一个点是抛物线的顶点,其余两点是直线与抛物线相交的点,求围成的面积。链接:http://acm.hdu.edu.cn/showproblem.php?pid=1071思路:(参考网上代码)根据三点求出抛物线和直线的方程,再利用定积分求出面积。#include <iostream>#include <cstdio>#include <cstring>#include <cm

2016-08-09 14:48:16 3523

原创 climbing worm(贪心)

链接:http://acm.hdu.edu.cn/showproblem.php?pid=1051思路:一定是奇数,因为到最后肯定是只要花一分钟到达,而前面每一次都是两分钟。代码:#include <iostream>#include <cstdio>#include <cstring>#include <cstdlib>#include <algorithm>using namespac

2016-08-08 16:00:08 219

原创 FatMouse' Trade(贪心)

题意:给出两个数以及两个序列,第一个序列是能获得的最大价值,第二个序列是获得这个价值需要的付出,求最大价值。链接:http://acm.hdu.edu.cn/showproblem.php?pid=1009思路:求每个的“性价比”,每次取性价比最高的那个,取完就置为0。代码:#include <iostream>#include <cstdio>#include <cstring>#inclu

2016-08-08 15:32:07 506

原创 tempter of the bone(搜索+剪纸)

题意:给出一个图,一个起点,终点,判断在指定时间内是否能从起点到达终点。链接:http://acm.hdu.edu.cn/showproblem.php?pid=1010思路:dfs搜索,但不加剪枝的话会超时,主要一个判断是如果从起点到终点的最短时间都要大于指定时间的话,一定不可以,另外就是从网上参考:如果当前的狗所在的坐标与D的坐标奇偶性不一样,那么狗需要走奇数步。同理,如果狗所在坐标与D的坐标

2016-08-08 09:02:12 305

FileSys.zip

QT实现简单文件浏览器程序,包括一个treeview、tableview和listview,可以按钮控制显示,也可以右键弹出菜单显示,可以打开选中文件(不过要先左键点击该文件)

2020-07-09

mahout-integration-0.7

mahout-integration-0.7mahout-integration-0.7mahout-integration-0.7mahout-integration-0.7

2018-06-06

python连接数据库以及增删改查源码

关于python如何对数据库进行连接、增删改查等操作,来自课程源码

2018-02-06

空空如也

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

TA关注的人

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