码迷,mamicode.com
首页 >  
搜索关键字:using    ( 53562个结果
714 - Copying Books(二分)
该题是所谓“最大值尽量小”的典型代表,方法就是用二分猜这个最值,判断函数就是从前向后扫,尽量向后划,如果最后划出的组数比k小,那么显然可以划成k组。 代码如下: #include using namespace std; typedef long long ll; int T,n,k,a[505]; bool P(int m) { int ans=0,cnt=1; for(in...
分类:其他好文   时间:2015-07-03 19:14:32    阅读次数:83
浅谈C#中const、static readonly区别
const编译时常量static readonly运行时常量直接上代码1.新建一个类库BLL->添加类Teacher 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Tex...
分类:Windows程序   时间:2015-07-03 19:06:46    阅读次数:127
Test
C#using System;#pragma warning disable 414, 3021public class Program{ /// The entry point to the program. public static int Main(string[] args) ...
分类:其他好文   时间:2015-07-03 19:06:46    阅读次数:98
Vector的相关知识
1.vector是动态空间,支持高效的随机访问和高效向尾部插入新元素的容器。随着元素的插入,它的内部机制会自行扩充空间以容纳新元素。那么vector会以怎样的方式扩充空间呢?#include #include using namespace std;int main(){ vector vec...
分类:其他好文   时间:2015-07-03 18:40:10    阅读次数:122
poj1330 LCA 屯个模板
//给一棵树,最后问两个点的lca是谁。 #include #include #include #include #include #include using namespace std; const int maxn=10005; struct node{ int v,next; }; node edge[maxn]; int head[maxn],cnt; void add(in...
分类:其他好文   时间:2015-07-03 17:35:04    阅读次数:144
Trie树
翻译自topcoder中的一篇文章:https://www.topcoder.com/community/data-science/data-science-tutorials/using-tries/简介有很多种算法和数据结构可以用来在文本中建立字符串的索引和对字符串进行查找,一些已经被包含在了标准库中,一些还没有。Trie这种数据结构是一个还没有被包含在标准库中的一个很好的例子。假设word表示...
分类:其他好文   时间:2015-07-03 17:34:54    阅读次数:129
计蒜客 15 map遍历
#include #include #include #include using namespace std; int main() { mapq; int n,x; scanf("%d",&n); while(n--) { scanf("%d",&x); if(q.count(x)) q[x]++; ...
分类:其他好文   时间:2015-07-03 17:32:35    阅读次数:131
C++字符串操作笔试题第二波
//1.字符串替换空格:请实现一个函数,把字符串中的每个空格替换成“%20”。 //例如输入“we are happy.”,则输出“we%20are%20happy.”。 #include #include #include using namespace std;char* Grial(char *s) { assert(s...
分类:编程语言   时间:2015-07-03 17:31:14    阅读次数:170
C# 如何使用程序添加查询和编辑resx文件(资源文件)
在C#项目中难免用到资源文件(以resx结尾的文件)读取和添加的方法:在项目中首先要引用命名空间using System.Resources;string respath=@".\Resources1.resx";//给资源文件中写入字符串using(ResXResourceWriter resx=...
分类:Windows程序   时间:2015-07-03 17:23:51    阅读次数:149
mongodb 更新数组出现can't append to array using string field name
数据库内容大概如下:{_id:1,"hero_list" : { "15521" : { "stars" : 0, "_id" : 15521, ...
分类:移动开发   时间:2015-07-03 15:38:02    阅读次数:221
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!