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

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 極限定律 閱讀(1037) 評論(0)  編輯 收藏 引用 所屬分類: ACM-ICPC World Final 2008題解

<2009年8月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345

導航

統計

常用鏈接

留言簿(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>
            欧美一区成人| 日韩亚洲欧美中文三级| 欧美在线黄色| 亚洲福利电影| 亚洲综合视频在线| 欧美人妖另类| 最新日韩av| 美国十次了思思久久精品导航| 在线视频精品| 欧美日韩亚洲一区二区| 亚洲国产成人久久综合一区| 香蕉精品999视频一区二区 | 欧美久久久久免费| 亚洲日本电影在线| 欧美大尺度在线观看| 久久久综合视频| 黑人巨大精品欧美一区二区 | 久久这里有精品15一区二区三区| 国产精品揄拍500视频| 午夜日韩在线观看| 亚洲男同1069视频| 国产亚洲欧美日韩日本| 久久深夜福利| 噜噜噜在线观看免费视频日韩| 亚洲国产综合视频在线观看| 欧美大片一区二区| 欧美经典一区二区| 亚洲影院色在线观看免费| 宅男精品视频| 国产亚洲综合精品| 久久亚洲精品一区| 毛片一区二区| 中文网丁香综合网| 在线中文字幕日韩| 国产精品资源| 美女脱光内衣内裤视频久久影院 | 国产九色精品成人porny| 欧美一区在线视频| 久久看片网站| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲精品午夜精品| 国产精品久久久久久久久久久久| 羞羞视频在线观看欧美| 久久国产精品久久久| 欧美在线1区| 亚洲国产专区校园欧美| 日韩一级免费观看| 国产日韩在线亚洲字幕中文| 国产亚洲欧美激情| 欧美不卡三区| 欧美系列电影免费观看| 久久久久一区| 欧美日本亚洲视频| 久久国产精品久久久久久| 欧美成年人视频网站| 午夜精品国产| 欧美韩日一区| 久久亚洲色图| 国产精品扒开腿做爽爽爽视频| 久久综合99re88久久爱| 欧美日一区二区三区在线观看国产免 | 亚洲精选国产| 香蕉久久一区二区不卡无毒影院| 亚洲激情在线观看视频免费| 亚洲一区日韩| 99精品国产福利在线观看免费| 欧美一级大片在线观看| 在线亚洲免费| 欧美激情精品久久久久久免费印度| 欧美伊人久久久久久久久影院| 欧美福利专区| 女人香蕉久久**毛片精品| 国产精品欧美在线| 日韩天堂av| 亚洲精品女av网站| 久久蜜桃资源一区二区老牛| 欧美亚洲免费高清在线观看| 欧美日韩国产欧| 亚洲国内精品在线| 亚洲第一福利视频| 久久久999成人| 久久久久久亚洲综合影院红桃| 国产精品日本一区二区| 99视频+国产日韩欧美| 一本久久综合亚洲鲁鲁五月天| 麻豆9191精品国产| 免费欧美网站| 影音先锋另类| 久久亚洲美女| 欧美91精品| 在线电影国产精品| 久久综合网络一区二区| 欧美成人一区二区三区在线观看| 国产字幕视频一区二区| 久久av免费一区| 久热精品视频在线观看| 依依成人综合视频| 久热精品视频在线观看一区| 美女视频网站黄色亚洲| 亚洲国产欧美在线| 欧美国产第一页| 99热精品在线| 欧美在线视频观看| 国内精品伊人久久久久av一坑| 久久精品国产亚洲一区二区三区| 久热国产精品| 日韩一级在线| 国产精品嫩草99av在线| 性一交一乱一区二区洋洋av| 最新高清无码专区| 欧美女同视频| 亚洲欧美经典视频| 久久视频一区| 亚洲精品视频免费在线观看| 欧美日韩在线精品一区二区三区| 亚洲午夜精品视频| 久久人91精品久久久久久不卡| 亚洲黄色尤物视频| 欧美色视频一区| 久久激情五月婷婷| 亚洲激情校园春色| 亚洲午夜女主播在线直播| 国产人妖伪娘一区91| 久久蜜桃精品| 一本久久a久久免费精品不卡| 欧美在线观看一区| 亚洲福利专区| 欧美日韩在线视频一区二区| 午夜精品美女自拍福到在线| 免费成人黄色片| 亚洲欧美国产精品va在线观看 | 欧美成人四级电影| 在线亚洲免费| 在线观看欧美亚洲| 欧美色网一区二区| 久久漫画官网| 亚洲愉拍自拍另类高清精品| 欧美大尺度在线| 欧美中文字幕精品| 一区二区三区欧美在线观看| 国产一区清纯| 国产精品福利av| 欧美成人在线免费视频| 亚洲欧美视频一区| 91久久精品美女| 老司机午夜精品视频| 亚洲一二三区在线观看| 亚洲国产精品综合| 国产亚洲欧洲| 国产精品久久久久久久久免费| 麻豆av一区二区三区久久| 亚洲欧美日韩一区在线| 亚洲精品一区二区三区四区高清| 久久久午夜电影| 午夜国产精品影院在线观看 | 亚洲一区二区三区精品视频 | 亚洲乱码国产乱码精品精可以看| 久久久亚洲精品一区二区三区| 亚洲午夜视频在线观看| 亚洲人成艺术| 国内一区二区在线视频观看| 国产精品海角社区在线观看| 欧美精品免费观看二区| 免费观看日韩av| 久久精品亚洲精品| 欧美与黑人午夜性猛交久久久| 亚洲一区二区三区四区五区黄| 久久疯狂做爰流白浆xx| 亚洲天堂偷拍| 亚洲一区二区高清| 一区二区欧美视频| 99在线精品视频在线观看| 亚洲破处大片| 日韩一区二区福利| 一本久久综合亚洲鲁鲁| 一区二区电影免费观看| 一区二区三区欧美激情| 99av国产精品欲麻豆| 9色精品在线| 日韩午夜精品| 一区二区三区欧美激情| 久久久五月婷婷| 欧美成人精品激情在线观看 | 噜噜噜噜噜久久久久久91| 久久精品国产精品亚洲| 久久精品亚洲乱码伦伦中文| 久久久久国产精品麻豆ai换脸| 久久国产一二区| 毛片基地黄久久久久久天堂| 欧美成人一品| 欧美视频免费在线观看| 国产精品网站在线播放| 国产在线欧美日韩| 亚洲福利视频免费观看| 日韩一级在线观看| 亚洲欧美国产77777| 久久久午夜电影| 亚洲激情在线观看| 亚洲午夜精品久久久久久浪潮| 欧美一级黄色录像|