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

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>
            亚洲电影免费在线 | 美女日韩在线中文字幕| 亚洲午夜伦理| 国产欧美精品| 久久一区视频| 欧美激情四色| 亚洲香蕉在线观看| 亚洲在线免费观看| 亚洲大片精品永久免费| 亚洲黄色性网站| 欧美日韩第一区日日骚| 亚洲免费在线看| 久久av资源网站| 亚洲日本欧美| 亚洲私人影院在线观看| 激情一区二区三区| 亚洲欧洲精品一区二区精品久久久| 欧美日韩福利| 久久人人超碰| 欧美日韩成人免费| 久久九九99视频| 欧美精品在欧美一区二区少妇| 亚洲综合第一| 欧美大学生性色视频| 亚洲欧美文学| 裸体歌舞表演一区二区| 亚洲曰本av电影| 玖玖综合伊人| 欧美主播一区二区三区美女 久久精品人 | 麻豆91精品91久久久的内涵| 欧美激情一区二区三区高清视频| 亚洲欧美国产高清| 欧美大香线蕉线伊人久久国产精品| 亚洲伊人网站| 欧美黄色免费网站| 久久手机精品视频| 国产精品久久久一区二区三区| 免费看黄裸体一级大秀欧美| 国产精品狠色婷| 亚洲精品久久久久久久久| 国产人成一区二区三区影院| 亚洲精品视频在线| 一区二区亚洲精品| 亚洲资源av| 亚洲午夜国产一区99re久久| 久久久久在线观看| 久久国产黑丝| 国产精品日韩专区| 99在线热播精品免费| 亚洲日产国产精品| 久久精品盗摄| 久久精品亚洲精品国产欧美kt∨| 欧美日韩国内| 亚洲精品久久久久久一区二区| 一区二区三区在线看| 欧美亚洲一区在线| 午夜精品区一区二区三| 欧美日韩亚洲综合在线| 91久久极品少妇xxxxⅹ软件| 最新日韩av| 欧美成人午夜免费视在线看片| 老司机午夜精品视频| 国产亚洲欧美中文| 午夜在线一区| 久久精品人人做人人爽| 国产欧美日韩一区| 久久9热精品视频| 久久免费国产精品| 国产夜色精品一区二区av| 欧美一区永久视频免费观看| 久久精品亚洲精品国产欧美kt∨| 国产日本欧美一区二区三区| 欧美一区二区三区另类| 久久精品一区二区三区四区| 国产一区二区三区av电影 | 亚洲激情视频网| 亚洲片区在线| 欧美女同视频| 在线亚洲免费| 欧美在线二区| 亚洲第一免费播放区| 欧美国产精品劲爆| 一本色道久久综合| 欧美一区二区精品久久911| 国产日韩欧美成人| 久久米奇亚洲| 91久久精品国产| 亚洲欧美在线免费| 国内精品久久久久久| 免费成人av在线看| 日韩一二三区视频| 久久成人国产| 亚洲精品国偷自产在线99热| 欧美视频成人| 欧美影院成年免费版| 亚洲国产成人一区| 亚洲在线视频观看| 樱桃视频在线观看一区| 欧美日韩国产综合视频在线观看中文 | 欧美另类videos死尸| 日韩一级黄色av| 久久久久久久精| 99re热这里只有精品视频| 国产精品呻吟| 欧美大片va欧美在线播放| 亚洲在线播放电影| 亚洲黄一区二区| 久久精品视频播放| 在线亚洲自拍| 影音先锋亚洲电影| 欧美午夜视频网站| 蜜月aⅴ免费一区二区三区 | 欧美激情精品久久久久久| 亚洲摸下面视频| 亚洲精品一区二区三区蜜桃久| 亚洲主播在线观看| 亚洲国产激情| 国内久久精品| 国产精品久久久久久久app| 久久综合狠狠综合久久综青草| 亚洲一区二区少妇| 亚洲六月丁香色婷婷综合久久| 六月丁香综合| 性视频1819p久久| 一区二区三区欧美亚洲| 亚洲国产裸拍裸体视频在线观看乱了中文| 欧美体内she精视频在线观看| 另类天堂视频在线观看| 欧美一区日本一区韩国一区| 亚洲美洲欧洲综合国产一区| 欧美福利视频在线观看| 久久精品日韩| 久久成人精品无人区| 亚洲欧美日韩精品久久| 一区二区三区免费在线观看| 亚洲精品精选| 亚洲精品国产精品久久清纯直播| 韩日欧美一区| 国内成+人亚洲| 国产视频一区三区| 国产亚洲欧洲997久久综合| 国产精品美女久久久久久免费 | 久热这里只精品99re8久| 性欧美xxxx视频在线观看| 亚洲免费视频中文字幕| 亚洲一区二区在线免费观看| 一区二区三区精品视频在线观看| 亚洲美女网站| 一区二区三区日韩精品| 亚洲一区精品在线| 亚洲欧美日韩综合aⅴ视频| 午夜电影亚洲| 久久国产一区二区三区| 久久久久久999| 老司机午夜精品| 欧美精品一区二区在线播放| 欧美日韩综合视频| 国产精品亚洲产品| 国产欧美日韩免费| 一区国产精品| 亚洲毛片在线观看.| 在线视频欧美精品| 香蕉久久夜色精品国产使用方法| 欧美一区二区三区在线观看| 久久久精品一品道一区| 男女精品视频| 亚洲美女区一区| 亚洲欧美成人一区二区三区| 久久精品视频在线观看| 欧美黄色免费网站| 国产精品入口66mio| 一区二区在线视频| 亚洲特级片在线| 久久综合电影一区| 亚洲精品美女久久7777777| 亚洲视频在线一区| 久久久久久一区二区三区| 欧美精品在线视频观看| 国产日本欧美一区二区| 亚洲精品一区在线| 欧美在线free| 91久久精品国产91久久| 性欧美xxxx视频在线观看| 欧美极品在线播放| 国产自产2019最新不卡| 99精品视频免费观看视频| 久久精品成人欧美大片古装| 91久久久久久国产精品| 午夜免费日韩视频| 欧美三级在线播放| 亚洲国产午夜| 久久日韩粉嫩一区二区三区| 99精品欧美一区| 鲁大师影院一区二区三区| 国产欧美一区视频| 亚洲视频在线观看三级| 亚洲国产精品99久久久久久久久| 亚洲欧美日韩精品在线| 欧美日韩一区不卡| 亚洲精品女av网站|