自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

ZXLS-ZMR的专栏

足迹, 学路漫漫,吾将上下而求索。

  • 博客(14)
  • 资源 (2)
  • 收藏
  • 关注

原创 CF-374B

分析:寻找连续满足和为9的序列,给据组合原理,就可得到答案。#include#include#includeusing namespace std ;char st[100005];int main(){ __int64 ans,t; int d; while(scanf("%s",st)!=EOF){ int len=strlen(st); ans=1;

2013-12-31 19:16:47 725

原创 CF-379C

题意:在给定的序列中使得原来有相同的元素调整为全不相同,并且使得改变的序列和最少,还要满足每个人的要求。#include#include#include#includeusing namespace std ;struct node{ __int64 num; int id;}a[300005];__int64 b[300005];bool cmp(node a,node

2013-12-31 19:11:46 1105 1

原创 CF-375A Divisible by Seven

只要想到了就很容易了,由于7是个素数,它的余数0~6,那么我们只需要把1,6,8,9,前面不过多小数,其余数必定在(0~6),所以任意排序(1,6,8,9)满足加上(0~6)的余数能被7整除就行了,这就靠自己与凑了。#include#include#includeusing namespace std ;int cnt[10];const int num[]={1869,1896

2013-12-27 18:14:09 1013

原创 航班信息检索与查询(基数排序)

花了一周的时间搞数据结构课程设计,现在想起来也不咋样。 航班信息检索与查询系统源代码在”StdAfx.h”文件中:#if !defined(AFX_STDAFX_H__5D4863DA_370E_4BF2_ACA1_DEF9B55C465C__INCLUDED_)#define AFX_STDAFX_H__5D4863DA_370E_4BF2_ACA

2013-12-27 18:06:25 3404

原创 CF-373B

题意很简单,注意别爆内存。#include#include#includetypedef __int64 LL;using namespace std ;int main(){ LL w,m,k,n1,n; while(scanf("%I64d %I64d %I64d",&w,&m,&k)!=EOF){ n1=1; n=m; LL r=0,ans=0;

2013-12-14 20:22:15 711

原创 SOJ-4310 Sum of product

这题很容易想到用三层循环,但很明显超时,所以要优化。s1=a[n](a[n-1]*(a[n-2]+........a[1])+a[n-2]*(a[n-3]+......a[1])+.......a[2]*a[1])s2=a[n-2](a[n-2]*(a[n-3]+....a[1])+a[n-3]*(a[n-4]+.......a[1])+.......a[2]*a[1]).......

2013-12-03 19:27:06 810

原创 SOJ-4309 Sum of xor

由n^(n+1)=1,n为偶数即可分类求得。1^1=0,0^1=1,0^0=0,异或满足交换律。#include#include#includetypedef long long LL;using namespace std ;LL get_ans(LL n){ if(n&1) return (n-1)%4==0?1:0; return (n-2)%4==0?

2013-12-03 19:09:03 879

原创 HDU 4207 And SOJ 4198 Grade School Multiplication

模拟乘法,注意格式,在HDU,G++提交用__int64 在SOJ用long long型提交,这个把我坑了,格式也很坑。#include #includetypedef __int64 LL;using namespace std;int get_digit(LL n){ int k=0; if(n==0) return 1; while(n){

2013-12-03 14:52:09 890

原创 UVA-1330 LA 3029 City Game(最大子矩阵)

题意:在m*n的矩阵中,其中一些是空格子用(F)表示,其他的是阻碍物(R),找出一个全部由F组成面积最大的,输出面积乘以3.分析:用数组up[i][j]从第i行到第j行所能达到最大的长度,lt[i][j]表示第i行的第j列向右所能达到的长度,同理rt[i][j]。#include#include#includeusing namespace std ;const int M=10

2013-12-02 18:23:07 852

原创 HDU-1559最大子矩阵

方法:先将x个行压缩成一行,然后再求连续y个最大子序和。数据范围不是1000,真坑。#include#include#includetypedef __int64 LL;using namespace std ;const int N=2005;int a[N][N];LL b[N];LL Maxsum(int n,int k,LL *s){ LL ans=0; f

2013-12-02 15:37:30 636

原创 UVA-11549 Calculator Conundrum

题意:计算器只能显示n位的数字,但是一个数的继续平方,将会超出n位,如果一个数k继续平方,它将最多显示n位,并把后面的数字舍去,问这样下去显示最大的数是多小。分析:此题暗示了数会出现循环。所以可以模拟,当有循环出现就退出。#include#include#include#include#includetypedef long long LL;using namespace st

2013-12-01 19:13:42 742

原创 SOJ-Dollars

New Zealand currency consists of $100, $50, $20, $10, and $5 notes and $2, $1, 50c, 20c, 10c and 5c coins. Write a program that will determine, for any given amount, in how many ways that amount may b

2013-12-01 19:00:48 664

原创 SOJ-最大整数

这题看起来好像是字典序排序,其实这样是错误的。正确的做法是:每个都比较一次,按两种情况枚举,比如:117 71. ->11771,或者,71117,哪一种结果更好就行了。#include#include#include#includeusing namespace std ;string num[8];bool cmp(string a,string b){ strin

2013-12-01 18:52:18 721

原创 SOJ-3281 hm与zx的故事系列3

这题我认为出的很好,有种看似容易,做起来却好纠结的。解题出发点:只要存在一个数它的位置靠前且比后面的一个数大,那么后面的这个数就没必要去比较了。还有一个技巧是:从后面循环,用栈来维护当前的递减序列,解决这个问题。不过如果是从前面开始,这题就不好做了。好好去体会。[cpp] view plaincopyprint?#include  

2013-12-01 18:41:12 1171

学生成绩管理系统

该学生成绩管理系统,功能比较齐全,对于初学者,是涵盖c语言的所有知识。

2013-03-08

插入排序.cpp

是关于插入排序的c语言源代码。代码简单,易懂。非常适合刚学的读者。

2013-03-08

空空如也

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

TA关注的人

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