码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
std::map常用方法
mapEmployees;Employees["MikeC."]=12306; Employees.insert(make_pair("PeterQ.",5328));
分类:其他好文   时间:2014-06-10 14:15:43    阅读次数:160
调整数组顺序使奇数位于偶数前面
1.维护两个指针,一个指向第一个 ,向右移动,一个指向最后一个元素,向左移动。当第一个指针指向为偶数,第二个为奇数,就进行交换并移动指针。 注意:当输入为Null或者length=0时候的情况。#include "stdafx.h"#include using namespace std;void ...
分类:其他好文   时间:2014-06-09 21:20:21    阅读次数:224
Codeforces Round #251 (Div. 2) B. Devu, the Dumb Guy
注意数据范围即可#include #include #include using namespace std;int main(){ long long n,x; cin >> n >> x; vector c(n); for(int i = 0 ; i > c[i]; ...
分类:其他好文   时间:2014-06-09 21:17:11    阅读次数:269
poj 3630 Phone List
1 #include 2 #include 3 #include 4 #define N 100005 5 using namespace std; 6 int Trie[N][10]; 7 int nodeN; 8 int main() 9 {10 int t, n, i, j, isPref.....
分类:其他好文   时间:2014-06-09 20:21:04    阅读次数:219
Codeforces Round #251 (Div. 2) C. Devu and Partitioning of the Array
注意p的边界情况,p为0,或者 p为k奇数+偶数 = 奇数奇数+奇数 = 偶数#include #include #include #include #include using namespace std;int main(){ int n,k,p; long a; cin >>...
分类:其他好文   时间:2014-06-09 20:20:23    阅读次数:243
二叉树链式存储结构
二叉链表的C语言描述基本运算的算法——建立二叉链表、先序遍历二叉树、中序遍历二叉树、后序遍历二叉树、后序遍历求二叉树深度#include#includeusing namespace std;class Tree{private: struct Node { char da...
分类:其他好文   时间:2014-06-09 18:39:49    阅读次数:310
逆序单链表
#include using namespace std;struct Node{ Node *next; int elem;};void creatList(Node* &head){ head = new Node; int elem; cin>>elem; ...
分类:其他好文   时间:2014-06-09 17:50:43    阅读次数:219
std::function赋值的几种方法
定义:#include std::function myPrintFunction;函数指针void directPrint(const QString &msg){ qDebug()<<"direct print:"<<msg;}myPrintFunction = directPrint;lamb...
分类:其他好文   时间:2014-06-09 17:41:16    阅读次数:267
Round #169 (Div. 2)C. Little Girl and Maximum Sum
1、用退化的线段树(也就是没有区间查询)做。。。2、注意longlong。#include#include#include#includeusing namespace std;int n,q;int a[200010],s[200010];int main(){ scanf("%d%d",&n,....
分类:其他好文   时间:2014-06-09 17:30:11    阅读次数:227
Codeforces Round #251 (Div. 2) A - Devu, the Singer and Churu, the Joker
水题#include #include #include using namespace std;int main(){ int n,d,t; cin >> n >> d; for(int i = 0 ; i > t; d-=t; } d-=(n-1)*1...
分类:其他好文   时间:2014-06-09 13:05:02    阅读次数:198
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!