上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 174 下一页

2013年9月27日

BNU10805:矩形神码的

摘要: 我们都知道,矩形是由两条对角线的,没错吧?(谜之声:这不是显然么!)这两条线的长度也是相等的,没错吧?(谜之声:这不废话么!)然后我们给定一条对角线的起始点和终止点的坐标,然后给定另一个对角线和他的夹角,是不是就能得到两个面积相等的矩形?(谜之声:呃,貌似好像或许应该可能maybe perhaps probably possibly是对的?)现在我需要你求出这个矩形的面积。Input第一行,一个整数T(0#include #include #include using namespace std;double pi = acos(-1.0);int main(){ int t; d... 阅读全文

posted @ 2013-09-27 19:06 新一 阅读(219) 评论(0) 推荐(0)

BNU10791:DOTA选人

摘要: DOTA(Defense of the Ancients)是一款很受欢迎的游戏。DOTA将10个游戏玩家分为两组,分别为天灾和近卫,推倒对方主基地的一方获得胜利。每个玩家可以选择一个英雄作为游戏中的角色。每个角色有三个属性:力量,敏捷,智力。选人的策略对比赛的胜负非常关键,现在需要你找出最平衡的一套阵容(5个英雄)。这里对平衡性F做个很简单的定义:设E1是一套阵容力量的平均数,E2是敏捷的平均数,E3是智力的平均数,F是E1,E2,E3的方差, F越小越平衡。Input 第一行一个正整数 C 表示一共有多少组数据 对于每一组数据: 第一行一个正整数N,表示这组英雄的个数(5#incl... 阅读全文

posted @ 2013-09-27 19:05 新一 阅读(297) 评论(0) 推荐(0)

android 内存优化以及性能优化相关问题

摘要: 最近做一个android 的应用程序 总是出现内存高 和cpu高的问题困扰了好多天。下面为自己从网上总结的和自己找到的问题。1. WebView 控件:使用了WebView控件一定要注意清理缓存 destroy() 方法,但之前必须调用 removeAllViews() 要不然有时出错1myWebView.removeAllViews();2myWebView.destroy();2.线程在退出活动窗口时一定要注意开启的线程是否已经关闭,可以在debug查看线程的开启情况。如果只是刷新Ui线程 建议不用线程可以使用Handler 来刷新 方法如下。这种方法只能做简单的操作,复杂操作建议使用线程 阅读全文

posted @ 2013-09-27 19:03 新一 阅读(251) 评论(0) 推荐(0)

Activity中的startActivityResult,setResult,finish,onActivityResult的关系

摘要: 一:首先图示:二:代码:1:方法selectNamepublic void selectName(View view){ Intent intent = new Intent(this,NameListActivity.class); startActivityForResult(intent, 1); } public void selectName2(View view){ Intent intent = new Intent(this,NameListActivity.class); startActivityForResult(intent, 2); } 2:方法setResu... 阅读全文

posted @ 2013-09-27 19:01 新一 阅读(405) 评论(0) 推荐(0)

[Err] 1449 - The user specified as a definer ('admin_isbox'@'localhost') does not exist

摘要: 晚上加班调用一个远程拷贝的本地Mysql的储存过程,报错:[Err] 1449 - The user specified as a definer ('admin_isbox'@'localhost') does not exist凭借以前经常见到的root@localhost报错,给root赋值所有权限:grant all privileges on *.* to root@"%" identified by ".";flush privileges;发现无效。可能数据库没有此用户:select user,host fr 阅读全文

posted @ 2013-09-27 18:58 新一 阅读(1281) 评论(0) 推荐(0)

leetcode_question_57 Insert Interval

摘要: Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times. Example 1: Given intervals[1,3],[6,9], insert and merge[2,5]in as[1,5],[6,9]. Example 2: Given[1,2],[3,5],[6,7 阅读全文

posted @ 2013-09-27 18:57 新一 阅读(139) 评论(0) 推荐(0)

压位加速-poj-2443-Set Operation

摘要: 题目链接:http://poj.org/problem?id=2443 题目意思:有n个集合(n#include#include#include#include#include#include#include#include#include#include#include#include#include#define eps 1e-6#define INF 0x3f3f3f3f#define PI acos(-1.0)#define ll __int64#define lson l,m,(rt#include#include#include#include#include#include#in 阅读全文

posted @ 2013-09-27 18:54 新一 阅读(855) 评论(0) 推荐(0)

android面试题之七

摘要: 三十六、请解释下在单线程模型中Message、Handler、Message Queue、Looper之间的关系。简单的说,Handler获取当前线程中的looper对象,looper用来从存放Message的MessageQueue中取出Message,再有Handler进行Message的分发和处理. Message Queue(消息队列):用来存放通过Handler发布的消息,通常附属于某一个创建它的线程,可以通过Looper.myQueue()得到当前线程的消息队列. Handler:可以发布或者处理一个消息或者操作一个Runnable,通过Handler发布消息,消息将只会发送到与它 阅读全文

posted @ 2013-09-27 18:53 新一 阅读(256) 评论(0) 推荐(0)

python 间谍程序传输文件 socket编程

摘要: 本程序实现了,把目标机器的某个目录(可控)的所有的某种类型文件(可控)全部获取并传到己方的机器上。 1、用了base64的encode(infile,outfile)加密,以及decode(infile,outfile)解密,这是2进制加密解密 2、用zip压缩 3、socket中server.py放到自己这方python server.py,然后client.py放到目标机器,然后python client.py即可 4、本程序设置了获取doc文件,修改extName可以获取其它类型文件 server.py# -*- coding: cp936 -*-import socketimp... 阅读全文

posted @ 2013-09-27 18:51 新一 阅读(444) 评论(0) 推荐(0)

[IOI1999]花店橱窗布置(DP路径记录)

摘要: 题目:[IOI1999]花店橱窗布置问题编号:496题目描述 某花店现有F束花,每一束花的品种都不一样,同时至少有同样数量的花瓶,被按顺序摆成一行,花瓶的位置是固定的,从左到右按1到V顺序编号,V是花瓶的数目。花束可以移动,并且每束花用1到F的整数标识。如果I #include#includeusing namespace std;const int INF=0xcfcfcfcf;int val[110][110],dp[110][110],path[110][110],pp[110];void getpath(int i,int pos)//获取路径{ if(i==1) { ... 阅读全文

posted @ 2013-09-27 18:48 新一 阅读(236) 评论(0) 推荐(0)

上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 174 下一页

导航