ACM: uva 1073 - Glenbow Museum
来源:互联网 发布:网络延迟多少ms算正常 编辑:程序博客网 时间:2024/05/16 14:29
Glenbow Museum
The famous Glenbow Museum in Calgary is WesternCanada's largest museum, with exhibits ranging from art to culturalhistory to mineralogy. A brand new section is being planned,devoted to brilliant computer programmers just like you.Unfortunately, due to lack of space, the museum is going to have tobuild a brand new building and relocate into it.
The size and capacity of the new building differfrom those of the original building. But the floor plans of bothbuildings are orthogonal polygons. An orthogonal polygon is apolygon whose internal angles are either 90° or 270°. If 90° anglesare denoted as R (Right) and 270° angles are denoted as O (Obtuse)then a string containing only R and O can roughly describe anorthogonal polygon. For example, a rectangle (Figure 1) is thesimplest orthogonal polygon and it can be described as RRRR (theangles are listed in counter-clockwise order, starting from anycorner). Similarly, a cross-shaped orthogonal polygon (Figure 2)can be described by the sequence RRORRORRORRO, RORRORRORROR, orORRORRORRORR. These sequences are called
Of course, an angle string does not completelyspecify the shape of a polygon -- it says nothing about the lengthof the sides. And some angle strings cannot possibly describe avalid orthogonal polygon (RRROR, for example).
To complicate things further, not all orthogonalpolygons are acceptable floor plans for the museum. A museumcontains many valuable objects, and these objects must be guarded.Due to cost considerations, no floor can have more than one guard.So a floor plan is acceptable only if there is a place within thefloor from which one guard can see the entire floor. Similarly, anangle string is acceptable only if it describes at least oneacceptable polygon. Note that the cross-shaped polygon in Figure 2can be guarded by someone standing in the center, so it isacceptable. Thus the angle string RRORRORRORRO is acceptable, eventhough it also describes other polygons that cannot be properlyguarded by a single guard.
Help the designers of the new building determinehow many acceptable angle strings there are of a given length.
Input
The input file contains several test cases. Eachtest case consists of a line containing a positiveinteger
Output
For each test case, print a line containing thetest case number (beginning with 1) followed by the number ofacceptable angle strings of the given length. Follow the format ofthe sample output.
SampleInput
4
6
0
SampleOutput
Case 1: 1
Case 2: 6
题意: Glenbow博物馆要建直角多边形的地面, 要求这个多边形有一个点可以看到边界上每一个点. 并且
解题思路:
代码:
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
#define MAX 1005
typedef long long ll;
int n;
ll dp[MAX][MAX][2][2];
void init()
{
}
int main()
{
//
}
- ACM: uva 1073 - Glenbow Museum
- ACM: uva 1335 - Beijing Guards
- ACM: uva 10391 - Compound Words
- ACM: uva 10534 - Wavio Sequence
- ACM: uva 11538 - Chess Queen
- ACM: 数学题 uva 11300
- ACM: uva 11584 -
- ACM: uva 11464
- ACM: uva 3902
- ACM: uva 10382
- ACM: uva 11134
- hdoj acm 1008
- ACM: uva 11174 - Stand in a Line
- ACM: uva 1276 - Network
- ACM: uva 1450 - Airport
- ACM: uva 1467 - Installations
- ACM: uva 10125 - Sumsets
- ACM: uva 1451 - Average
- ACM: uva 11401 - Triangle Counti…
- ACM: uva 11375 - Matches
- ACM: uva 11174 - Stand in a Line
- ACM: uva 1362 -&n…
- ACM: uva 11361 -&…
- ACM: uva 1073 - Glenbow Museum
- ACM: uva 10253 - Series-Parallel…
- ACM: uva 1069 -&n…
- ACM: uva 11426 -&…
- java之ReentrantLock公平锁和非公平锁
- 洛谷P1156 垃圾陷阱
- Python中List二维数组
- 禁用cookie后session是如何设置的(第一个)
- 最长公共子序列(LCS)