
C/C++
saikor1024
这个作者很懒,什么都没留下…
展开
-
【转】VIM设置吐血整理(可以胜任工程编辑和ACM竞赛编辑)
Linux系统版本:ubuntu 10.10真相: • vim安装和中文帮助文档 vim 安装直接选择apt-get install vim(所有的都装上吧,包括vim-gtk,vim-gnome),或者去vim官方下载源码安装。 中文帮助文档下载:http://sourcefo转载 2012-02-26 23:51:58 · 1101 阅读 · 0 评论 -
【转】Vi学习
学习 vi 的最大难点在于——vi 的繁多的指令。为了有效利用 vi,你需要记住其中不少的一些。这可能需要不少时间;而偏偏这篇指南的目的之一就是在于利用尽可能少的时间。所以,从一开始,我们将面对一个挑战——怎么能让你在短期内记住大量的命令。 为了在这篇指南的过程中解决这个难题,我们会逐渐一点一点积累起一张关于 vi 的知识清单。这张清单会包含所有重要的 vi 命令。当你完成了这份指南,当你转载 2012-02-26 23:49:01 · 577 阅读 · 0 评论 -
【转】TopCoder 规则入门
基本规则TopCoder的比赛类型很多,最常见的是周赛SRM(Single Round Match),另外还有TCHS SRM(TopCoder High School SRM,题目和SRM一样,仅限中学生参加,参赛者水平较低,据说涨rating很容易),马拉松(Marathon Matchs),还有TCOpen(每年两次的大比赛)之类的比赛。因为大多数人都在做SRM,所以本文介绍的TC比赛即转载 2012-02-26 23:46:05 · 1573 阅读 · 0 评论 -
Unique Paths & Unique Paths II
Unique Paths:m*n的格子,从左上角到右下角,总共多少条不同路线。。。采用深搜或用stack存储要访问的格子会导致TLE,这里采用dp的方式,依据: grid[x][y]=grid[x-1][y]+grid[x][y-1]class Solution {private: int grid[100][100];public: int uniqueP原创 2015-04-01 19:24:02 · 705 阅读 · 0 评论 -
Word Search
Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically原创 2015-04-01 19:12:14 · 473 阅读 · 0 评论 -
Linked List Cycle
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?最初的da原创 2014-09-12 00:28:48 · 672 阅读 · 0 评论 -
Reverse Words in a String
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".ke原创 2014-09-10 23:37:43 · 693 阅读 · 0 评论 -
linux时间相关结构体和函数整理
一、时间类型。Linux下常用的时间类型有4个:time_t,struct timeb, struct timeval,struct timespec,clock_t, struct tm.(1) time_t是一个长整型,一般用来表示用1970年以来的秒数.该类型定义在中.一般通过 time_t time = time(NULL); 获取.(2) struct t转载 2014-04-28 10:42:13 · 710 阅读 · 0 评论 -
scanf 读入时分离字符串和整数。。
参考: http://hi.baidu.com/lonten/item/a13f436000faa72668105bc1原创 2014-04-10 20:43:24 · 1279 阅读 · 0 评论 -
c++文件操作
C++文件操作 在头文件中 其主要类型: ifstream : 由istream派生而来,提供读文件功能 ofstream: 由ostream派生而来,提供写文件功能 fstream : 由iosream派生而来,听过读写同一个文件的功能。详细参考:http://w原创 2013-03-27 00:32:52 · 857 阅读 · 0 评论 -
C++连续读写多个文件
C++连续读写多个文件当用同一个fstream对象file连续读写不同的文件时,读写下一个文件会和读写上一个文件的file的状态相关联。示例和代码如下:#include #include #include using namespace std;int main () { fstream fin, fout; string str; //f原创 2013-03-27 21:01:30 · 10944 阅读 · 0 评论