码迷,mamicode.com
首页 >  
搜索关键字:int-max    ( 1549个结果
c++ 模板类不能分离编译
在.h文件中必须同时有模板的声明和明确的定义,不能在.cpp中却定义。 1 #ifndef STACKTP_H_ 2 #define STACKTP_H_ 3 template <class Type, int MAX> 4 class Stack 5 { 6 private: 7 Type ite ...
分类:编程语言   时间:2021-01-12 10:36:55    阅读次数:0
kotlin基础语法
Val:用来声明图个不可变的变量, Var:用来声明图个可变的变量 Kotlin没有基本数据类型 语法糖 当函数(方法)只有一行是Kotlin允许不写函数体可以直接将唯一的一行代码第一在函数尾部。利用类推导机制进一步简化。 fun a(num:Int,num1:Int):Int = max(num, ...
分类:其他好文   时间:2021-01-08 10:40:20    阅读次数:0
函数调用-如何设计参数 可变参数函数
#include<stdio.h> int max(int a, int b)//形参 { return a > b ? a : b; } int main() { int x, y; scanf("%d%d", &x, &y); printf("%d", max(x, y));//实际参数 ret ...
分类:其他好文   时间:2021-01-04 10:39:27    阅读次数:0
完全平方数
复习bfs 这题我们用bfs 做 class Solution { public: int numSquares(int n) { queue <int> q; vector <int> dist(n+1,INT_MAX); q.push(0); dist[0] = 0; while(q.size( ...
分类:其他好文   时间:2020-12-21 12:01:05    阅读次数:0
C语言数组的最值查找
#include <stdio.h>#include <stdlib.h> int main(){ int add[] = { 1,256,12,621,62,3462,6,89999,87}; int Max=add[0]; int Mini; for (int x = 0; x < g; x++ ...
分类:编程语言   时间:2020-12-15 12:25:59    阅读次数:5
test
C++ 内联函数 #include <iostream> using namespace std; inline int Max(int a, int b) { if (a > b) return a; else return b; } int main() { cout << Max(23, 5) ...
分类:其他好文   时间:2020-11-25 12:08:44    阅读次数:2
C++内联函数
@(C++内联函数) #include <iostream> using namespace std; inline int Max(int a, int b) { if (a > b) return a; else return b; } int main() { cout << Max(23, ...
分类:编程语言   时间:2020-11-21 12:39:21    阅读次数:17
剑指 Offer 59 - I. 滑动窗口的最大值
思路 方法一:暴力法 遍历每一个数nums[i],之后在[i, i+k]中顺序寻找最大值。 时间复杂度:O(k*n) 1 class Solution { 2 public: 3 vector<int> maxSlidingWindow(vector<int>& nums, int k) { 4 i ...
分类:其他好文   时间:2020-11-19 12:32:53    阅读次数:6
Lhs和Rhs的含义
今天在读《数据结构与算法分析C语言描述》的 AVL 源码时,读到一段程序: static int Max(int Lhs, int Rhs) { return Lhs > Rhs ? Lhs : Rhs; } 其实就是返回两个数中较大的那个值,但是我想知道 Lhs 和 Rhs 具体是哪些单词的缩写, ...
分类:其他好文   时间:2020-10-16 11:29:40    阅读次数:76
201312-3(O(n)算法)
#include <bits/stdc++.h> using namespace std; //不是递增的话就删掉,然后重新计算一次 int getMaxArea(vector<int> &vec) { stack<int> s; int max_area = 0; int i=0; int tp, ...
分类:编程语言   时间:2020-09-24 21:38:31    阅读次数:46
1549条   上一页 1 2 3 4 ... 155 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!