上一页 1 ··· 68 69 70 71 72 73 74 75 76 ··· 138 下一页
摘要: Meta-Loopless Sorts Background Sorting holds an important place in computer science. Analyzing and implementing various sorting algorithms forms an important part of the education of most comput... 阅读全文
posted @ 2014-06-10 15:22 katago 阅读(291) 评论(0) 推荐(0)
摘要: 题意:神人鬼三个种族,神只说真话,鬼只说假话,人白天说真话,晚上说假话。根据对话内容区分种族和白天黑夜。 最多有A, B, C, D, E五个人 算法:枚举A, B, C, D, E的种族情况和白天黑夜的情况。每个人有可能是神人鬼,所以用两个bit表示,白天黑夜用1个bit表示。一共需要11 bits. #include#include#includeusing names... 阅读全文
posted @ 2014-06-09 15:18 katago 阅读(317) 评论(0) 推荐(0)
摘要: 复制npswf32.dll 到 C:\WINDOWS\system32\Macromed\Flash\ 代码加入: //! [1] QNetworkProxyFactory::setUseSystemConfiguration(true);// flash support QWebSettings::globalSettings()->setAttribute(QWebS... 阅读全文
posted @ 2014-05-27 11:28 katago 阅读(464) 评论(0) 推荐(0)
摘要: 本文主要目的是向c++程序员阐述javascript的编程思想,以及编程中的误区。 变量声明: 1、变量声明的解析早于代码运行。JavaScript引擎的工作方式是,先解析代码,获取所有被声明的变量,然后再一行一行地运行(This behaviour is called "hoisting", as it appears that the variable declaration is ... 阅读全文
posted @ 2014-05-09 17:25 katago 阅读(696) 评论(0) 推荐(0)
摘要: Binary Search 【原文见:http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=binarySearch】 ... 阅读全文
posted @ 2014-05-05 16:35 katago 阅读(339) 评论(0) 推荐(0)
摘要: r排列生成: gen 递归层数d表示正在生成第d个元素。 vis记录是否出现过。 #include#include#includeusing namespace std;int n, r;int A[50], vis[50];//记录第i个元素是否生成过int cnt;int rer;void output(int r){ for(int i = 0; i #include... 阅读全文
posted @ 2014-04-30 16:27 katago 阅读(2988) 评论(0) 推荐(0)
摘要: // 题意: // 输入两个整数N, H,按照字典序输出所有长度为N,恰好包含H个1的01串 // 规模:1#include const int maxn = 20;int N, H, bits[maxn];// 从bits[d]开始确定,已经用了c0个0和c1个1void gen(int d, int c0, int c1) { if(d == N) { if(c1 ... 阅读全文
posted @ 2014-04-28 17:07 katago 阅读(267) 评论(0) 推荐(0)
摘要: 比牌先比牌型,大的牌型大于小的牌型,牌型一般分为10种,从大到小为: 同花大顺(Royal Flush):最高为Ace(一点)的同花顺。 例: 同花顺(Straight Flush):同一花色,顺序的牌。 例: 四条(Four of a Kind,亦称“铁支”、“四张”或“炸弹”):有四张同一点数的牌。 例: 满堂红(Fullhouse,亦称“俘虏”、“骷髅”、“夫... 阅读全文
posted @ 2014-04-25 17:31 katago 阅读(2271) 评论(0) 推荐(0)
摘要: // 题意:有P个LED灯,以及N个字符,要求选出个数最少的LED灯,使得即使只有这些灯正常工作,也能区分出这N个字符 // 题意抽象:输入两个整数P, N以及N行P列的01矩阵,找少的列,能区分所有行 // 规模:P#include#include#include#include#includeusing namespace std;const int P=15;const i... 阅读全文
posted @ 2014-04-25 15:44 katago 阅读(236) 评论(0) 推荐(0)
摘要: Problem G. Birthday Cake Background Lucy and Lily are twins. Today is their birthday. Mother buys a birthday cake for them.Now we put the cake onto a Descartes coordinate. Its center is at (... 阅读全文
posted @ 2014-04-25 11:35 katago 阅读(368) 评论(0) 推荐(0)
上一页 1 ··· 68 69 70 71 72 73 74 75 76 ··· 138 下一页