现在位置: 首页 > tunic发表的所有文章
  • 07月
  • 25日
综合 ⁄ 共 503字 评论关闭
Roman to Integer Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 思路: 字母对数字的一一对应累积关系。唯一需要注意的是,之前一个字母对应的数字如果小于当前字母对应的数字,则需要特殊处理。 题解: std::map<char, int> char_mapper{ {'I', 1}, {'V', 5}, {'X', 10}, {'L', 50}, {'C', 100}, {'D', 500}, {'M', 1000} }; class Solution { public: int romanToInt(string s) { int value = 0; ......
阅读全文
  • 02月
  • 19日
综合 ⁄ 共 8609字 评论关闭
    链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=70533#overview     A - poj1837 Time Limit:1000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64u Description Gigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.  It orders two arms of negligible weight and each arm's length is 15. Some hooks are attached to these arms and Gigel wants to hang up some weights from his collection of G w......
阅读全文
  • 12月
  • 28日
综合 ⁄ 共 594字 评论关闭
找出没有缘分的同学,如果有缘分的建边, 就是求最大独立集问题了 #include<stdio.h> #include<string.h> int n,m,ma[1050][1050],mark[1050],link[1050]; int find(int a) { int i; for(i=0;i<n;i++) { if(ma[a][i]==1&&mark[i]==0) { mark[i]=1; if(link[i]==-1||find(link[i])==1) { link[i]=a; return 1; } } } return 0; } int main() { int i,x,j,y,z,sum,t......
阅读全文
  • 12月
  • 23日
综合 ⁄ 共 548字 评论关闭
并查集专题练习(2013.07.28~) http://acm.hust.edu.cn/vjudge/contest/view.action?cid=26995#overview POJ 1611 The Suspects   解题报告 POJ 1308 Is It A Tree? 参考代码 POJ 1182 食物链    参考代码 POJ 2492 A Bug's Life   参考代码 POJ 1198 Solitaire POJ 1703 Find them, Catch them POJ 2236 Wireless Network POJ 2524 Ubiquitous Religions 参考代码 POJ 1456 Supermarket POJ 1733 Parity game POJ 1417 True Liars POJ 2912 Rochambeau POJ 1861 Network HDU 1558 Segment set HDU 1811 Rank of Tetris HDU 3038......
阅读全文
  • 10月
  • 31日
综合 ⁄ 共 1635字 评论关闭
http://blog.163.com/ddmm97@126/blog/static/8726839420086213294156/   How to drive a female teacher crazyI had been a teacher for 17 years. Many of my students think it’s easy to drive a female teacher crazy. They have a lot of ideas that I’d like to share them with you. First, when you meet the female teacher in the morning, you should tell her that her clothes make her looked like older or fatter than usual. If her clothes are really very beautiful, you should tell her that you have see......
阅读全文
  • 10月
  • 22日
综合 ⁄ 共 21字 评论关闭
关键词:信用风险、贝叶斯统计、SAS&R  
阅读全文
  • 07月
  • 17日
综合 ⁄ 共 2190字 评论关闭
重载PreTranslateMessage函数,截获回车键的消息,当截获到的时候,触发你的函数。 BOOL CxxxDlg::PreTranslateMessage(MSG* pMsg) { if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_ENTER) { YourButtonFunc() //你的按钮函数 //这样,在你的程序中,按回车,就会执行该函数 } return CDialog::PreTranslateMessage(pMsg); } 一下是例子: BOOL CBrowsBar::PreTranslateMessage(MSG* pMsg) { // TODO: 在此添加专用代......
阅读全文
  • 05月
  • 22日
综合 ⁄ 共 1字 评论关闭
  • 05月
  • 13日
综合 ⁄ 共 324字 评论关闭
问题现象: 当打开多个excel文件时,直接双击文件打开,你会发现多个excel是共用的同一个窗口。这样很不方便两个文件对比。有没有什么办法,可以让两个xlsx文件可以在两个窗口打开呢? 解决方法: 1> 先打开文件A,这时会出现第一个excel文件的窗口; 2> 注意这时候不要双击文件B,而是点击“开始菜单“[win7还需要点所有程序] -> Microsoft Office -> Microsoft Excel 2010,这样就会开启一个新的excel进程,这样就可有两个excel窗口了; 3> 然后在新开的窗口中选择要打开的文件,这个方法可以打开N个excel窗口。 ......
阅读全文
  • 05月
  • 09日
综合 ⁄ 共 2375字 评论关闭
查看Linux服务器的硬盘使用情况 想要了解Linux服务器的硬盘使用情况,可以根据以下步骤来查看。 1)查看硬盘及分区信息,命令:fdisk -l 2)检查文件系统的磁盘空间占用情况,命令:du -h 3)查看硬盘的I/O性能,命令:iostat -x 1 10 其中,iostat是含在套装systat中的,在Centos5.5下可以用命令yum -y install systat来安装 参数说明: rrqm/s:每秒进行merge的读操作数目,即delta(rmerge)/s。 wrqm/s:每秒进行merge的写操作数目,即delta(wmerge)/s。 r/s:每秒完成的读I/O设备的次数,即delta(rio)/s。 w/s:每秒......
阅读全文
  • 05月
  • 01日
综合 ⁄ 共 1428字 评论关闭
public static StartAPKInfo parseStartAPKJson(InputStream inputStream) { Log.i(TAG, "parsePlaylistJson "); StartAPKInfo info = new StartAPKInfo(); StringBuffer out = new StringBuffer(); byte[] b = new byte[4096]; try { for (int n; (n = inputStream.read(b)) != -1;) { out.append(new String(b, 0, n)); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); return null; } String str = out.t......
阅读全文
  • 04月
  • 28日
综合 ⁄ 共 345字 评论关闭
先说下问题背景 项目中的编码使用的是UTF-8,浏览器也是设置的UTF-8 某功能已上线了半个月,一切正常。由于需求变更,同事动这块代码,前两天突然跟我说IE 、chrome下使用ajax发起的post请求有乱码,火狐正常。       也不知道怎么会突然乱码,先解决了问题吧: $.ajax({                  url: "xx.aspx"     ,              data: param   ,              contentType: "application/x-www-form-urlencoded;charset=UTF-8"     ,   //设置该参数              ............              success: function() { } });
阅读全文