import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
public class EPI_15_1 {
static class Rect {
public int lft;
public int rgt;
public int height;
public Rect(int l, int r, int h) {
lft = l;
rgt = r;
height = h;
}
}
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
public class EPI_15_1 {
static class Rect {
public int lft;
public int rgt;
public int height;
public Rect(int l, int r, int h) {
lft = l;
rgt = r;
height = h;
}
}
下面的代码我测试通过了。
public class Rect {
int x;
int y;
int width;
int height;
public Rect(int x, int y, int width, int height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
public int getArea() {
return width * height;
}
Rect intersect(Rect other) {
int newX0 = Math.max(x, other.x);
int newY0 = Math.max(y, other.y);
int newX1 = Math.min(x + width, other.x + other.width);
in... 阅读全帖
不是很麻烦吧。
#include
#include
#include
using namespace std;
#define MP make_pair
typedef pair PII;
typedef vector VI;
struct FindVertex
{
struct rect
{
int x1, y1, x2, y2;
rect(int a, int b, int c, int d) : x1(a), y1(b), x2(c), y2(d) {}
};
vector rects;
void add(int a, int b, int c, int d)
{
rect r(a, b, c, d);
rects.push_back(r);
}
void solve()
{
int i, j;
VI v;
... 阅读全帖
不用 line sweep 的简单解法:
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;
public class Aggregation
{
protected List rects;
protected Aggregation overlap;
public Aggregation()
{
this.rects = new ArrayList<>();
this.overlap = new Aggregation();
}
public void add(Rectangle2D r)
{
List intersects = new ArrayList<>(this.rects.size());
for (Rectangle2D rect : this.rects)
{
... 阅读全帖
问一道题~
2D knapsack
class rect{
public:
int width;
int height;
int area;
};
input: vector source , int canvasWidth , int canvasHeight
no overlap allowed , no rotate allowed, each rect int source and be used as
many times as
possible (area = width * height , setting area as another val will be a
similar problem)
compute the max coverage of canvas using the rects int the source
a dp solution
maxCover[row][col] = max (maxCover[subRow][col] + maxCover... 阅读全帖
请教第3题怎么做?
assume a retangle 1 to n
form a graph M[n*n], if rect i intersect with j, then M[i,j] and M[j,i]=1
othwise =0
Then get a longest path of between rect i,j
assume path[i] is the longest path ending at rect i
Is this correct?
开始忘贴代码了,有朋友要求,就把修改后的代码贴在这里。改动不多,可以部分提升
效率。原来的也没删,注释掉了。供参考。
=========================================================================
clear;
close all
disp('The only input needed is a distance matrix file')
disp('The format of this file should be: ')
disp('Column 1: id of element i')
disp('Column 2: id of element j')
disp('Column 3: dist(i,j)')
if(0)
% mdist=input('name of the distance matrix file (with single quotes)?\n'
);
mdist = 'example_distances.dat';
HGT involving prokaryotes
Many studies support the significant role of HGT in the evolution of
prokaryotes (Gogarten et al., 2002; Jain et al., 2003; Kunin and Ouzounis,
2003). The principle sources of novel genes are provided by other prokary-
otes, viruses and MGEs (Fig. 1). In particular, plasmids and composite
mobile elements contribute significantly to HGT between prokaryotes. In some
cases, composite elements and megaplasmids are composed of more than 100
genes (Bentley et al., 2002; Hacke... 阅读全帖
New! Nile Motion Coffee Table - $350 (fremont) http://www.amazon.com/Beverly-Hills-Furniture-Nile-Rect-CT-Moti
Nile Rect CT Features: -Smooth ball-bearing release mechanism for easy one-
handed operation.-Checkered veneer top.-Represents the convergence of style,
quality and functionality.-Interior storage space is fully veneered,
allowing for years of regular use. Construction: -Construction: Wood veneer
on medium density fiberboard. Color/Finish: -Wenge finish. Dimensions: -
Dimensions: 13'' H... 阅读全帖
【 以下文字转载自 Apple 讨论区 】
发信人: bullmaster (master), 信区: Apple
标 题: 被隔壁ablution那个傻叉封了,在这里说说圆角矩形
发信站: BBS 未名空间站 (Sat Feb 16 13:12:06 2013, 美东)
Fuck,圆角矩形是Apple Design, and there is a history for that.
圆角矩形要追溯到30年前的Apple Lisa,Steve Jobs坚持苹果图形界面上的矩形必须是
圆角而不是尖角。 Steve wanted Apple computer to model objects in reality,so
people will not be afraid of computers.
但当时的硬件条件下在屏幕上画圆是件很慢的事情,因为要计算平方。 Apple
engineer Bill Atkinson 发明了只用相邻奇数之和算平方的算法,比如1+3=4, 1+3+5=
9, etc. 所以当时只有苹果的电脑才可以在屏幕上快速画圆弧。 圆角矩形就好像6色
的彩色苹果标志... 阅读全帖
【 以下文字转载自 Apple 讨论区 】
发信人: bullmaster (master), 信区: Apple
标 题: 被隔壁ablution那个傻叉封了,在这里说说圆角矩形
发信站: BBS 未名空间站 (Sat Feb 16 13:12:06 2013, 美东)
Fuck,圆角矩形是Apple Design, and there is a history for that.
圆角矩形要追溯到30年前的Apple Lisa,Steve Jobs坚持苹果图形界面上的矩形必须是
圆角而不是尖角。 Steve wanted Apple computer to model objects in reality,so
people will not be afraid of computers.
但当时的硬件条件下在屏幕上画圆是件很慢的事情,因为要计算平方。 Apple
engineer Bill Atkinson 发明了只用相邻奇数之和算平方的算法,比如1+3=4, 1+3+5=
9, etc. 所以当时只有苹果的电脑才可以在屏幕上快速画圆弧。 圆角矩形就好像6色
的彩色苹果标志... 阅读全帖
发现bullmaster的原帖被删除了,正好有备份,再转过来。原来标题里的一些字删除了。
【 以下文字转载自 Apple_II 俱乐部 】
发信人: wavelets02 (波士顿), 信区: Apple_II
标 题: 被隔壁ablution那个傻叉封了,在这里说说圆角矩形 (转载)
发信站: BBS 未名空间站 (Sat Feb 16 13:48:28 2013, 美东)
【 以下文字转载自 Apple 讨论区 】
发信人: bullmaster (master), 信区: Apple
标 题: 被隔壁ablution那个傻叉封了,在这里说说圆角矩形
发信站: BBS 未名空间站 (Sat Feb 16 13:12:06 2013, 美东)
Fuck,圆角矩形是Apple Design, and there is a history for that.
圆角矩形要追溯到30年前的Apple Lisa,Steve Jobs坚持苹果图形界面上的矩形必须是
圆角而不是尖角。 Steve wanted Apple computer to model objects in reality... 阅读全帖
错误
您所请求的网址(URL)无法获取
当尝试读取以下网址(URL)时: http://img13.tianya.cn/Photo/2010/11/24/319244
24_14249464.jpg
发生了下列的错误:
* Access Denied.
拒绝访问
Access control configuration prevents your request from being allowed
at this time. Please contact your service provider if you feel this is incor
rect.
当前的存取控制设定禁止您的请求被接受,如果您觉得这是错误的,请与您网路
服务的提供者联系。
本缓存服务器管理员:webmaster
可能不支持直接看图吧。
http://finance.yahoo.com/news/9-unbelievable-student-loan-horro
512874.html
这钱哈时候还完啊
With the cost of college continuing to rise and the economy still stagnating
, the student debt burden has swollen to a record $1 trillion.
Mark Kantrowitz, publisher of Fastweb.com and FinAid.org, believes that one
of the main culprits behind the student debt crisis is the private student l
oan sector.
"Students are following their dreams and don't pay attention to their debt,"
Kantrowitz says. "They sign whate... 阅读全帖
http://thejns.org/doi/pdf/10.3171/2016.8.PEDS16321
外国人的无耻 有时候远远超过我们的想象。 这个叫Tuite的老美医生在未告知肖医生
的前提下,把肖拉过来做双盲实验。肖在指导了两例后才被告知,原来是被人在做套。
更无耻的是,该老美事后发表的那篇“著名的”文章“Lack of ef cacy of an
intradural somatic-to- autonomic nerve anastomosis (Xiao procedure) for
bladder control in children with myelomeningocele and lipomyelo- meningocele
,该实验是肖参与的。绝了,你还真挑不出来他说谎的理儿
First, regarding my involvement in the trial, Dr. Tu- ite’s team traveled
to China in 2009 and personally ex- amined more than a dozen children wi... 阅读全帖
Inconsistent evolutionary scenarios
Deriving a parsimonious evolutionary scenario is based on the premise that
over time, genetic change is relent- less, such that distant relatives are
expected to have fewer features in common than close relatives (Koonin et al
., 2001). Therefore, the presence of some distinguishing ge- netic signal in
a distant relative but absent from more closely related organisms
contradicts this expectation. The most common causes of these anomalies are
loss of the geneti... 阅读全帖
http://www.colorado.gov/cs/Satellite?
blobcol=urldata&blobheadername1=Content-
Disposition&blobheadername2=Content-
Type&blobheadervalue1=inline%3B+filename%3D%22Colorado+Anti-
Discrimination+Act+statutes+-
+unofficial.pdf%22&blobheadervalue2=application%2Fpdf&blobkey=id&blobtab
le=MungoBlobs&blobwhere=1251818317123&ssbinary=true
你可以搜搜 CADA 24-34-601
24-34-601. Discrimination in
places of public accommodation
(1) As used in this part 6, “place of public accommodation”
means any place of busines... 阅读全帖
http://finance.yahoo.com/news/9-unbelievable-student-loan-horro
512874.html
这钱哈时候还完啊
With the cost of college continuing to rise and the economy still stagnating
, the student debt burden has swollen to a record $1 trillion.
Mark Kantrowitz, publisher of Fastweb.com and FinAid.org, believes that one
of the main culprits behind the student debt crisis is the private student l
oan sector.
"Students are following their dreams and don't pay attention to their debt,"
Kantrowitz says. "They sign whate... 阅读全帖
The first state law mandating vaccination was enacted in Massachusetts
in 1809; in 1855, Massachusetts became the first state to enact a
school vaccination re-quirement. The constitutional basis of vaccination
requirements rests in the po-lice power of the state. Nearly 100 years ago,
the U.S. Supreme Court issued its landmark ruling in Jacobson v.
Massachusetts, upholding the right of states to compel vaccination. The
Court held that a health regulation requiring small- pox vaccinat... 阅读全帖
The Court held that a health regulation requiring small- pox vaccination was
a reasonable exercise of the state’s police power that did not violate the
liberty rights of individuals under the Fourteenth Amendment to the U.S.
Constitution. The police power is the authority reserved to the states by
the Constitution and embraces “such reasonable regulations established di-
rectly by legislative enactment as will protect the public health and the
public safety”
the Court spe-cifically rejecte... 阅读全帖
Date: 2010-04-09, 12:18PM PDT
Reply to: see below
Don't buy overpriced iPads from jerks on Craigslist!!!
There are still plenty available at the apple store. Please don't encourage
people to buy iPads on spec and sell them for more than they're worth. Folks
who do that are jerks, and they don't deserve to make a profit on the incor
rect notion that iPads are scarce when there are plenty still readily availa
ble from legitimate vendors.
Location:
it's NOT ok to contact this poster with services o
just some naive code:
int left, right;
int rectArea;
for(int i = 0; i < size; i++)
{
//for each Histo[i] as the lowest rect, we find left and right >=
Histo[i]
//check left
for(left = i; left >=0; left--)
{
if(Histo[left] < Histo[i])
break;
}
left++;
//check right
for(right = i; right < size; right++)
{
if(Histo[right] < Histo[i])
break;
}
If you model this way, the answer is not the longest path, but the shape.
Since it wants the rectangles that all overlapping. In the following setup,
the answer is (1, 2, 5)
The longest path is 3,1,2,4,5
Rect ID (Overlap with ID)
1 (2, 3, 5)
2 (1, 4, 5)
3 (1)
4 (2, 5)
5 (1, 2, 4)
Please let me know if you are interested. I can forward your resume to HM di
rectly.
This position is in Seattle, WA. It's an experienced hire (level 6).
Job Description
Amazon's Global Retail Catalog Tools team is responsible for developing inno
vative and user-friendly applications to help retail business owners to mana
ge the worldwide retail catalog. Our large scale web applications running o
n distributed systems have direct and critical business impact. We are look
ing for an experienced... 阅读全帖