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

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 極限定律 閱讀(1033) 評論(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>
            亚洲精品在线视频观看| 欧美在线二区| 欧美激情bt| 欧美成黄导航| 99在线精品免费视频九九视| 亚洲国产婷婷| 麻豆精品一区二区av白丝在线| 影音先锋一区| 日韩图片一区| 国产亚洲精品bt天堂精选| 久久精品日韩一区二区三区| 美女国产一区| 亚洲一区二区三区免费视频| 亚洲在线成人| 亚洲欧洲日产国码二区| 亚洲美女视频在线观看| 国内精品久久久久影院 日本资源| 男人插女人欧美| 欧美日韩综合另类| 久久乐国产精品| 欧美另类久久久品| 亚洲欧美日韩国产中文在线| 久久av一区| 99精品久久久| 久久久www成人免费毛片麻豆| 99国产精品自拍| 久久激情视频| 亚洲一区二区三区中文字幕| 久久视频免费观看| 午夜精品久久久久| 欧美黄免费看| 久久久精品一品道一区| 欧美日韩免费高清一区色橹橹| 久久精品系列| 国产精品区一区二区三区| 欧美高清在线观看| 国产午夜久久久久| 一本色道久久综合狠狠躁篇的优点 | 欧美福利视频在线| 国产精品每日更新在线播放网址| 久久久人成影片一区二区三区观看| 欧美成年人视频网站| 久久精品国产免费观看| 欧美日韩激情网| 亚洲成人在线视频播放 | 欧美国产日产韩国视频| 久久久久国产一区二区三区| 欧美日韩小视频| 欧美成人亚洲成人| 国产在线播放一区二区三区| 亚洲亚洲精品三区日韩精品在线视频 | 欧美一区三区三区高中清蜜桃| 美女黄毛**国产精品啪啪| 亚洲欧美久久久| 欧美激情精品久久久久久黑人| 一区二区欧美在线观看| 亚洲精品亚洲人成人网| 亚洲电影免费在线| 午夜久久电影网| 欧美亚洲免费在线| 国产精品日韩一区二区| 中日韩美女免费视频网址在线观看| 日韩一级黄色大片| 欧美精品在线观看播放| 亚洲精品看片| 夜夜嗨av一区二区三区中文字幕| 毛片一区二区三区| 久久亚洲一区| 在线精品福利| 蜜乳av另类精品一区二区| 欧美激情第9页| 亚洲大片免费看| 你懂的国产精品| 亚洲精品日产精品乱码不卡| 一本久久综合亚洲鲁鲁五月天| 欧美v亚洲v综合ⅴ国产v| 男人的天堂亚洲| 亚洲精品视频在线观看免费| 欧美一区二区精品久久911| 午夜久久黄色| 国内自拍一区| 蜜臀av性久久久久蜜臀aⅴ四虎| 美国成人直播| 亚洲激情自拍| 欧美日韩国产小视频| 一区二区三区高清视频在线观看 | 国产日本欧美一区二区三区| 久久狠狠婷婷| 亚洲精品一区二区三| 亚洲欧美日韩直播| 国产一区二区在线免费观看| 久久亚洲捆绑美女| 亚洲精选视频在线| 欧美伊人久久大香线蕉综合69| 国产精品成人一区二区| 久久精品中文| 亚洲看片免费| 久久精品在线| 亚洲人成人一区二区三区| 欧美日韩中文在线观看| 欧美一级夜夜爽| 亚洲第一综合天堂另类专| 99国内精品久久| 国产精品视频男人的天堂| 久久亚洲精选| 亚洲一级电影| 欧美成人激情视频| 在线成人免费观看| 国产精品推荐精品| 欧美激情亚洲一区| 欧美在线欧美在线| 一区二区三区 在线观看视频| 久久蜜臀精品av| 亚洲欧美日韩国产| 一区二区三区 在线观看视频| 国外成人在线视频| 国产精品欧美一区喷水| 欧美高清视频一区二区三区在线观看 | 亚洲啪啪91| 久久这里有精品视频| 亚洲欧美日韩精品久久久| 亚洲精品中文字幕在线观看| 国产一区在线播放| 国产精品人人做人人爽人人添| 久久综合狠狠综合久久综青草| 亚洲影视在线| 在线亚洲高清视频| 最新国产精品拍自在线播放| 老司机成人网| 久久这里有精品15一区二区三区| 香蕉av福利精品导航| 亚洲影院色在线观看免费| 日韩午夜黄色| 亚洲精品欧美| 极品少妇一区二区三区精品视频 | 欧美一区二区| 亚洲一区免费网站| 中文精品视频| 艳妇臀荡乳欲伦亚洲一区| 蜜桃av一区二区三区| 久久久夜色精品亚洲| 久久精品毛片| 久久久久一区二区| 久久综合久久88| 久久免费视频在线观看| 久久久国际精品| 久久综合激情| 欧美bbbxxxxx| 亚洲第一区色| 久久综合中文| 亚洲国产成人不卡| 亚洲国产激情| 亚洲精选中文字幕| 国产精品99久久不卡二区| 亚洲美女毛片| 一区二区三区久久久| 亚洲一区区二区| 久久精品人人做人人爽| 久久人人爽人人爽| 欧美成人免费小视频| 欧美a级一区二区| 欧美理论电影在线播放| 国产精品美女一区二区在线观看| 国产欧美日本一区二区三区| 国产一区二区三区在线免费观看 | 亚洲中午字幕| 久久免费国产| 亚洲黄色三级| 亚洲视频在线视频| 久久久久久高潮国产精品视| 蜜臀久久99精品久久久久久9| 欧美精品一区二区三区久久久竹菊| 欧美三级午夜理伦三级中视频| 国产精品视频精品视频| 在线观看国产日韩| 亚洲一区二区三区在线播放| 老妇喷水一区二区三区| 亚洲精品免费一二三区| 欧美一级视频一区二区| 欧美日韩国产成人在线91| 国产欧美一区在线| 日韩午夜在线电影| 久久精品日韩| 99伊人成综合| 噜噜噜噜噜久久久久久91| 国产精品乱码一区二区三区| 韩曰欧美视频免费观看| 国产精品99久久久久久久久久久久 | 99re6这里只有精品视频在线观看| 香港久久久电影| 亚洲精品日本| 蜜臀av国产精品久久久久| 国产午夜精品一区二区三区视频| 亚洲精品视频在线看| 久久综合色播五月| 亚洲一区二区视频| 欧美精品aa| 在线观看日韩www视频免费| 性感少妇一区| 99精品视频一区|