码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
[LeetCode] 1031. Maximum Sum of Two Non-Overlapping Subarrays 两个不重叠的子数组的最大和
Given an array of non negative integers, return the maximum sum of elements in two non overlapping (contiguous) subarrays, which have lengths and . (F ...
分类:移动开发   时间:2021-02-18 12:53:23    阅读次数:0
1028 List Sorting (25 分)
大水题。。。 const int N=1e5+10; struct Node { string id; string name; int grade; }a[N]; int n,m; bool cmp1(Node &a,Node &b) { return a.id < b.id; } bool cm ...
分类:其他好文   时间:2021-02-17 15:07:19    阅读次数:0
约数的个数
试除法求约数个数。 int n; int divisor(int n) { int res=0; for(int i=1;i*i<=n;i++) if(n % i == 0) { res++; if(i != n/i) res++; } return res; } int main() { whil ...
分类:其他好文   时间:2021-02-17 14:14:28    阅读次数:0
完数与盈数
试除法求约数。 int check(int n) { int res=1; for(int i=2;i*i<=n;i++) if(n % i == 0) { res+=i; if(i != n/i) res+=n/i; } return res; } int main() { vector<int> ...
分类:其他好文   时间:2021-02-17 14:12:57    阅读次数:0
Flask入门
1. 创建flask框架主程序 名字可以是app.py/run.py/main.py/index.py from flask import Flask app = Flask(__name__) @app.route('/') def index(): return 'Hello World' if ...
分类:其他好文   时间:2021-02-17 14:07:44    阅读次数:0
AtCoder Beginner Contest 120
A - Favorite Sound #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int main(){ int a, b, c; cin >> a >> b >> ...
分类:其他好文   时间:2021-02-16 12:44:42    阅读次数:0
Smart Pointers
A pointer is a general concept for a variable contains an address in memory. Smart pointers are data structures that not only act like a pointer but a ...
分类:其他好文   时间:2021-02-16 12:42:23    阅读次数:0
python函数的基础知识
一、 函数的定义 用一个名字来封装具有某种功能的代码块 二、函数的特性 减少重复 方便修改 保持代码一致性 三、函数的格式 封装格式 1 def 函数名(参数列表) 2 代码块 3 return 返回值 调用格式 函数名(参数) 注意:无需传入参数时,参数可不用填写 四、参数类型 注意:封装时参数放 ...
分类:编程语言   时间:2021-02-16 12:37:03    阅读次数:0
2021-02-12:如何判断两个字符串是否互为旋转字符串?
2021-02-12:如何判断两个字符串是否互为旋转字符串? 福哥答案2021-02-12: 假设字符串str1是“ABCDE”,字符串str2是“CDEAB”。字符串str2可以拆分成“CDE”和“AB”,可以拼成“ABCDE”。所以str1和str2互为旋转字符串。 解法:1.判断str1和st ...
分类:其他好文   时间:2021-02-16 12:18:04    阅读次数:0
剑指 Offer 58 - II. 左旋转字符串
题意 把字符串前面的若干个字符转移到字符串的尾部,要求只用一个函数实现 思路 利用线性代数中的矩阵求逆的思想:\((AB)^{-1} = B^{-1}A^{-1}\) 定义一个函数reverse(s, l, r),将字符串s的[l, r]区间内的元素逆置,比如abc变为cba,这个reverse() ...
分类:其他好文   时间:2021-02-16 12:14:14    阅读次数:0
60766条   上一页 1 ... 67 68 69 70 71 ... 6077 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!