简单演示一下如何使用线程池 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
题目链接 #解题思路 询问区间小于某个数个个数显然可以用二分来做,但是如果配合上区间加法就有些复杂了。即使对每个区间排序,用标记来代替修改,但是对于边缘的数据来说,需要暴力修改,而暴力修改后打破区间的有序性。那就暴力修改之后再重新排序~~(没错,就是这么狠(笑~~ #代码 const int max ...
分类:
其他好文 时间:
2020-07-22 11:22:40
阅读次数:
54
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
图的带权邻接矩阵存储 源程序: #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)猜想 写后总结:数字与字母相乘,乘法不能省略;注意局部变量的位置;别光写算法,把"输出"忘记写.这是一个部分正确的,原因是什么?#include<iostream> using namespace std; int main() { //int max=1000; ...
分类:
其他好文 时间:
2020-07-11 22:48:36
阅读次数:
51
暴力解法很容易: /** * @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
#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
方法一: 整数值越界后符号改变 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
记忆化递归: 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