码迷,mamicode.com
首页 >  
搜索关键字:int-max    ( 1549个结果
关于对 softirq、work_queue、tasklet 学习后的一点总结
本文基于linux版本:4.14.111 简单的总结下 softirq、work_queue、tasklet 三种中断下半部的工作原理及区别,并附上三种形式的简单实例。 一、运行原理① softirq: void __do_softirq(void) { int max_restart = MAX_ ...
分类:其他好文   时间:2020-02-24 22:26:48    阅读次数:104
1030 完美数列
two pointers通向扫描法。 #include<iostream> #include<algorithm> using namespace std; typedef long long LL; LL a[100010] = {0}; int main() { int n,p,max = -1 ...
分类:其他好文   时间:2020-02-18 13:04:59    阅读次数:49
c++ 一个有十个整数元素的数组(17 85 67 83 65 49 26 92 38 42),编写一个程序找出其中的最大数和其下标,并在主函数中打印最大数和相应下标
// 5-1 找数组最大值及下标#include<iostream> using namespace std; int main() { int a[10]={17,85,67,83,49,26,92,38,42}; int max,num=0; max=a[0]; for(int i=0;i<10 ...
分类:编程语言   时间:2020-02-16 15:02:31    阅读次数:114
模板 - 图论 - 最近公共祖先 - 倍增算法 - LCA
```cpp const int MAX = 100000; vector G[MAXN + 5]; int dep[MAXN + 5], fa[MAXN + 5][20 + 1]; void dfs(int u, int p) { dep[u] = depth[p] + 1; fa[u][0] =... ...
分类:编程语言   时间:2020-02-16 12:55:01    阅读次数:72
摸索第一篇
用函数找较大的值: //用函数输出两个数中较大的数 #include<stdio.h>int max(int a,int b);int main(){ int a,b; scanf("%d %d",&a,&b); printf("较大的那个数是%d",max(a,b)); return 0;} in ...
分类:其他好文   时间:2020-02-15 13:15:26    阅读次数:52
LeetCode——456.132模式
给定一个整数序列:a1, a2, ..., an,一个132模式的子序列 ai, aj, ak 被定义为:当 i & nums) { int n = nums.size(), mn = INT_MAX; for (int j = 0; j j; k) { if (mn nums[k]) return ...
分类:其他好文   时间:2020-02-14 16:43:27    阅读次数:40
使用HashMap或Hashset优化使用循环判断字符串中是否含有重复元素
原本遇到判断字符串中是否含有重复元素的问题总是使用for循环遍历进行判断,这一方法则需要O(n3)的时间复杂度,如果本身方法处于几个循环中,就会指数倍增加时间复杂度。类似于如下代码: String[] a = s.split(""); int max = 1; for(int i = 0; i < ...
分类:其他好文   时间:2020-02-13 18:53:02    阅读次数:100
A Simple Problem with Integers
这是一道简单应用线段树的题 代码也是书上的,敲一边熟悉一下 #include <iostream>#include <cstdio>using namespace std;const int MAX=1e5+10;long long sum[MAX<<2],add[MAX<<2]; void up_ ...
分类:其他好文   时间:2020-02-11 19:07:08    阅读次数:53
选数问题
选数问题 1. 在一个长度为n的k数组中,选出4个数,使其和为m。如果存在,输出yes;否则,输出no。 1. O(n^4)的解法 ...
分类:其他好文   时间:2020-02-10 14:10:44    阅读次数:85
有一个3*4的矩阵,要求编程序求出其中值最大的那个元素的值,以及其所在的行号和列号
#include "stdio.h" void main() { int a[3][4]={{65,48,78,90},{78,92,45,66},{77,44,66,55}}; int i,j,max=a[0][0],row,colum; for(i=0;i<3;i++) { for(j=0;j< ...
分类:其他好文   时间:2020-02-06 12:26:21    阅读次数:436
1549条   上一页 1 ... 8 9 10 11 12 ... 155 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!