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

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>
            日韩特黄影片| 欧美日韩激情小视频| 亚洲第一福利社区| 欧美一区二区日韩一区二区| 中文精品视频| 亚洲一区精品视频| 久久动漫亚洲| 欧美激情导航| 欧美777四色影视在线| 亚洲高清久久网| 一片黄亚洲嫩模| 亚洲免费视频观看| 久久午夜视频| 欧美乱人伦中文字幕在线| 欧美日韩一区在线观看视频| 国产精品视频999| 亚洲高清在线观看| 中文精品视频| 欧美freesex8一10精品| 一区二区91| 麻豆久久精品| 国产精品日韩久久久| 在线成人国产| 亚洲影音一区| 男女视频一区二区| 亚洲一卡久久| 欧美国产综合一区二区| 国产麻豆精品theporn| 亚洲激情电影中文字幕| 欧美在线视频导航| 亚洲午夜激情| 亚洲国产日韩在线一区模特| 一区二区三区你懂的| 久久国产精品色婷婷| 亚洲二区视频| 久久se精品一区精品二区| 欧美日韩免费一区二区三区视频 | 亚洲日韩中文字幕在线播放| 亚洲一区在线观看视频| 欧美成人午夜视频| 性欧美大战久久久久久久久| 欧美日韩不卡一区| 亚洲国产欧美另类丝袜| 久久成人免费| 亚洲视频axxx| 欧美日韩国产免费观看| 亚洲国产精品va在线看黑人动漫| 欧美一区二区成人| 日韩午夜在线电影| 欧美国产日本| 亚洲精品国精品久久99热一| 欧美一区二区精品久久911| 99国产精品视频免费观看一公开| 欧美不卡一区| 亚洲激情网址| 欧美激情中文字幕在线| 久久亚洲私人国产精品va媚药 | 一本大道久久a久久综合婷婷| 米奇777超碰欧美日韩亚洲| 亚洲欧美日韩一区二区三区在线观看| 欧美日韩久久不卡| 一区二区欧美在线观看| 99v久久综合狠狠综合久久| 欧美日韩1区2区3区| 日韩午夜中文字幕| 一本色道久久综合亚洲精品按摩| 欧美日韩在线播放一区| 亚洲视频高清| 亚洲综合日韩在线| 国产欧美日韩亚州综合| 久久久久国产精品一区| 久久久久久伊人| 亚洲国产另类 国产精品国产免费| 欧美高清在线视频| 欧美精品1区2区| 亚洲一区二区在线免费观看视频| 日韩视频免费在线| 国产精品稀缺呦系列在线| 欧美一区二区日韩一区二区| 欧美在线视频网站| 亚洲人成在线播放| 99国产精品99久久久久久粉嫩 | 国产欧美一区二区三区久久| 久久精品综合网| 亚洲欧美电影院| 亚洲乱码精品一二三四区日韩在线| 免费h精品视频在线播放| 免费成人在线视频网站| 一卡二卡3卡四卡高清精品视频| 日韩午夜电影在线观看| 国产欧美日韩视频| 欧美激情一区二区久久久| 欧美日韩国产成人在线观看| 欧美一区二区三区在线看 | 欧美一区=区| 亚洲精品久久久久久久久| 一区二区三区视频在线看| 国产三区精品| 亚洲精品久久久一区二区三区| 欧美性片在线观看| 女人香蕉久久**毛片精品| 欧美三级电影一区| 免费观看日韩| 国产精品揄拍500视频| 亚洲福利在线看| 国产欧美一区二区精品秋霞影院 | 亚洲永久网站| 久久久久一区二区三区| 中文欧美字幕免费| 久久欧美肥婆一二区| 亚洲性线免费观看视频成熟| 欧美专区18| 亚洲免费在线| 欧美人与禽猛交乱配视频| 美女性感视频久久久| 国产精品一二三| 9i看片成人免费高清| 91久久夜色精品国产九色| 午夜精品久久久久久久蜜桃app| 日韩亚洲一区二区| 美女尤物久久精品| 久久这里有精品15一区二区三区| 国产精品国产三级国产普通话三级 | 欧美另类高清视频在线| 欧美国产成人精品| 一区二区三区在线免费视频| 亚洲欧美一区二区在线观看| 亚洲特级毛片| 欧美理论电影在线播放| 欧美成人精品激情在线观看| 国模一区二区三区| 欧美一二区视频| 欧美在线观看日本一区| 国产精品亚洲综合色区韩国| 在线视频欧美一区| 亚洲综合电影一区二区三区| 欧美亚洲第一区| 中文欧美在线视频| 西西人体一区二区| 国产精品日日摸夜夜添夜夜av| 一区二区三区日韩精品视频| 一区二区三区四区国产| 欧美精品电影| 99re热精品| 欧美日精品一区视频| 欧美福利小视频| 国产欧美精品一区二区三区介绍| 一区二区成人精品| 亚洲宅男天堂在线观看无病毒| 欧美日韩在线播放一区| 中国女人久久久| 久久成人精品电影| 精品999在线播放| 久久综合一区二区三区| 欧美激情一二三区| 中文久久精品| 国产偷自视频区视频一区二区| 亚洲欧美日韩精品久久久| 久久久91精品国产| 亚洲国内自拍| 欧美性猛交视频| 欧美在线观看网址综合| 免费毛片一区二区三区久久久| 亚洲精品黄色| 国产伦精品一区二区三区免费 | 亚洲欧美激情视频在线观看一区二区三区 | 午夜精品国产精品大乳美女| 久久精品国产亚洲aⅴ| 在线看日韩欧美| 欧美视频精品在线观看| 欧美中文字幕视频在线观看| 亚洲国产视频一区二区| 午夜日韩福利| 91久久综合| 国产欧美一区二区精品性色| 猛男gaygay欧美视频| 亚洲视频一区二区| 欧美激情精品久久久久| 午夜国产精品影院在线观看| 在线观看日韩国产| 国产精品剧情在线亚洲| 蜜臀a∨国产成人精品| 亚洲欧美日本视频在线观看| 麻豆av一区二区三区久久| 中文一区二区在线观看| 永久免费精品影视网站| 国产精品久久久久毛片大屁完整版| 久久久一二三| 午夜精品一区二区三区四区 | 亚洲伦理在线免费看| 国产在线欧美| 国产精品午夜av在线| 欧美日韩一区二区国产| 久久综合婷婷| 欧美在线啊v| 亚洲一区二区三区高清不卡| 亚洲国产精品一区二区久| 久久精品一区二区国产| 亚洲一区二区高清| 亚洲精品乱码久久久久久蜜桃麻豆 |