现在位置: 首页 > 8310120发表的所有文章
  • 11月
  • 10日
综合 ⁄ 共 541字 评论关闭
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as "one 2, then one 1" or 1211. Given an integer n, generate the nth sequence. Note: The sequence of integers will be represented as a string. 字符串处理一定要注意边界和细节! class Solution { public: string covert(string s){ char p = s[0]; int cnt = 1; string ans; for(int i......
阅读全文
  • 09月
  • 24日
综合 ⁄ 共 367字 评论关闭
一、GRAG简介:         GRAG (Grails Application Generator)是针对Grails framework 开发而使用的自由的域对象生成器。GRAG可以读取数据库中的表结构,并根据表结构生成Domain类。有了GRAG工具的帮助,可以很方便地兼容旧数据库。 二、使用说明: 1、运行~/grag1.1/bin/gui.bat,进入工具主窗体; 2、配置数据库的连接(左侧的Datasource); 3、执行Database | Create connection命令,连接数据库; 4、执行Edit | Add | entity(工具栏上有快捷按钮),在弹出的对话框中选择需要映射的数据库表,并根据实际情况对属性加以修改; 5......
阅读全文
  • 08月
  • 10日
综合 ⁄ 共 18987字 评论关闭
From: http://sourceforge.jp/projects/mingw/releases/    RSS Download List Review Average 4.2 52 Reviews 5 Stars 39 4 Stars 2 3 Stars 2 2 Stars 2 1 Star 7 Your rating    Review this project 项目描述 MinGW是指只用自由软件来生成纯粹的Win32可执行文件的编译环境,它是Minimalist GNU on Windows的略称。 System Requirements 作业系统: MinGW/MSYS (MS Windows), All 32-bit MS Windows (95/98/NT/2000/XP/Vista/7), Windows Downl......
阅读全文
  • 06月
  • 07日
综合 ⁄ 共 361字 评论关闭
 有很多的朋友在VC下使用MapX的时候,总是感觉不是很顺手,其中一个很明显的问题就是老是出现COleVariant或Variant类型的数据,对于习惯了使用VC下形如CString等类型变量的朋友来说COleVariant或Variant类型给VC下使用MapX造成了很多不便;也造成了开发和调试效率很低,在数据类型上打转转。     我这篇文章不是要告诉大家如果进行数据类型的转换,也不是来讲VC下如何使用MapX的各个功能来编写程序,而是要解决一个环境问题——帮助习惯了使用VC一般数据类型的朋友建立一个平易近人的MapX开发环境。 声明:我这篇文章只针对VC++6.0......
阅读全文
  • 04月
  • 25日
综合 ⁄ 共 1452字 评论关闭
题意:对一个长度为n(n <= 50000)的数列A进行m(m <= 50000)次操作(2种):          1:给定a,b,k,c四个整数,在[a , b] 区间满足a<=i<=b && (i-a)% k == 0的数加c(1<=k<=10);          2:给定整数a,求当前A[a]; 题解:想办法把间隔的数字搞到一起,因为1<=k<=10,所以一共最多只能形成55个个序列,即:          1,2,3,4,5…(k=1)          1,3,5,7,9…(k=2)          2,4,6,8,10…(k=2)          1,4,7,10,13…(k=3)          2,5,9,12,15…(k=3)          3,6,10,13,16…(k......
阅读全文
  • 04月
  • 23日
综合 ⁄ 共 1429字 评论关闭
由题意可知,0肯定是会出现的,因为它最小,然后遍历一遍找出来的肯定是最小的, 对每个数的判断可以采用移位操作; code: /* ID: yueqiq LANG: C++ TASK: hamming */ #include <set> #include <map> #include <ctime> #include <queue> #include <cmath> #include <stack> #include <limits> #include <vector> #include <bitset> #include <string> #include <cstdio> #include <cstring> #include <fstream> #include <string.h> #inclu......
阅读全文
  • 04月
  • 12日
综合 ⁄ 共 1027字 评论关闭
Restore IP Addresses: Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given "25525511135", return ["255.255.11.135", "255.255.111.35"]. (Order does not matter) #define pb push_back #define pp pop_back class Solution { public: vector<string> restoreIpAddresses(string s) { // Start typing your C/C++ solution below // DO NOT write int main() function vector<string> ret;......
阅读全文
  • 02月
  • 21日
综合 ⁄ 共 4945字 评论关闭
1003Mine 传送门 让人无限伤心的一道题。 这题是一道简单的sg函数取石子的题,题目中有几处需要注意的。 首先这不是传统意义上的扫雷的走法,白格的八向联通的。 然后是不存在同时属于两个白格范围的格子,也就是不存在同时属于两个石堆的石子。 我们把单独的格子记为1,雷记为0,白格区域周围有偶数格的话和单独的格子效果一样,记为1 周围是奇数个的话则会产生转换,记为2。 然后计算就行了。 比赛的时候的代码距离AC只差三个字符,极度伤心T_T(DFS的时候可能会暴栈,建议自定义栈大小) #include <iostream> #include &......
阅读全文
  • 02月
  • 20日
综合 ⁄ 共 15203字 评论关闭
UIUC的Jia-Bin Huang同学收集了很多计算机视觉方面的代码,链接如下: https://netfiles.uiuc.edu/jbhuang1/www/resources/vision/index.html 不过这里打不开,我是从这里下载的: http://blog.sciencenet.cn/blog-722391-569547.html 这些代码很实用,可以让我们站在巨人的肩膀上~~ Topic Resources References Feature Extraction SIFT [1] [Demo program][SIFT Library] [VLFeat] PCA-SIFT [2] [Project] Affine-SIFT [3] [Project] SURF [4] [OpenSURF] [Matlab Wrapper] Affine Covariant Fe......
阅读全文
  • 02月
  • 20日
综合 ⁄ 共 549字 评论关闭
先上时间超了的代码 #include <iostream> #include <cmath> #include <algorithm> using namespace std ; int main() { int t ; cin >>t ; while (t--) { int count = 0 ; long long int a , b ; cin >> a >> b ; for ( int i = a ; i <= b ; ++i) { double result = sqrt(i) ; if(i == result * result )++count ; } cout << count << endl ; } return 0 ; } 这里面 时间超过 或者有 错误答案产生 主要是 在 result......
阅读全文
  • 01月
  • 20日
综合 ⁄ 共 668字 评论关闭
数据统计的题目么…… 规定要用map ,就用了…… map的特殊之处在于其可以用string之类的数据类型来做序号,从而可以达到自制定义数组的要求。 本题就是构造的一个<string,int>的map。 然后遍历一遍就行了。 最后AC Memory : 392K   Time : 0MS 代码如下: #include <iostream> #include <cstdio> #include <cstring> #include <map> using namespace std; int main() { map<string,int> co; //构造需要的map map<string,int>::iterator iter; // 迭代器 int N; whil......
阅读全文
  • 12月
  • 23日
综合 ⁄ 共 1160字 评论关闭
Letter Combinations of a Phone Number: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string "23" Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]. Note: Although the above answer is in lexicographical order, your answer could be in any order you want. class Solution { public: vector<string> letterCombinations(string ......
阅读全文