码迷,mamicode.com
首页 >  
搜索关键字:path    ( 29634个结果
poj-3764 The xor-longest Path
题意: 给出一个有权树,求树上两点路径的最大异或和; n 题解: 考虑异或的性质,如果任选一点为根,处理出所有点的异或深度; 那么将两点的深度异或起来,LCA到根的路径就异或了两次相当于没有; 所以异或距离就是两点异或深度的异或和,问题就转化成了从n个数中选两个数使异或和最大; 这个经典问题就可以把数字按位存进01trie树,从高位到低位贪心求解; 复杂度O(31n); ...
分类:其他好文   时间:2015-07-25 09:34:21    阅读次数:109
从文件读取内容
// // main.m // 从文件中读取内容 #import int main(int argc, const char * argv[]) { @autoreleasepool { NSString * path = @"/Users/ms/Desktop/hello"; NSError * error; NSString...
分类:其他好文   时间:2015-07-25 09:31:50    阅读次数:111
字符串写入文件
#import //写入文件 int main(int argc, const char * argv[]) { @autoreleasepool { NSString * str = @"你是一只小狗 "; //创建路径 NSString * path =@"/Users/ms/Desktop/hello/my.txt"; ...
分类:其他好文   时间:2015-07-25 09:31:41    阅读次数:126
#leetcode#Simplify Path
Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" click to show corner cases. Corner Cases: Did ...
分类:其他好文   时间:2015-07-25 07:11:54    阅读次数:196
[leedcode 129] Sum Root to Leaf Numbers
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:其他好文   时间:2015-07-24 23:54:38    阅读次数:107
poj 3126 Prime Path (bfs)
Prime PathTime Limit:1000MSMemory Limit:65536KTotal Submissions:13813Accepted:7796DescriptionThe ministers of the cabinet were quite upset by the mess...
分类:其他好文   时间:2015-07-24 22:30:38    阅读次数:120
使用oledb读取excel表
string path = "C:\\Users\\aaa\\Desktop\\aa.xls"; string conn = "Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =" + path + ";Extended Pro...
分类:数据库   时间:2015-07-24 20:16:05    阅读次数:122
mysql数据库的安装使用
下载的的mysql有两个版本:一种是.msi,可以直接安装,之后在services.msc中启动服务就行了; 另一种是需要配置的,步骤如下: 1.把文件放到自己想要的地方,类似程序安装目录 2.可以把目录添加到环境变量Path中,方便命令的使用 (可能重启后才生效) 3.修改my-default-....
分类:数据库   时间:2015-07-24 20:06:32    阅读次数:132
mac brew 安装SVN
which-asvnsudorm/usr/bin/svnblewinstallsvnbrewlink--overwritesubversionecho‘exportPATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"‘>>~/.bash_profilesource~/.bash_profilecat~/.bash_profile
分类:系统相关   时间:2015-07-24 18:51:45    阅读次数:662
Shell根据年月日创建文件夹
#!/bin/shdir_path="/vol/project/log/test/"for year in {2012..2013}do #echo "$year" cd $dir_path mkdir $year for month in {1..12} do ...
分类:系统相关   时间:2015-07-24 18:07:50    阅读次数:190
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!