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

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>
            久久噜噜亚洲综合| 欧美色视频一区| 亚洲综合色在线| 免费观看日韩av| 久久亚洲欧洲| 老司机午夜精品视频| 久久精品国产清高在天天线| 亚洲自拍偷拍色片视频| 亚洲一本视频| 久久久999精品免费| 久久精品亚洲国产奇米99| 欧美影视一区| 欧美中文字幕久久| 国产色视频一区| 精品51国产黑色丝袜高跟鞋| 国产一区二区三区日韩| 国产在线精品二区| 亚洲第一在线综合在线| 亚洲美女免费精品视频在线观看| 一色屋精品视频免费看| 在线欧美亚洲| 亚洲免费观看视频| 欧美在线不卡| 欧美激情按摩在线| 日韩亚洲欧美高清| 免费欧美高清视频| 亚洲激情国产精品| 欧美激情一区二区三区| 久久久午夜精品| 欧美一区二区在线| 久久一二三四| 亚洲日本欧美天堂| 久久黄色级2电影| 欧美黄在线观看| 国产女人18毛片水18精品| 亚洲成色777777女色窝| 午夜在线视频观看日韩17c| 欧美成人精品一区二区三区| 亚洲综合二区| 欧美日韩国产电影| 亚洲高清成人| 久久亚洲精品伦理| 亚洲欧美另类在线观看| 欧美日韩美女在线观看| 亚洲电影av在线| 久久精品九九| 亚洲一区二区精品在线观看| 国产色视频一区| 欧美女激情福利| 伊人精品成人久久综合软件| 欧美一区二区三区在线免费观看| 亚洲精品一区二| 欧美国产激情| 亚洲精品一二三区| 亚洲国产精品久久| 美腿丝袜亚洲色图| 91久久精品一区| 欧美sm视频| 久久综合影视| 91久久精品一区| 亚洲韩国青草视频| 欧美国产高清| 亚洲一区免费在线观看| 99成人在线| 欧美体内谢she精2性欧美| 在线综合欧美| 一区二区日韩免费看| 欧美性感一类影片在线播放| 一本色道久久综合狠狠躁篇的优点| 欧美激情a∨在线视频播放| 蜜桃av一区二区三区| 亚洲精品在线视频| a91a精品视频在线观看| 国产精品日韩欧美综合| 欧美一级久久| 久久久国产91| 亚洲精选视频在线| 亚洲精品欧美激情| 欧美日韩在线一区二区| 在线欧美视频| 日韩网站在线| 国产视频一区免费看| 久久久久欧美| 欧美精品二区| 午夜欧美大片免费观看 | 最新69国产成人精品视频免费| 久久激情综合网| 久久亚洲欧美| 在线午夜精品| 欧美伊人久久| 亚洲精品视频在线播放| 亚洲视频精品| 在线观看亚洲视频| 亚洲精品一二三| 国产中文一区| 亚洲免费观看在线视频| 国内成+人亚洲+欧美+综合在线| 亚洲第一福利社区| 国产精品免费在线| 亚洲成人直播| 国产欧美精品在线观看| 亚洲成色www久久网站| 国产精品视频久久久| 欧美激情精品久久久| 国产精品女人久久久久久| 蜜桃av一区二区三区| 免费成人av在线看| 一区二区三区高清在线观看| 香蕉久久夜色精品国产| 亚洲精品一区在线观看香蕉| 国产精品99久久久久久宅男| 亚洲精品三级| 久久在线播放| 久久久精品视频成人| 欧美体内谢she精2性欧美| 亚洲国产毛片完整版 | 欧美福利在线观看| 欧美一区激情| 欧美日韩中文另类| 亚洲激情电影在线| 亚洲国产欧美日韩精品| 久久国内精品视频| 欧美在线视频观看免费网站| 欧美日韩国产影片| 免费短视频成人日韩| 国产一区二区无遮挡| 亚洲天堂成人在线观看| 亚洲国产三级网| 久久中文久久字幕| 免费的成人av| 亚洲欧洲日韩在线| 久久久水蜜桃av免费网站| 久久久国产精品一区| 国产视频在线观看一区二区| 亚洲夜晚福利在线观看| 亚洲午夜一二三区视频| 日韩视频二区| 蜜臀久久99精品久久久画质超高清| 国产精品视频xxxx| 亚洲欧美文学| 久久久久久久999精品视频| 国际精品欧美精品| 久久xxxx| 欧美大色视频| 亚洲一区二区三区精品视频| 欧美视频日韩视频| 一区二区三区不卡视频在线观看 | 国产精品―色哟哟| 日韩亚洲国产欧美| 亚洲免费一区二区| 国产精品自在在线| 久久精品中文字幕一区| 免费亚洲电影在线| 亚洲精品日韩在线| 欧美日韩在线影院| 先锋影院在线亚洲| 狂野欧美性猛交xxxx巴西| 亚洲第一二三四五区| 欧美国产精品v| 亚洲一区二区网站| 母乳一区在线观看| 9色porny自拍视频一区二区| 欧美色中文字幕| 欧美一区成人| 欧美国产精品日韩| 一区二区高清| 国产在线视频欧美一区二区三区| 免费成人av资源网| 中文在线不卡| 欧美成人免费网站| 亚洲区欧美区| 欧美亚一区二区| 久久手机精品视频| 一区二区欧美国产| 欧美丰满少妇xxxbbb| 香港久久久电影| 亚洲国产另类久久精品| 国产精品区一区二区三| 欧美综合激情网| 亚洲伦伦在线| 蜜桃久久精品一区二区| 亚洲午夜在线视频| 尤物99国产成人精品视频| 欧美日韩在线播放三区| 久久视频一区| 亚洲性夜色噜噜噜7777| 亚洲日本电影在线| 欧美在线一二三四区| 日韩视频在线观看免费| 狠狠狠色丁香婷婷综合激情| 欧美视频三区在线播放| 蜜桃精品久久久久久久免费影院| 亚洲永久字幕| 99精品福利视频| 欧美大片免费观看在线观看网站推荐| 亚洲欧美日产图| 亚洲免费观看在线观看| 亚洲激情视频网站| 亚洲成人资源网| 一区在线影院|