码迷,mamicode.com
首页 >  
搜索关键字:int-max    ( 1549个结果
C++优先队列例子
#pragma GCC optimize(3) #include #define N 105 using namespace std; struct Node{ long long x; int Max; bitset avl,vis; friend bool operator r.x; } }; ... ...
分类:编程语言   时间:2019-07-22 13:01:12    阅读次数:142
random随机数
公式:假设你要产生5到10之间的随机数,可以用下面方法:int Min = 5;int Max = 10;int result = Min + (int)(Math.random() * ((Max - Min) + 1)); 例如:int randNum = rand.nextInt(3);生成5 ...
分类:其他好文   时间:2019-07-18 19:54:36    阅读次数:115
java生产者消费者模型
package javalearn; import java.util.LinkedList; import java.util.Queue; public class ProducerConsumer { private static final int MAX = 5; ////////////... ...
分类:编程语言   时间:2019-07-15 12:01:51    阅读次数:117
[LeetCode] 124. 二叉树中的最大路径和
题目链接 : https://leetcode cn.com/problems/binary tree maximum path sum/ 题目描述: 给定一个 非空 二叉树,返回其最大路径和。 本题中,路径被定义为一条从树中任意节点出发,达到任意节点的序列。该路径 至少包含一个 节点,且不一定经过 ...
分类:其他好文   时间:2019-07-11 20:25:49    阅读次数:84
[网络流]
先抄个模板 EK: 1 const int MAXN = 430; 2 const int MAX_INT = (1 << 30); 3 4 struct Edge{ 5 int v, nxt, w; 6 }; 7 8 struct Node{ 9 int v, id; 10 }; 11 12 in ...
分类:其他好文   时间:2019-07-11 10:00:06    阅读次数:118
C算法--函数
1 #include <stdio.h> 2 3 int max_2(int a,int b){ 4 if(a>b) return a; 5 else return b; 6 } 7 8 /*在max_3中调用max_2比较大小*/ 9 int max_3(int a,int b,int c){ 1 ...
分类:编程语言   时间:2019-07-05 09:31:07    阅读次数:100
查找最大数、排序、矩阵等
例1 寻找最大数 #include <stdio.h> main() { int i,max,a[]={4,8,1,3,6,9,10,2}; max=a[0]; for(i=1;i<8;i++) { if ( a[i]>max) max=a[i]; } printf("\max=%d\n",max) ...
分类:编程语言   时间:2019-07-01 14:00:23    阅读次数:78
5.3
#include <stdio.h>int max(int a,int b){ if(a>b) return a; else return b;}int main(){ int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d); printf("%d\n",max(max ...
分类:其他好文   时间:2019-06-23 14:19:04    阅读次数:96
实验四
#include <stdio.h>/*void select_sort(int a[],int n) { for(int i=0; i<n-1; i++) { int max_index = i; for(int j=i+1; j<n; j++) { if(a[j] > a[max_index]) ...
分类:其他好文   时间:2019-06-20 12:59:59    阅读次数:82
一本通 1275:【例9.19】乘积最大
"乘积最大(数据弱化版)" ps:本题无需使用大整数。 Code: c++ include include include using namespace std; //Mystery_Sky // define INF 0x3f3f3f3f define M 500 int f_max[M][M] ...
分类:其他好文   时间:2019-06-14 21:50:21    阅读次数:154
1549条   上一页 1 ... 17 18 19 20 21 ... 155 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!