码迷,mamicode.com
首页 >  
搜索关键字:int-max    ( 1549个结果
【模板】快速排序
1 int n; 2 int a[MAX_N]; 3 4 void Quick_Sort(int lt, int rt) 5 { 6 int key = a[lt + rt >> 1]; 7 int i = lt, j = rt; 8 while(i key) --j; 12 if(i <= j) ... ...
分类:编程语言   时间:2018-11-25 14:40:11    阅读次数:144
【模板】欧拉筛法(线性筛法)
1 int n; 2 int p[MAX_N], cnt; 3 bool b[MAX_N]; 4 5 void Euler() 6 { 7 b[0] = b[1] = 1; 8 for(register int i = 2; i 0, j + k < cnt)]的情况一定会被后面给筛掉 17 } 1... ...
分类:其他好文   时间:2018-11-25 14:31:50    阅读次数:253
运用递归求字符串最大重复数
void MaxLengthCore(char *cur,char *pre,int *max,int cursum) { if(*cur == '\0') return ; if(pre !=NULL && *cur == *pre) { ++cursum; if(cursum > *max) *... ...
分类:其他好文   时间:2018-11-24 21:03:47    阅读次数:246
043_面向对象_16_修饰变量
一、final关键字的用法 1.final修饰变量:被final修饰的变量不可改变。即初始化一次后,就不能再次被赋值!即,变为常量!如、final int MAX_VALUE=200;那么以后程序就不能改变MAX_VALUE的值。 2.final修饰方法:被final修饰的方法不能被子类重写。 3. ...
分类:其他好文   时间:2018-11-17 10:26:37    阅读次数:196
tmp_code
bool cmpX(vector a,vector b) { return a[0] a, vector b) { return a[1]>& points) { int ret = INT_MAX; for (int i = 0; i > getxs; vector > getys; //得到X值... ...
分类:其他好文   时间:2018-11-11 12:50:45    阅读次数:167
高精度模板
包括$+,-,*$操作,适用于非负整数 减法只能大减小 并没有压位 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 #define N 250002 6 int max(int ...
分类:其他好文   时间:2018-11-09 00:00:28    阅读次数:196
数组和函数
1. 数组作为参数 python include const int Max = 5; int fill_array(double ar[], int limit); void show_array(const double ar[], int n); void revalue(double r, ...
分类:编程语言   时间:2018-11-06 23:33:19    阅读次数:230
Codeforces Round #519
题目链接:传送门 A. Elections (思维+暴力) 思路: 从最小的k开始枚举就好了- -。 #include <bits/stdc++.h> using namespace std; const int MAX_N = 100 + 5; int a[MAX_N]; int main() { ...
分类:其他好文   时间:2018-11-06 19:26:17    阅读次数:135
C语言--查询数组中出现次数最多的元素
查询数组中出现次数最多的元素#include #include #include int max_count_num(int * arr, int len);int main(){ int arr[5] = {1, 1, 1, 3, 1 }; max_count_num(arr, 5); retur... ...
分类:编程语言   时间:2018-11-05 21:56:16    阅读次数:545
Python教程5
Python教程5 1.公共方法 2.综合应用 ...
分类:编程语言   时间:2018-11-03 02:08:35    阅读次数:213
1549条   上一页 1 ... 24 25 26 27 28 ... 155 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!