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

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>
            久久综合伊人77777尤物| 老鸭窝亚洲一区二区三区| 久久免费偷拍视频| 另类成人小视频在线| 久久嫩草精品久久久久| 欧美日韩综合| 国产美女扒开尿口久久久| 永久久久久久| 夜夜嗨av一区二区三区| 久久国产精品久久久| 亚洲永久免费| 久久理论片午夜琪琪电影网| 久久亚洲国产成人| 亚洲精选视频免费看| 中文在线资源观看视频网站免费不卡| 欧美一区二视频| 日韩一区二区高清| 久久婷婷麻豆| 亚洲一区二区在线免费观看| 香港成人在线视频| 欧美日韩一区二区三区免费看| 亚洲福利视频专区| 久久国产天堂福利天堂| 老司机免费视频一区二区| 国产午夜精品久久久久久免费视| 在线视频日韩| 亚洲精品国产精品国自产在线| 亚洲国产91精品在线观看| 亚洲精选91| 欧美黄色小视频| 雨宫琴音一区二区在线| 一本大道av伊人久久综合| 欧美女主播在线| 夜夜嗨一区二区三区| 欧美一区二区三区四区视频| 国产伦精品一区二区三区视频孕妇 | 亚洲欧洲日韩女同| 免费精品视频| 久久久蜜臀国产一区二区| 国产一区二区三区最好精华液| 亚洲欧美日韩国产综合在线| 在线亚洲观看| 国产精品久久久久久妇女6080| 99re在线精品| 一区二区三区av| 国产欧美精品日韩| 久久婷婷成人综合色| 久久久久88色偷偷免费| 影音先锋中文字幕一区| 午夜精品免费视频| 亚洲电影第1页| 亚洲国产精品成人va在线观看| 久久伊人亚洲| 久久久久久久尹人综合网亚洲 | 亚洲美女一区| 亚洲伦理网站| 免费视频亚洲| 亚洲主播在线播放| 欧美先锋影音| 裸体丰满少妇做受久久99精品 | 欧美日韩国产综合新一区| 夜夜爽99久久国产综合精品女不卡| 久久久久久久久久看片| 久久综合福利| 亚洲国产精品ⅴa在线观看| 久久午夜精品| 亚洲国产精品第一区二区三区| 永久久久久久| 欧美xart系列在线观看| 午夜精品亚洲| 欧美va日韩va| 亚洲欧洲日韩在线| 激情久久一区| 一区二区日韩| 欧美一区亚洲| 在线精品视频在线观看高清| 免费在线播放第一区高清av| 亚洲国产日韩欧美| 亚洲一区二区精品在线| 久久久久久久久久久一区| 欧美激情亚洲自拍| 国产在线观看91精品一区| 亚洲最快最全在线视频| 午夜精品美女久久久久av福利| 国产午夜精品福利| 牛牛国产精品| 亚洲一级黄色| 一区二区三区精品久久久| 国产精品毛片va一区二区三区| 亚洲动漫精品| 一区二区三区在线观看国产| 免费久久精品视频| 亚洲婷婷综合色高清在线 | 一本色道久久综合狠狠躁篇怎么玩 | 欧美视频免费看| 久久xxxx精品视频| 日韩午夜在线播放| 国产日韩欧美三级| 欧美sm视频| 欧美综合激情网| 99精品久久久| 欧美成人蜜桃| 亚洲国产美女精品久久久久∴| 久久不射中文字幕| 日韩天堂在线视频| 免费久久精品视频| 欧美一区免费视频| 艳妇臀荡乳欲伦亚洲一区| 国模套图日韩精品一区二区| 欧美精品一区二区蜜臀亚洲| 欧美一区激情视频在线观看| 日韩视频在线一区| 欧美激情欧美狂野欧美精品| 久久av一区二区| 亚洲素人在线| 亚洲精品在线一区二区| 狠久久av成人天堂| 久久只精品国产| 亚洲欧美另类在线| 蜜臀91精品一区二区三区| 欧美一区二区三区精品电影| 日韩一级大片| 亚洲人精品午夜| 1024国产精品| 一区免费观看| 国产日韩欧美在线看| 国产精品极品美女粉嫩高清在线 | 久久久久国内| 欧美中文字幕在线播放| 亚洲欧美另类综合偷拍| 亚洲香蕉视频| 中文成人激情娱乐网| 99国产麻豆精品| 99成人在线| 亚洲美女网站| 一本大道av伊人久久综合| 日韩一级在线观看| 99精品视频一区| av成人毛片| 亚洲视频一区二区在线观看| 一道本一区二区| 9久re热视频在线精品| 99ri日韩精品视频| 一区二区三区欧美在线| 在线中文字幕一区| 亚洲一区二区三区国产| 欧美大片在线观看一区二区| 免费在线看一区| 午夜精品福利在线| 欧美一级在线播放| 亚洲精品乱码久久久久久久久| 国产精品久久午夜| 国产精品亚洲欧美| 欧美激情欧美激情在线五月| 欧美在线视频一区二区| 久久久999精品| 米奇777超碰欧美日韩亚洲| 亚洲香蕉伊综合在人在线视看| 亚洲一区二区三区精品视频| 欧美亚洲日本网站| 久久亚洲欧美| 欧美日韩国产综合视频在线观看中文| 欧美日韩免费高清| 国产精品一区一区三区| 韩国三级在线一区| 亚洲另类自拍| 欧美亚洲视频| 女人天堂亚洲aⅴ在线观看| 最新中文字幕一区二区三区| 亚洲天堂av在线免费观看| 亚洲欧美中文在线视频| 久久综合久久综合久久综合| 欧美激情在线观看| 国产欧美日韩中文字幕在线| 亚洲高清不卡在线| 亚洲在线1234| 免费影视亚洲| 一区二区三区四区蜜桃| 久久国产天堂福利天堂| 欧美片第一页| 精品69视频一区二区三区| 亚洲精品乱码久久久久| 欧美与欧洲交xxxx免费观看| 亚洲第一搞黄网站| 亚洲欧美日韩精品久久| 欧美精品大片| 影音先锋亚洲精品| 午夜一区二区三区在线观看 | 久久爱www.| 亚洲毛片在线观看| 久久亚洲精品一区二区| 国产精品三级久久久久久电影| 亚洲国产乱码最新视频| 欧美在线免费观看视频| 亚洲精品精选| 免费观看成人鲁鲁鲁鲁鲁视频| 国产乱码精品一区二区三区五月婷 | 亚洲丰满在线| 午夜精品一区二区三区在线 | 欧美区国产区|