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

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 極限定律 閱讀(1039) 評論(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>
            午夜视频在线观看一区| 一区二区国产在线观看| 久久精品天堂| 激情综合亚洲| 欧美电影免费观看高清完整版| 久久久99免费视频| 亚洲欧洲精品一区二区精品久久久 | 亚洲日本成人| 欧美va天堂在线| 亚洲最新在线视频| 中国成人在线视频| 国产亚洲精品久久飘花| 欧美成人69av| 欧美日韩精品一区二区| 亚洲欧洲在线一区| 99亚洲精品| 国产亚洲一级| 91久久久久久| 国产精品网站在线观看| 亚洲三级视频在线观看| 99国产精品一区| 黑人巨大精品欧美一区二区 | 午夜精品久久久久久久| 欧美一级黄色录像| 亚洲福利视频网站| 欧美在线一区二区三区| 99热在这里有精品免费| 国产一区二区久久久| 亚洲国产日韩在线| 国产精品亚洲片夜色在线| 欧美成人精品| 国产精品视频网站| 亚洲国产欧美一区二区三区同亚洲| 欧美日韩三级| 欧美~级网站不卡| 国产精品高清在线观看| 欧美va亚洲va国产综合| 国产精品www| 亚洲福利电影| 韩日精品视频一区| 一区二区国产日产| 亚洲福利精品| 久久久99精品免费观看不卡| 午夜精品三级视频福利| 欧美福利在线观看| 久久综合伊人77777蜜臀| 国产精品成人久久久久| 亚洲国产精品123| 黄色日韩精品| 午夜久久tv| 欧美一区2区视频在线观看 | 亚洲欧美在线视频观看| 夜夜嗨av一区二区三区四季av| 久久精品国产2020观看福利| 亚洲自拍偷拍色片视频| 欧美日韩国产成人在线91| 免费欧美电影| 影音先锋亚洲一区| 欧美中文在线免费| 欧美专区在线播放| 国产精品久线观看视频| 99在线热播精品免费| 99国产精品国产精品毛片| 日韩视频一区二区三区在线播放 | 欧美三级视频在线| 亚洲美女在线看| 亚洲免费电影在线| 欧美激情无毛| 亚洲美女诱惑| 亚洲一区久久久| 国产精品美女999| 亚洲在线播放电影| 久久精品国产一区二区三区免费看 | 亚洲一级网站| 亚洲欧美不卡| 国产欧美日韩伦理| 小黄鸭视频精品导航| 久久九九国产精品| 精品69视频一区二区三区| 午夜精品一区二区三区电影天堂| 午夜精品久久久久久久久| 国产精品嫩草影院av蜜臀| 亚洲一区二区三区在线观看视频| 午夜欧美理论片| 国产亚洲精品一区二区| 久久久一二三| 亚洲精品久久视频| 香蕉成人啪国产精品视频综合网| 国产日韩一区| 老鸭窝亚洲一区二区三区| 亚洲国产精品电影| 亚洲欧美日韩国产| 国产日韩综合| 欧美成人蜜桃| 久久久久久伊人| 91久久久久久久久| 国产精品国产三级国产普通话三级 | 99视频精品全部免费在线| 亚洲一区免费| 尤物yw午夜国产精品视频| 欧美二区在线播放| 亚洲私人影吧| 欧美+日本+国产+在线a∨观看| 亚洲欧洲另类国产综合| 欧美日韩亚洲视频| 久久黄色级2电影| 亚洲精品社区| 久久婷婷国产综合精品青草| 亚洲日本欧美日韩高观看| 国产精品久久久久久久免费软件| 久久精品国产一区二区电影| 亚洲伦理精品| 欧美不卡三区| 欧美一区二区三区婷婷月色| 亚洲人成欧美中文字幕| 国产免费亚洲高清| 欧美日韩国产在线播放| 久久精品一区二区三区不卡牛牛| 一区二区三区导航| 欧美激情综合色| 久久九九精品99国产精品| 亚洲午夜精品网| 91久久精品日日躁夜夜躁欧美 | 国产精品成人播放| 欧美jizzhd精品欧美巨大免费| 亚洲欧美日韩精品在线| 亚洲精品网址在线观看| 美女网站在线免费欧美精品| 欧美一区二区三区四区夜夜大片 | 亚洲狼人精品一区二区三区| 国产在线精品自拍| 国产精品久久一卡二卡| 欧美日韩国产综合在线| 欧美成人三级在线| 久久久噜噜噜久久中文字免| 性色av一区二区三区红粉影视| 一区二区三区三区在线| 日韩视频在线永久播放| 亚洲国产欧美久久| 欧美激情视频网站| 欧美激情精品久久久久久免费印度 | 亚洲欧美日韩精品| 亚洲美女黄网| 亚洲精品美女91| 亚洲精品美女在线| 亚洲精品乱码久久久久久久久| 亚洲第一在线视频| 亚洲国产美女精品久久久久∴| 激情成人在线视频| 久久精品一二三| 久久激情一区| 亚洲国产精品传媒在线观看| 国产综合色在线视频区| 国产欧美日韩综合一区在线观看 | 久久xxxx| 欧美影院午夜播放| 久久精品女人的天堂av| 久久久噜噜噜久久中文字免| 久久综合伊人77777| 狼人社综合社区| 欧美黄色aa电影| 欧美三级网页| 国产欧美一区二区三区另类精品| 国产亚洲一区二区在线观看| 好吊色欧美一区二区三区四区 | 欧美丰满高潮xxxx喷水动漫| 欧美激情精品久久久久久大尺度| 欧美啪啪一区| 国产精品视频一区二区三区| 国产一区二区久久精品| 亚洲国产日韩综合一区| 日韩亚洲一区二区| 新片速递亚洲合集欧美合集| 久久久无码精品亚洲日韩按摩| 免费精品视频| 99精品视频一区二区三区| 亚洲欧美综合v| 免费成人毛片| 国产精品一卡二卡| 亚洲国产欧美久久| 亚洲午夜精品在线| 猛干欧美女孩| 一区二区三区四区五区精品| 欧美一区二区视频观看视频| 女人香蕉久久**毛片精品| 国产精品日韩| 亚洲人精品午夜在线观看| 亚洲欧美欧美一区二区三区| 欧美成人嫩草网站| 亚洲一区在线直播| 欧美激情自拍| 一区二区三区在线免费视频| 亚洲欧美日本在线| 亚洲国产高清一区| 久久超碰97人人做人人爱| 欧美日韩精品一区二区天天拍小说 | 久久黄金**| 亚洲精品网站在线播放gif| 久久er99精品| 国产精品一区视频网站|