Note: This article is available in Chinese only. 本文暂无英文版本。
View original
codeforces #306 div 2 A - Two Substrings(随便搞)
Related
codeforces #322 div 2 B. Luxurious Houses (思路)
B. Luxurious Houses
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
The capital of Berland has n multifloor buildings. The architect who built up the capital was very creative, so all the houses were built in one row.
Let’s enumerate all the houses from left to right, starting with one. A house is considered to be luxurious if the number of floors in it is strictly greater than in all the houses with larger numbers. In other words, a house is luxurious if the number of floors in it is strictly greater than in all the houses, which are located to the right from it. In this task it is assumed that the heights of floors in the houses are the same.
uva 1587 Box(思路)
给6个矩形的长和宽(或者宽和长),问这六个矩形能否组成一个长方体.
思路比较简单,不过需要注意的地方有点多.
首先由于长和宽的顺序为止,所以要处理一下(一开始只处理了后来读入的五组,没有处理单独读入的第一组,差评)
codeforces 560 C. Gerald's Hexagon (思维,几何)
题意:给定一个六边形的六条边的长,问能分割成多少个单位正三角形.
分割不好办,那我们就反着来,先补成一个包含这个六边形的正三角形.
对于边长为a的正三角形,显然我们可以分割成a*a个单位正三角形
codeforces #322 div 2 D. Three Logos (枚举)
·1452 words·3 mins
D. Three Logos
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area.
Advertisers will put up the ad only if it is possible to place all three logos on the billboard so that they do not overlap and the billboard has no empty space left. When you put a logo on the billboard, you should rotate it so that the sides were parallel to the sides of the billboard.
hdu 5481||bestcoder #57 div 2 C Desiderium (概率)
Desiderium # **Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 427 Accepted Submission(s): 167 **
Problem Description
There is a set of intervals, the size of this set is n.
If we select a subset of this set with equal probability, how many the expected length of intervals’ union of this subset is?
We assume that the length of empty set’s union is 0, and we want the answer multiply 2n modulo 109+7.