上一页 1 ··· 91 92 93 94 95 96 97 98 99 ··· 174 下一页

2013年9月13日

Java控制台输入ScannerDemo

摘要: 阅读全文

posted @ 2013-09-13 21:02 新一 阅读(329) 评论(0) 推荐(0)

HDU4712+随机算法

摘要: 随机算法求n个20位的2进制串的MinDist。Dist:两个串的异或结果中1的个数/*随机算法*/#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long int64;//typedef __int64 int64;typedef pair PII;#define MP(a,b) make_pair((a),(b)) const int inf = 0x3f3f3f3f;const double pi 阅读全文

posted @ 2013-09-13 20:59 新一 阅读(204) 评论(0) 推荐(0)

poj2125Destroying The Graph(最小割+输出方案)

摘要: 题目请戳这里题目大意:给一张有向图,现在要选择一些点,删掉图中的所有边。具体操作为:选择点i,可以选择删除从i出发的所有有向边或者进入i的所有有向边,分别有个代价ini和outi,求最小的代价删掉所有边。并输出删除方案。题目分析:最小割。因为每次删除的是一个点的所有入边或者所有出边。那么就很明显了,拆点,将i拆成i和I+n2个点,分别表示第i个点的入度点和出度点。源点到每个i连边,表示从i点的出边,边权为outi,i+n表示第i个点的入度点,那么i+n-->汇点建边,边权为ini,对于每对给定的有向边i->j,建边i->j + n,边权为无穷大。原理其实和这题是十分类似的。因 阅读全文

posted @ 2013-09-13 20:56 新一 阅读(645) 评论(0) 推荐(0)

HDU4608+模拟

摘要: 简单的模拟题。暴力枚举/*模拟*/#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long int64;//typedef __int64 int64;typedef pair PII;#define MP(a,b) make_pair((a),(b)) const int inf = 0x3f3f3f3f;const double pi=acos(-1.0);const int dx[]={1,-1,0,0};con 阅读全文

posted @ 2013-09-13 20:55 新一 阅读(187) 评论(0) 推荐(0)

七、cocos2dx之粒子系统

摘要: 本文由qinning199原创,转载请注明:http://www.cocos2dx.net/?p=66一、介绍粒子系统指的是一个使用大量很小的精灵或者其他的一些绘制对象模拟一些模糊效果。使用传统的绘制技术很难实现。它们经常被用到一些混乱系统,自然现象以及一些化学反应动画效果中。二、点阵vs矩形在之前版本的cocos2dx中,有两种类型的粒子系统:矩形和点阵粒子系统:1)CCParticleSystemQuad2)CCParticleSystemPointCCParticleSystemQuad有一些额外的特点而CCParticleSystemPoint不支持:1)旋转粒子系统:粒子们能够围绕轴 阅读全文

posted @ 2013-09-13 20:53 新一 阅读(318) 评论(0) 推荐(0)

组织机构代码校验码 验证程序

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace org_bm_checker{ class Program { static void Main(string[] args) { org_bm_class op = new org_bm_class(); string y_bm = "PDY00002"; ... 阅读全文

posted @ 2013-09-13 20:50 新一 阅读(852) 评论(0) 推荐(0)

公民身份号码 校验码 检证程序

摘要: 公民身份号码 校验码 检证程序using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace org_bm_checker{ /// /// 公民身份号码 校验码 检证程序 /// vp:hsg /// create date:2013-09-13 1:19 /// public class sfzhClass { public void test() ... 阅读全文

posted @ 2013-09-13 20:47 新一 阅读(305) 评论(0) 推荐(0)

百度地图之短串分享

摘要: 在百度SDK中提供了一个短串分享功能,该功能核心意思就是,当你搜索到一个地址信息时,你可以通过短信、邮件、蓝牙等发给你的好友或者分享到第三方平台,包括空间、微信等等。而接收方可以直接通过收到的链接打开手机上的百度地图客户端或者手机浏览器进行查看,这样就实现了地理位置信息的共享,百度Demo代码如下:注意:短串分享目前只开放“POI搜索结果分享”(本文默认搜索的是北京市的餐厅)和“反向地理编码结果分享”(本文默认坐标是40.056878,116.308141),Demo只能按默认条件搜索是为方便演示,实际中应该从界面通过输入获取等才更具有灵活性。介绍短串Activity(ShareDemo):p 阅读全文

posted @ 2013-09-13 20:46 新一 阅读(970) 评论(0) 推荐(0)

HDU 1421 DP

摘要: 还是这种思想:dp[i][j]表示前i件物品取j对的最优解那么想想dp[i][j]是怎么来的,(1)i==j*2 dp[i-2][j-1]+(a[i]-a[i-1])*(a[i]-a[i-1])(2)i>j*2 dp[i][j]=min(dp[i-1][j],dp[i-2][j-1]+(a[i]-a[i-1])*(a[i]-a[i-1]))注意long long 会超时 多组输入很奇怪的是 我数组开了2002*2002 WA了多次 开大一些 AC...无语...贴代码: #include#include#includeusing namespace std;#define N 2050# 阅读全文

posted @ 2013-09-13 20:44 新一 阅读(135) 评论(0) 推荐(0)

HDU 1796 容斥原理 How many integers can you find

摘要: 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1796 处男容斥原理 纪念一下 TMD看了好久才明白DFS...先贴代码后解释#include#includeusing namespace std;#define LL long long#define N 11LL num[N],ans,n;int m,cnt;LL gcd(LL a,LL b){ int t; while(b) { t=a%b; a=b; b=t; } return a;}void dfs(int id,b... 阅读全文

posted @ 2013-09-13 20:41 新一 阅读(176) 评论(0) 推荐(0)

上一页 1 ··· 91 92 93 94 95 96 97 98 99 ··· 174 下一页

导航