青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Problem F : Glenbow Museum

The famous Glenbow Museum in Calgary is Western Canada’s largest museum, with exhibits ranging from art to
cultural history 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 to build a brand new building and relocate
into it.

The size and capacity of the new building differ from those of the original building. But the floor plans of both
buildings are orthogonal polygons. An orthogonal polygon is a polygon whose internal angles are either 90° or 270°.
If 90° angles are denoted as R (Right) and 270° angles are denoted as O (Obtuse) then a string containing only R and
O can roughly describe an orthogonal polygon. For example, a rectangle (Figure 1) is the simplest orthogonal
polygon and it can be described as RRRR (the angles are listed in counter-clockwise order, starting from any corner).
Similarly, a cross-shaped orthogonal polygon (Figure 2) can be described by the sequence RRORRORRORRO,
RORRORRORROR, or ORRORRORRORR. These sequences are called angle strings.

        Figure 1: A rectangle              Figure 2: A cross-shaped polygon
Of course, an angle string does not completely specify the shape of a polygon – it says nothing about the length of
the sides. And some angle strings cannot possibly describe a valid orthogonal polygon (RRROR, for example).

To complicate things further, not all orthogonal polygons are acceptable floor plans for the museum. A museum
contains 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 the floor from which one guard can
see the entire floor. Similarly, an angle string is acceptable only if it describes at least one acceptable polygon. Note
that the cross-shaped polygon in Figure 2 can be guarded by someone standing in the center, so it is acceptable. Thus
the angle string RRORRORRORRO is acceptable, even though it also describes other polygons that cannot be
properly guarded by a single guard.

Help the designers of the new building determine how many acceptable angle strings there are of a given length.

Input
The input file contains several test cases. Each test case consists of a line containing a positive integer L (1≤L≤1000),
which is the desired length of an angle string.

The input will end with a line containing a single zero.

Output
For each test case, print a line containing the test case number (beginning with 1) followed by the number of
acceptable angle strings of the given length. Follow the format of the sample output.

Sample Input
4
6
0

Output for the Sample Input
Case 1: 1
Case 2: 6

    從一個所有邊都平行于坐標系的多邊形的任一頂點出發,逆時針遍歷,記錄每次經過的頂點處的轉角,組成的字符串叫做angle string。求指定長度的angle string中,能表示至少一個星形多邊形的串個數。 
    顯然當l=2k+1時,解不存在;當l=2k時,設m=(l+4)/2,根據組合數的知識,所求結果為C(m,4)+C(m-1,4)。
400016  2009-04-24 04:51:44  Accepted  0.000  Minimum  19193  C++  4123 - Glenbow Museum
 1 #include <iostream>
 2 using namespace std;
 3 
 4 typedef long long LL;
 5 inline LL cal(LL n){             //C(n,4) 
 6     return n*(n-1)*(n-2)*(n-3)/24;
 7 }
 8 int main(){
 9     int ca=1;
10     LL n;
11     while(cin>>n,n){
12         if(n & 1)
13             cout<<"Case "<<ca++<<""<<0<<endl;
14         else{
15             n=(n+4)>>1;
16             cout<<"Case "<<ca++<<""<<cal(n)+cal(n-1)<<endl;
17         }
18     }
19     return 0;
20 }

posted on 2009-04-24 11:32 極限定律 閱讀(1039) 評論(0)  編輯 收藏 引用 所屬分類: ACM-ICPC World Final 2008題解

<2009年4月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

導航

統計

常用鏈接

留言簿(10)

隨筆分類

隨筆檔案

友情鏈接

搜索

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            好看的亚洲午夜视频在线| 久久激情五月丁香伊人| 亚洲视频综合| 国产精品欧美一区喷水| 久久精品国产亚洲精品| 久久免费黄色| 亚洲精品欧美| 一区二区欧美日韩| 国产亚洲毛片| 亚洲成人中文| 欧美福利在线观看| 一本色道久久综合亚洲精品按摩| 欧美国产乱视频| 欧美好骚综合网| 日韩一级大片在线| 亚洲视频一二| 国产午夜精品久久久| 欧美福利小视频| 欧美三区免费完整视频在线观看| 今天的高清视频免费播放成人 | 欧美有码在线视频| 欧美va亚洲va日韩∨a综合色| 欧美r片在线| 美女露胸一区二区三区| 一本大道久久a久久精品综合| 亚洲国产成人av在线| 欧美色网在线| 久久视频一区二区| 欧美日韩性视频在线| 久久国产精品久久久久久电车| av成人免费在线观看| 国产日本精品| 亚洲国产你懂的| 国产精品色在线| 欧美成人四级电影| 国产精品久久久久aaaa| 欧美成人一区二区| 国产精品久久久久久久9999 | 亚洲欧美日韩在线一区| 亚洲国产91精品在线观看| 中日韩高清电影网| 136国产福利精品导航网址应用| 久久理论片午夜琪琪电影网| 欧美成人激情在线| 性欧美精品高清| 欧美www在线| 久久久国产成人精品| 欧美日韩国产美| 免费观看欧美在线视频的网站| 免费观看一区| 久久精品99| 欧美日韩一区成人| 欧美福利专区| 国产亚洲成年网址在线观看| 亚洲蜜桃精久久久久久久| 激情欧美丁香| 亚洲一区3d动漫同人无遮挡| 亚洲剧情一区二区| 久久国产精品电影| 亚洲免费在线视频| 欧美精品成人91久久久久久久| 中文国产一区| 嫩草影视亚洲| 久久全国免费视频| 国产精品一级在线| 日韩系列欧美系列| 91久久线看在观草草青青| 久久av老司机精品网站导航| 亚洲尤物视频网| 欧美精品一卡| 欧美成人免费全部| 狠狠色丁香婷婷综合| 中文精品视频一区二区在线观看| 国产一区二区三区精品久久久| 免费在线观看一区二区| 国产农村妇女精品| 99国产精品国产精品毛片| 亚洲日本一区二区| aa级大片欧美| 欧美在线视频在线播放完整版免费观看 | 亚洲高清精品中出| 激情欧美一区二区| 亚洲欧美日韩一区二区在线 | 国内免费精品永久在线视频| 亚洲午夜激情网站| 亚洲性图久久| 麻豆精品91| 美女任你摸久久| 激情文学一区| 欧美在线资源| 欧美在线观看网址综合| 国产精品免费久久久久久| 一区二区免费在线观看| 亚洲一区综合| 欧美色综合网| 妖精视频成人观看www| 日韩视频永久免费| 欧美激情一区二区三区在线视频| 亚欧成人在线| 国产精品视频免费在线观看| 亚洲裸体在线观看| 一区二区欧美在线观看| 欧美精品一区二区精品网| 亚洲精品视频中文字幕| 99热在这里有精品免费| 欧美日韩ab片| 亚洲精选在线| 一区二区三区色| 欧美美女bbbb| 日韩视频免费| 在线亚洲免费视频| 欧美视频免费在线观看| 亚洲深夜福利网站| 香蕉成人伊视频在线观看| 国产精品亚洲不卡a| 欧美亚洲专区| 麻豆亚洲精品| 亚洲国产一区二区a毛片| 蜜臀av国产精品久久久久| 欧美激情综合| 日韩一级免费| 欧美色图天堂网| 亚洲女女女同性video| 欧美一区二区三区四区高清 | 国语对白精品一区二区| 欧美亚洲视频一区二区| 麻豆精品91| 亚洲精品乱码久久久久久按摩观| 亚洲免费视频观看| 欧美日韩一区综合| 免费影视亚洲| 一区电影在线观看| 国产精品日韩在线播放| 欧美专区日韩视频| 欧美激情精品久久久久久久变态| 欧美日韩视频在线一区二区观看视频| 久久亚洲国产成人| 亚洲国产美女久久久久| 欧美理论大片| 亚洲欧美日韩国产成人精品影院| 亚洲欧美韩国| 国产一区二区三区自拍| 久久婷婷国产麻豆91天堂| 亚洲人成亚洲人成在线观看图片 | 午夜精品短视频| 免费在线亚洲欧美| 一区二区精品在线| 国产精品永久免费| 久久亚洲精品中文字幕冲田杏梨| 久热re这里精品视频在线6| 亚洲精品视频一区二区三区| 国产精品久久久久9999| 久久久精品日韩| 亚洲精品乱码久久久久久黑人| 亚洲精品视频免费观看| 国产精品实拍| 久久久久久久波多野高潮日日| 久久亚洲精品欧美| 亚洲理论在线| 国产精品一区免费在线观看| 麻豆精品在线播放| 亚洲一区二区免费看| 免费不卡视频| 亚洲手机在线| 伊人夜夜躁av伊人久久| 欧美日韩亚洲一区二| 久久精品视频免费| 一区二区三区av| 男女视频一区二区| 亚洲性xxxx| 亚洲国产一区二区视频| 国产精品久久久久久超碰| 美女脱光内衣内裤视频久久影院 | 日韩午夜电影在线观看| 久久久久网址| 亚洲午夜视频| 亚洲国产欧美一区二区三区久久| 欧美+日本+国产+在线a∨观看| 欧美福利小视频| 欧美一区二区视频网站| 亚洲欧洲一二三| 国产夜色精品一区二区av| 欧美日韩精品一区二区三区四区| 日韩视频免费| 另类av一区二区| 午夜视频久久久| 亚洲精选视频在线| 国产一区视频网站| 国产精品成人一区二区三区夜夜夜 | 亚洲国产高清视频| 欧美一区二区三区四区夜夜大片| 国产亚洲欧美一级| 欧美日韩喷水| 麻豆精品视频在线| 欧美在线一区二区三区| 亚洲综合社区| 99国产精品一区| 亚洲成人在线视频播放 | 蜜乳av另类精品一区二区| 中文欧美在线视频|