实践题目名称: 最大子列和问题 问题描述: 给定K个整数组成的序列{ N?1??, N?2??, ..., N?K?? },“连续子列”被定义为{ N?i??, N?i+1??, ..., N?j?? },其中 1。“最大子列和”则被定义为所有连续子列元素的和中最大者。例如给定序列{ -2, 11, ...
分类:
编程语言 时间:
2020-11-11 16:10:57
阅读次数:
54
题目链接 题意 给出一个长度为 n 的方块区间[1,n],现在要对这个方块区间染色,有两种要求: 格式:l, r, k。表示区间[l,r]里至少有 k 个方块被染色 格式:l, r, k。表示区间[l,r]之外至少有 k 个方块被染色。 现在给出 n, m1, m2,分别表示有 n 个方块,m1 个 ...
分类:
其他好文 时间:
2020-11-11 16:09:29
阅读次数:
4
以下是main函数最开始的两段,也是cocos2d一开始执行的地方: AppDelegate app; return Application::getInstance()->run(); 接下来用代码对以上函数进行简单复原: #include<iostream> #include<assert.h> ...
分类:
其他好文 时间:
2020-11-11 16:08:51
阅读次数:
4
数组不完全初始化:后面五个值默认为零#define_CRT_SECURE_NO_WARNINGS#include<stdio.h>intmain(){intarr[10]={1,2,3,4,5};//不完全初始化,后面五个值默认为零return0;}intmain(){chararr[10]={"a","b","c"};//不
分类:
其他好文 时间:
2020-11-11 16:03:36
阅读次数:
4
###P2915 [USACO08NOV]Mixed Up Cows G dfs去做 #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #define ll long long using namespace ...
分类:
其他好文 时间:
2020-11-11 15:59:42
阅读次数:
7
首先题目要求最后字典序最小的,而且只包含小写字母,因此显而易见像a,b这样的字符越在前面越好。 考虑贪心。 枚举这个字符串的每一个位置,然后再枚举小写字母a ~ z,能换则换,就是尽量将字典序最小的换到最前面,或者退而求其次。 code: 1 #include <bits/stdc++.h> 2 # ...
分类:
其他好文 时间:
2020-11-11 15:54:21
阅读次数:
8
#include <stdio.h> #include <stdlib.h> typedef struct node {int x; struct node *next; }NODE; NODE *padd(NODE *pa) { NODE *p1,*p2,*p; p1=p2=pa; while(p ...
分类:
其他好文 时间:
2020-11-10 11:42:48
阅读次数:
24
Docker--consule-Nginx群集负载均衡&harbor
分类:
其他好文 时间:
2020-11-10 11:25:37
阅读次数:
6
题目 1054: [二级C语言]计算素数和 #include <stdio.h> #include <math.h> int isprime(int x)//判断素数,返回1表示x为素数 { if(x==1)return 1; int i,emp=sqrt(x); for(i=2;i<=emp;++ ...
分类:
其他好文 时间:
2020-11-10 11:16:27
阅读次数:
6
1 #include<iostream> 2 #include<algorithm> 3 using namespace std; 4 5 const int N=1010; 6 7 int dp[N][N]; 8 int w[N],v[N]; 9 int n,m; 10 11 int main() ...
分类:
其他好文 时间:
2020-11-10 10:43:32
阅读次数:
7