码迷,mamicode.com
首页 >  
搜索关键字:int-max    ( 1549个结果
线程池最佳实践
简单演示一下如何使用线程池 private static final int CORE_POOL_SIZE = 5; private static final int MAX_POOL_SIZE = 10; private static final int QUEUE_CAPACITY = 100; ...
分类:编程语言   时间:2020-07-25 23:36:18    阅读次数:83
LibreOJ 6278 数列分块入门 2(分块区间加法,二分)
题目链接 #解题思路 询问区间小于某个数个个数显然可以用二分来做,但是如果配合上区间加法就有些复杂了。即使对每个区间排序,用标记来代替修改,但是对于边缘的数据来说,需要暴力修改,而暴力修改后打破区间的有序性。那就暴力修改之后再重新排序~~(没错,就是这么狠(笑~~ #代码 const int max ...
分类:其他好文   时间:2020-07-22 11:22:40    阅读次数:54
P1036 选数
https://www.luogu.com.cn/problem/P1036 方法二:二进制枚举+素数筛 1 #include<bits/stdc++.h> 2 using namespace std; 3 int a[25]; 4 const int max_n=10000005; 5 int b ...
分类:其他好文   时间:2020-07-15 01:26:17    阅读次数:76
实践5.2
图的带权邻接矩阵存储 源程序: #include <stdio.h>#include <stdlib.h>#define VNUM 20const int MAX_INT=0; //图的类型定义typedef struct gp{ char vexs[VNUM]; int arcs[VNUM][VN ...
分类:其他好文   时间:2020-07-12 16:30:10    阅读次数:54
1001 害死人不偿命的(3n+1)猜想 (15分)
1001 害死人不偿命的(3n+1)猜想 写后总结:数字与字母相乘,乘法不能省略;注意局部变量的位置;别光写算法,把"输出"忘记写.这是一个部分正确的,原因是什么?#include<iostream> using namespace std; int main() { //int max=1000; ...
分类:其他好文   时间:2020-07-11 22:48:36    阅读次数:51
Leetcode 11 盛水最多的容器 贪心算法
暴力解法很容易: /** * @Author Niuxy * @Date 2020/7/9 9:49 下午 * @Description 暴力解法 */ public final int maxArea0(int[] height) { int max = 0; for (int i = 0; i ...
分类:编程语言   时间:2020-07-10 00:14:45    阅读次数:71
HDU 最短路
#include<iostream> #define INF 200000 using namespace std; int max(int a,int b){return a>b?a:b;} int min(int a,int b){return a<b?a:b;} int map[1002][1 ...
分类:其他好文   时间:2020-07-05 15:43:32    阅读次数:47
C计算int最大值、最小值
方法一: 整数值越界后符号改变 int i = 0, max, min; while(1) { if(i + 1 <= 0) { max = i; min = i + 1; break; } i++; } printf("int最大值%d,最小值%d\n", max, min); 方法二: 0(un ...
分类:其他好文   时间:2020-07-04 22:32:08    阅读次数:69
输入两个整数,要求输出其中较大者。用函数来找到大数
#include <stdio.h>int main(){ int max(int x,int y); int a,b,c; printf("Please input two data:\n"); scanf("%d%d",&a,&b); c=max(a,b); printf("max is :%d ...
分类:其他好文   时间:2020-06-29 17:05:39    阅读次数:202
Leetcode 873 最长斐波那契子序列 记忆化递归与剪枝DP
记忆化递归: int max = 0; public int lenLongestFibSubseq(int[] A) { int[][] cache = new int[A.length][A.length]; for (int i = 0; i < A.length - 1; i++) { fo ...
分类:其他好文   时间:2020-06-29 00:17:42    阅读次数:57
1549条   上一页 1 2 3 4 5 6 ... 155 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!