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

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>
            男女精品视频| 美女视频网站黄色亚洲| 欧美一二三区在线观看| 日韩视频在线永久播放| 亚洲日本va午夜在线电影| 狠狠色狠狠色综合日日tαg| 亚洲一品av免费观看| 亚洲毛片在线看| 亚洲精品国产精品国产自| 欧美有码在线视频| 久久久久久香蕉网| 亚洲第一精品福利| 亚洲激情国产| 一区二区三区视频免费在线观看 | 在线观看一区二区视频| 在线播放日韩专区| 99国产一区二区三精品乱码| 在线综合亚洲| 欧美影视一区| 欧美+日本+国产+在线a∨观看| 欧美国产日韩a欧美在线观看| 亚洲精品资源美女情侣酒店| 亚洲在线成人精品| 欧美超级免费视 在线| 欧美午夜精品久久久久久人妖| 国产日韩一区二区| 亚洲理论在线| 久久久久久综合| 99国产精品久久久久老师| 久久精品国产一区二区三区| 欧美区二区三区| 在线成人国产| 欧美一进一出视频| 亚洲欧洲精品成人久久奇米网| 欧美伊人精品成人久久综合97| 欧美噜噜久久久xxx| 国产中文一区二区| 亚洲性感激情| 亚洲国产成人高清精品| 欧美亚洲一级片| 欧美精品一区二区三区在线看午夜 | 亚洲午夜av在线| 欧美国产先锋| 欧美亚洲一级片| 国产精品久久久久久久7电影 | 亚洲福利在线观看| 午夜亚洲视频| 亚洲精品久久久久久久久| 久久精品一区二区三区四区 | 久久偷看各类wc女厕嘘嘘偷窃| 国产精品久久久久一区二区三区共 | 午夜影视日本亚洲欧洲精品| 欧美精品福利在线| 一区在线视频| 久久国产高清| 香蕉久久夜色| 国产精品区一区| 中日韩男男gay无套| 蜜桃久久av| 久久三级视频| 亚洲国产一区二区视频| 欧美gay视频| 麻豆亚洲精品| 日韩一区二区精品| 亚洲破处大片| 欧美日一区二区在线观看 | 一区二区三区四区五区精品| 亚洲激情在线播放| 欧美国产激情二区三区| 99精品视频一区| 日韩一二三区视频| 国产精品成人v| 久久精品国产99精品国产亚洲性色| 亚洲综合精品| 国产一区二区看久久| 久久频这里精品99香蕉| 老司机精品视频网站| 亚洲三级免费观看| 一区二区三区欧美激情| 国产欧美精品日韩区二区麻豆天美| 久久精品一级爱片| 麻豆精品视频在线| 这里是久久伊人| 篠田优中文在线播放第一区| 亚洲丰满在线| 一区二区三区精品| 黄色成人91| 亚洲精品一区二区三区樱花| 国产精品午夜国产小视频| 久久亚洲一区二区| 欧美精品免费观看二区| 亚洲欧美国产毛片在线| 久久久在线视频| 亚洲香蕉网站| 毛片一区二区| 性做久久久久久免费观看欧美| 久久午夜精品一区二区| 亚洲一区黄色| 久久久噜噜噜久噜久久| 亚洲性夜色噜噜噜7777| 久久久无码精品亚洲日韩按摩| 在线视频欧美精品| 久久久久久久久久久久久女国产乱 | 欧美在线观看日本一区| 亚洲高清久久| 国产欧美日韩亚州综合| 亚洲激情视频| 激情欧美一区二区| 亚洲午夜久久久久久尤物 | 国产精品蜜臀在线观看| 欧美1区2区| 国产日本欧美一区二区| 99精品国产热久久91蜜凸| 亚洲电影免费观看高清| 午夜视频久久久| 亚洲欧美色婷婷| 欧美不卡一区| 欧美成人午夜免费视在线看片| 国产精品欧美久久久久无广告| 亚洲激情在线观看| 亚洲高清网站| 久久全球大尺度高清视频| 久久精品成人| 国产伦精品一区| 亚洲性感激情| 亚洲尤物视频网| 欧美日韩成人在线播放| 欧美搞黄网站| 亚洲福利精品| 免费观看不卡av| 亚洲成色777777女色窝| 伊人久久av导航| 久久久久久穴| 嫩草影视亚洲| 亚洲欧洲精品一区| 美日韩丰满少妇在线观看| 巨乳诱惑日韩免费av| 国产婷婷色一区二区三区在线| 亚洲欧美激情一区| 欧美淫片网站| 国内精品久久久久久久97牛牛| 欧美一级欧美一级在线播放| 久久久久国产一区二区三区四区 | 欧美日韩大陆在线| 亚洲美女精品久久| 在线亚洲免费视频| 国产精品国产馆在线真实露脸| 这里只有精品丝袜| 欧美在线观看视频| 影音先锋国产精品| 欧美xx视频| 日韩午夜av在线| 亚洲欧美日韩国产一区| 国产伦精品一区| 久久天堂国产精品| 亚洲国产精品电影在线观看| 夜夜狂射影院欧美极品| 国产精品yjizz| 欧美一区在线直播| 亚洲成色777777在线观看影院| 一区二区日韩免费看| 国产精品视频成人| 久久国内精品自在自线400部| 欧美成人精精品一区二区频| 9人人澡人人爽人人精品| 国产精品久久久久久久久婷婷 | 久久综合久久久久88| 亚洲第一福利在线观看| 国产伦精品一区| 看欧美日韩国产| 亚洲最新在线| 久久婷婷国产综合国色天香| 亚洲美女在线国产| 久久九九国产精品| 91久久在线| 国产精品美腿一区在线看| 久久亚洲高清| 亚洲宅男天堂在线观看无病毒| 老司机免费视频一区二区三区| 一区二区三区国产盗摄| 国产一区二区0| 欧美日韩美女在线观看| 久久国产婷婷国产香蕉| 99爱精品视频| 欧美高清视频www夜色资源网| 亚洲欧美日韩一区二区| 亚洲精品韩国| 国语自产精品视频在线看8查询8| 欧美精品激情| 久久亚洲私人国产精品va媚药| 在线中文字幕一区| 欧美福利一区二区三区| 久久精品在线视频| 亚洲一区视频在线| 最近中文字幕日韩精品| 黄色日韩网站| 国产一区二区三区在线观看视频| 国产精品成人一区二区三区夜夜夜| 蜜桃av综合| 乱人伦精品视频在线观看|