1 class TopVotedCandidate 2 { 3 public: 4 vector> List; 5 TopVotedCandidate(vector persons, vector times) 6 { 7 map m; 8 int max_count = 0;... ...
分类:
其他好文 时间:
2018-09-23 13:42:01
阅读次数:
361
``` include include using namespace std; int max(int a,int b){ return a b ? a: b; } int main() { int ( func)(int,int); func = max; int a = 10,b=11; co ...
分类:
编程语言 时间:
2018-09-22 18:21:42
阅读次数:
157
public static int MaxLengthSubSequence(String str1, String str2){ int max = 0; int n1 = str1.length(); int n2 = str2.length(); if(str1!=null && str2!=... ...
分类:
其他好文 时间:
2018-09-21 20:51:17
阅读次数:
159
class Solution { public: int removeDuplicates(vector& nums) { int res = 0; nums.push_back(INT_MAX); //注意末尾的补位 for(int i=0;i < nums.size()-1;i++){ if(n... ...
分类:
其他好文 时间:
2018-09-18 11:14:55
阅读次数:
117
class Base { static const int max_bit = 32; // 注意 使用的时候要减一 int base[max_bit]; public : void init() { memset(base, 0, sizeof(base)); } void insert(int ... ...
分类:
其他好文 时间:
2018-09-09 21:06:31
阅读次数:
175
容斥+状压 #include<bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9+7; #include<vector> //const int MAX = 110; const int N = 1 ...
分类:
其他好文 时间:
2018-09-08 23:32:53
阅读次数:
284
-pow( x , y )函数:计算xy,想算多大算多大 例:pow(2,100) 1267650600228229401496703205376 浮点数运算存在不确定尾数,不是bug 例: 0.1 + 0.2 0.30000000000000004 不确定尾数 -round( x , d ) :对 ...
分类:
编程语言 时间:
2018-09-07 11:04:48
阅读次数:
140
关于KMP入门,可以参考:KMP入门。 另外附上我自己的KMP代码: 圆满完成。 ...
分类:
编程语言 时间:
2018-09-05 08:54:16
阅读次数:
159
因为是x,y均为整数因此对于同一直线的点,其最简分数x/y是相同的(y可以为0,这里不做除法)于是将这些点不断求最简分数用pair在set中去重即可。 ...
分类:
其他好文 时间:
2018-09-04 23:29:50
阅读次数:
170
#include<bits/stdc++.h> using namespace std; #define Max 100 #define INF 0x3f3f3f3f int M[Max][Max]; int n,m; void prim() { int u,minv; int d[Max],p[M ...
分类:
其他好文 时间:
2018-09-01 12:08:40
阅读次数:
112