UVA 11423 - Cache Simulator
题目链接
题意:题目讲的大概就是几个cash,每次操作可以加入一个或一些数据,如果数据之前有就是hit,命中后的数据就不会消失,如果没有就miss,当容量超过cash容量时,就会把之前最早没命中的一个丢掉,每次START就执行这些命令,计算miss次数并输出
思路:由于最多就2^24的数据,所以可以开一个树状数组,每个位置表...
分类:
其他好文 时间:
2014-08-16 21:11:01
阅读次数:
211
引问:int i=3; int b=i++*i++;为什么最后的结果是b=9?...
分类:
其他好文 时间:
2014-08-16 21:10:51
阅读次数:
188
解题报告
题意:
给定的矩形里面有镂空的矩阵,求矩阵面积并。
思路:
直接把一个图形拆成4个矩形,进行面积并。
扫描线+线段树
#include
#include
#include
#include
#define LL __int64
using namespace std;
struct Seg
{
int lx,rx,h,v;
friend bool op...
分类:
其他好文 时间:
2014-08-16 21:10:41
阅读次数:
207
Beautiful Garden
There are n trees planted in lxhgww's garden. You can assume that these trees are planted along the X-axis, and the coordinate of ith tree
is xi.
But in rece...
分类:
其他好文 时间:
2014-08-16 21:10:21
阅读次数:
174
Brave Game
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 6592 Accepted Submission(s): 4410
Problem Description
十年前读大学的时候,中国每年都要从国外...
分类:
其他好文 时间:
2014-08-16 21:10:11
阅读次数:
152
解题报告
题意:
矩形面积并。
思路:
扫描线+线段树
#include
#include
#include
#include
using namespace std;
struct Seg
{
int lx,rx,h,v;
friend bool operator < (Seg a,Seg b)
{
return a.h<b.h;
...
分类:
其他好文 时间:
2014-08-16 21:10:01
阅读次数:
241
解题报告
题意:
n个人,m辆车,给出人和车的坐标,还有人的速度,求全部人都坐上车的最小时间。(一辆车只能做一个人)
思路:
原本以为在二分图上求最小的时间就变成了求二分图的最佳匹配,其实可以二分时间,满足时间的人和车连线构图,这样二分的求最小时间。
可能写挫了,我竟然这样二分时间,,,sad
其实只要把所有的可能时间存下在二分时间更快。
#include
#include
#i...
分类:
其他好文 时间:
2014-08-16 21:09:21
阅读次数:
160
一、概念
AOP(Aspect-Oriented Programming,面向切面的编程),它是可以通过预编译方式和运行期动态代理实现在不修改源代码的情况下给程序动态统一添加功能的一种技术。它是一种新的方法论,它是对传统OOP编程的一种补充。
二、Aop原理
1.面向对象编程模型
OOP(面向对象编程)...
分类:
其他好文 时间:
2014-08-16 21:09:11
阅读次数:
230
看着题意:[1,i]中等于a[i]的个数要大于[,jn]中等于a[j]的个数 且i
int n;
int aa[1000000 + 55];
int bb[1000000 + 55];
int c[1000000 + 55];
map mp;
ll lowbit(ll x) {
return x&(-x);
}
void add(int i,int val) {
while...
分类:
其他好文 时间:
2014-08-16 21:09:01
阅读次数:
194
过了样例就能AC
注意一点 0条边特意判断下。是否无法构成生成树也要判断
#include
#include
#include
using namespace std;
#define maxn 110
int parent[maxn];
int N,M;
struct edge
{
int u,v,w;
}edges[maxn*maxn];
int cmp(void const *a,vo...
分类:
其他好文 时间:
2014-08-16 21:08:41
阅读次数:
190
这次,做之前首先规划了一下到底该怎么改?首先来看看哪里有多余的:前台:除了加载的hashtable内容和显示的内容不一样,别的地方区别很小;后台,D层中,因为三个组合查询用到的D层方法只是返回值不同,所以,返回值这里可以用list (of T)代替,这样,前台后台冗余就少多了。...
分类:
其他好文 时间:
2014-08-16 21:08:31
阅读次数:
178
一个台阶总共有n级,如果一次可以跳1级,也可以跳2级,求总共有多少总跳法。...
分类:
其他好文 时间:
2014-08-16 21:08:21
阅读次数:
133
1.客户几个关系表ER图
Party
Anentity that can enter into a business relationship, such as buying and selling,and can be of the type Organization or Person.
Party指的能够进行业务往来的实体,例如能够进行采购和销售动作,类型可...
分类:
其他好文 时间:
2014-08-16 21:07:21
阅读次数:
231
链接:http://poj.org/problem?id=3422
卡卡
题意:卡卡的矩阵之旅,有一个n*n的矩阵,卡卡要从左上角走到右下角,每次他只能往右或往下走,卡卡可以走k遍这个矩阵,每个点有一个num值,卡卡走到这里可以获得num点,一个点只能获得一次num值,问卡卡走完k遍后身上num值最大可以是多少?
思路:其实看到这题时没思路,图论书上说了建图的方式,但...
分类:
其他好文 时间:
2014-08-16 21:07:01
阅读次数:
224
UILite库可以使用git访问了
https://git.oschina.net/7thTool/UILite.git
现在可以使用UILite库开发一些应用了
后面...
分类:
其他好文 时间:
2014-08-16 21:06:41
阅读次数:
504