- 博客(16)
- 收藏
- 关注
原创 文章标题
最大子列和的四种算法分析 01-复杂度1 最大子列和问题(20 分) 给定K个整数组成的序列{ N1, N2, …, NK},“其中 1≤i≤j≤K。“最大子列和”则被定义为所有连续子列元素的和中最大者。例如给定序列{ -2, 11, -4, 13, -5, -2 },其连续子列{ 11, -4, 13 }有最大的和20。现要求你编写程序,计算给定整数序列的最大子列和。 本题旨在测试各种不同
2017-09-02 17:26:47
284
原创 欢迎使用优快云-markdown编辑器
最大子列和的四种算法分析 01-复杂度1 最大子列和问题(20 分) 给定K个整数组成的序列{ N1, N2, …, NK},“其中 1≤i≤j≤K。“最大子列和”则被定义为所有连续子列元素的和中最大者。例如给定序列{ -2, 11, -4, 13, -5, -2 },其连续子列{ 11, -4, 13 }有最大的和20。现要求你编写程序,计算给定整数序列的最大子列和。 本题旨在测试各种不同
2017-09-02 17:22:41
532
原创 洛谷【1101】单词方阵
给一nXn的字母方阵,内可能蕴含多个“yizhong”单词。单词在方阵中是沿着同一方向连续摆放的。摆放可沿着8个方向的任一方向,同一单词摆放时不再改变方向,单词与单词之间[color=red]可以[/color]交叉,因此有可能共用字母。输出时,将不是单词的字母用“*”代替,以突出显示单词。例如:输入: 8 输出: qyizhong
2017-04-16 11:47:58
552
原创 文章标题
DescriptionProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many compute
2017-04-16 10:53:25
275
原创 POJ1001
DescriptionProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many compute
2017-03-19 19:24:13
369
原创 高精度压位1
#include<cstdio>#include<cstring>#include<iostream>using namespace std;struct sd { int lend,d[300];};void readit(sd &c){ char st[300],st1[300];scanf("%s",st); int k=strlen(st),k1;
2017-03-19 11:57:28
357
原创 高精度基础之乘法格式1
重要的是 c[i+j]=a[i]*b[j]!!!!!!#include<bits/stdc++.h>using namespace std;int main(void) {string s1,s2;cin>>s1>>s2;int a[505],b[505],c[1010];memset(a,0,sizeof(a));memset(b,0,sizeof(b));memset(c,0
2017-03-10 22:01:40
377
3
原创 高精度基础之减法格式1
#include<bits/stdc++.h>using namespace std;int main(void) {string s1,s2;cin>>s1>>s2;int a[505],b[505];memset(a,0,sizeof(a));memset(b,0,sizeof(b));int len1=s1.length();int len2=s2.length();//
2017-03-10 21:28:05
399
1
原创 快速读入
在比赛时,有时cin,和scanf读入想对而言太慢,我们可以自定义入读方式如下//写一个读入数字的函数,检验比单纯写gets()要快int readit() {int s;char t;t=getchar(); while(t<'0'||t>'9') t=getchar(); //过滤非数字 s=t-48; t=getchar(); whil
2017-03-10 09:47:27
449
原创 高精度基础之加法
//模板:#include<cstdio>#include<cstring>using namespace std;struct sd { int lend,d[300]; //长度,存数字的数组 sd(){memset(d,0,sizeof(d));}//初始化操作,清零 //引入一个数与结构体内的数相加 //const表示常数,&x表示传入地址 /
2017-03-10 09:39:51
515
原创 模拟基础之统计字符串中的英文单词数目
题目: 一个单词我们定义为:只有英文字母组成的子串,单词之间用空格(或换行)隔开。给出若干行字符串,请输出单词的个数。 Input: This is a book Sx de2sw endif Ok,hello! Chengdu Tianfu A b err! Output: 10 样例解释: 10个单词是:This,is,a, book,Sx,endif,Chenuu
2017-03-09 19:32:06
540
3
原创 文章标题
1.格式一: Sample Input4 1 2 3 4 5 1 2 3 4 5 0 Sample Output 10 15#include<stdio.h>int main(void) {int n;int num;int sum;while(scanf("%d",&n) == 1 &&n!=0) { sum = 0; while(n--) {
2016-11-26 17:55:47
215
原创 ACM输入格式
1.格式一 Sample Input4 1 2 3 4 5 1 2 3 4 5 0 Sample Output 10 15#include<stdio.h>int main(void) {int n;int num;int sum;while(scanf("%d",&n) == 1 &&n!=0) { sum = 0; while(n--) {
2016-11-26 17:24:21
582
原创 PTA:两个有序链表的合并解题报告
1.题目要求:本题要求实现一个函数,将两个链表表示的递增整数序列合并为一个非递减的整数序列。函数接口定义:List Merge( List L1, List L2 );其中List结构定义如下:typedef struct Node *PtrToNode;struct Node { ElementType Data; /* 存储结点数据 */ PtrToNode Next
2016-10-26 18:47:38
2794
原创 HDUOJ:大数相加3
input:The first line of the input contains an integer T(1<=T<=20) which means the number of test cases. Then T lines follow, each line consists of two positive integers, A and B. Notice that the intege
2016-10-26 18:43:04
368
原创 UVa227:Puzzle
题目名称:谜题题目描述:有一个55的网格,其中恰好有一个格子是空的,其他格子各有一个字母,一共有四种指令:A,B,L,R,分别表示把空格上、下、左、右的相邻字母移到空格中。输入初始网格和指令序列(分别以数字0结束),输出指令执行完毕后的网格。如果有非法指令,应输出”This puzzle has no final configuration.” 1.第一遍理解题意测试程序: 1)没有考虑输出输入
2016-10-26 18:39:44
360
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人