码迷,mamicode.com
首页 >  
搜索关键字:using password: yes    ( 53562个结果
调整数组顺序使奇数位于偶数前面
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
读取Excel文件中的单元格的内容和颜色
读取Excel文件中的单元格的内容和颜色先创建一个Excel文件,在A1和A2中随意输入内容,设置A1的字体颜色为红色,A2的背景为黄色。需要 using Excel = Microsoft.Office.Interop.Excel;或者using Microsoft.Excel; ...
分类:其他好文   时间:2014-06-09 21:04:42    阅读次数:261
[LeetCode] Sort List
Sort a linked list in O(n log n) time using constant space complexity.一谈到时间复杂度O(nlogn),立即联想到以下3种排序方法:1.归并排序(基于分治):时间复杂度O(nlogn),归并排序的最好、平均、最坏时间复杂度没有差别...
分类:其他好文   时间:2014-06-09 20:37:31    阅读次数:244
不带头结点的单链表递归删除元素为X的结点
#include using namespace std;struct Node{ Node *next; int elem;};void creatList(Node* &head){ head = new Node; int elem; cin>>elem; ...
分类:其他好文   时间:2014-06-09 16:07:55    阅读次数:229
打印出从1到最大的n位十进制数
首先这一题会溢出,要考虑的大数问题。所以不能用简单的是int类型数来表示(32位无符号int 范围是0x00000000···0xFFFFFFFF),下面主要是非递归的实现代码,自己做了注释方便以后回顾。#include "stdafx.h"#include using namespace std;...
分类:其他好文   时间:2014-06-09 15:10:07    阅读次数:227
STM in Clojure
Transactional memory in Clojure is implemented using Multiversion Concurrency Control protocolhttp://en.wikipedia.org/wiki/Transactional_memoryhttp:/....
分类:其他好文   时间:2014-06-09 15:02:02    阅读次数:199
Hello,World!
#include using namespace std;int main(){ cout<<"Hello, World!"<<endl; return 0;}
分类:其他好文   时间:2014-06-09 14:34:08    阅读次数:184
POJ 3537
利用后继节点的SG值求出当前的SG值。在当前任意一个BLANK插入一个x后,分成两段,于是,看成两段的NIM,异或和,按SG的定义求出当前的SG值即可。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 ...
分类:其他好文   时间:2014-06-09 13:37:24    阅读次数:235
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
迷上了代码!