首页 > 其他
数论总结与代码
一.素数打表: 1.平常打表: for(i=2;i<=n;i++) if(!s[i]) { for(j=2*i;j<=n;j+=i) s[j]=1; } 2.线性打表: void get_prime() { int cnt...
分类:其他   时间:2014-03-02 11:23:42    收藏:0  评论:0  赞:0  阅读:558
Cocos2d-x游戏开发之音效使用
在我们的游戏开发之中,除了UI是重中之重以外,音乐同样是不可缺少的重要部分。 因为人有两只眼睛和耳朵。 现在先来看引入的库文件,总的来说比较简单。 首先引入的库文件,并使用命名空间: #include "SimpleAudioEngine.h" using namespace CocosDenshion; 下面是代码使用: //播放背景音乐,相对路径,放在res...
分类:其他   时间:2014-03-02 10:43:38    收藏:0  评论:0  赞:0  阅读:566
CF232 D2D:On Sum of Fractions,math
题目:http://codeforces.com/contest/397/problem/D 关键是要用数学归纳法证明:当n + 1 = p, p 为质数时, = 1 / 2 - 1 / p。 证明过程:当p = 3时,显然成立,假设q为下一个质数,则 原式 = 1 / 2 - 1 / p + (q - p) / (p*q) = 1/2 - 1/q。得证。 代码: #include #i...
分类:其他   时间:2014-03-02 08:05:24    收藏:0  评论:0  赞:0  阅读:479
poj 1907 Work Reduction_贪心
贪心的题目...
分类:其他   时间:2014-03-02 09:39:06    收藏:0  评论:0  赞:0  阅读:602
C#:装箱和拆箱相关知识整理
1、装箱和拆箱是一个抽象的概念2、装箱是将值类型转换为引用类型; 拆箱是将引用类型转换为值类型 利用装箱和拆箱功能,可通过允许值类型的任何值与Object 类型的值相互转换,将值类型与引用类型链接起来例如:int val = 100; object obj = val; Console.WriteL...
分类:其他   时间:2014-03-02 07:19:12    收藏:0  评论:0  赞:0  阅读:455
Merge Sorted Array
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:其他   时间:2014-03-02 07:17:38    收藏:0  评论:0  赞:0  阅读:453
iOS KVC & KVO
转自:Regrecall bloggerKey Value CodingKey Value Coding是cocoa的一个标准组成部分,它能让我们可以通过name(key)的方式访问property, 不必调用明确的property accssor, 如我们有个property叫做foo, 我们可以...
分类:其他   时间:2014-03-02 07:06:46    收藏:0  评论:0  赞:0  阅读:612
EasyUI-LinkButton
EasyUI-LinkButton,带有超级链接的button上图就是 带有边框以及Icon图标的按钮参考代码: Add Remove Save Cut Text Button从上面的代码中我们可以看出,使用超链接按钮是非常的方便的,设置class="easyui-linkbutton" 通过 di...
分类:其他   时间:2014-03-02 07:05:14    收藏:0  评论:0  赞:0  阅读:721
continue
Print a line for each of the integers from 0 to 10 except 5:for {set x 0} {$x<10} {incr x} { if {$x == 5} { continue } puts "x is $x"}
分类:其他   时间:2014-03-02 07:02:00    收藏:0  评论:0  赞:0  阅读:394
(Mark)(Ubuntu) Ubuntu 12.04 LTS amd64 装 WPS office(Linux)(wps)
1.下载wps for linuxwps-office_8.1.0.3724~b1p2_i386.deb2.Linux 64 bit用户可以通过安装32 bit的库来获得支持。 sudo apt-get install ia32-libs3. 安装 wpssudo dpkg -i --force-a...
分类:其他   时间:2014-03-02 07:00:28    收藏:0  评论:0  赞:0  阅读:472
数据可视化(8)--D3数据的更新及动画
这篇博客主要讲了D3数据的更新以及相应的动画控制,部分内容来自《数据可视化实战》~~
分类:其他   时间:2014-03-02 06:58:56    收藏:0  评论:0  赞:0  阅读:506
iOS设计模式:观察者
摘自:http://www.cocoachina.com/applenews/devnews/2013/0506/6132.html什么是观察者模式什么是观察者模式?你曾经订阅过报纸吗?在订阅报纸的时候,你不用去任何地方,只需要将你的个人地址信息以及订阅信息告诉出版社,出版社就知道如何将相关报纸传递...
分类:其他   时间:2014-03-02 06:55:53    收藏:0  评论:0  赞:0  阅读:509
hdu 1207汉诺塔II 递推
汉诺塔问题变形题问题描述:在经典汉诺塔的基础上加一个条件,即,如果再加一根柱子(即现在有四根柱子a,b,c,d),计算将n个盘从第一根柱子(a)全部移到最后一根柱子(d)上所需的最少步数,当然,也不能够出现大的盘子放在小的盘子上面。注:1#include#define M 99999999int m...
分类:其他   时间:2014-03-02 06:52:48    收藏:0  评论:0  赞:0  阅读:460
九度OJ 1548 map的用法
题目来源:http://ac.jobdu.com/problem.php?pid=1548题目描述:给定平面上的n个点,任意做一条直线,求至多能有几个点恰好落在直线上。输入:包含多组测试数据,每组测试数据由一个整数n(0 2 #include 3 #include 4 #include 5 #inc...
分类:其他   时间:2014-03-02 06:35:56    收藏:0  评论:0  赞:1  阅读:652
java io探讨
java io输入输出流探讨
分类:其他   时间:2014-03-02 06:28:20    收藏:0  评论:0  赞:0  阅读:246
redis配置错误导致服务器不能启动
redis-server忘了把配置里面的daemonize的no改成yes所以把redis-server加入到了/etc/rc.local里面,在服务器启动的时候就会阻塞在这里,导致服务器不能启动。[解决方案]使用GRUB时,可以添加一个S(大写S)到内核命令行,可以进入单用户模式。要做到这样, 需...
分类:其他   时间:2014-03-02 06:17:34    收藏:0  评论:0  赞:0  阅读:739
天气预报接口
作者:Create Chen出处:http://technology.cnblogs.com1. 当前天气API地址:http://mobile.weather.com.cn/data/sk/101010100.htmlsd 湿度sm 未知temp 温度tempF 温度,华氏time 时间wd 风向...
分类:其他   时间:2014-03-02 06:15:59    收藏:0  评论:0  赞:0  阅读:564
使用attrs.xml自定义属性
控件有很多属性,如android:id、android:layout_width、android:layout_height等,但是这些属性都是系统自带的属性。使用attrs.xml文件,可以自己定义属性。本文在Android自定义控件的基础上,用attrs.xml文件自己定义了属性。首先,在val...
分类:其他   时间:2014-03-02 06:11:22    收藏:0  评论:0  赞:0  阅读:524
La louis vuitton sac Belle Transmission par Louis Vuitton
Peu importe qui poursuit les sacs main de luxe de style, il ne fait aucun doute que vous avez pu dcouvrir le nom du Lv . Qui ne veut pas tre synonyme ...
分类:其他   时间:2014-03-02 06:08:12    收藏:0  评论:0  赞:0  阅读:527
整数个数
1、2、3… …n这n(0int main(){ int n,i,m; while(scanf("%d %d",&m,&n)!=EOF) { i=m/n; printf("%d\n",i); } return 0;}很简单的一个题,但是AC率并不高,因为用循环的话会超时。仔细看题,多思多想,才是关键...
分类:其他   时间:2014-03-02 06:05:04    收藏:0  评论:0  赞:0  阅读:498
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!