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

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

    從一個(gè)所有邊都平行于坐標(biāo)系的多邊形的任一頂點(diǎn)出發(fā),逆時(shí)針遍歷,記錄每次經(jīng)過的頂點(diǎn)處的轉(zhuǎn)角,組成的字符串叫做angle string。求指定長度的angle string中,能表示至少一個(gè)星形多邊形的串個(gè)數(shù)。 
    顯然當(dāng)l=2k+1時(shí),解不存在;當(dāng)l=2k時(shí),設(shè)m=(l+4)/2,根據(jù)組合數(shù)的知識(shí),所求結(jié)果為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) 評(píng)論(0)  編輯 收藏 引用 所屬分類: ACM-ICPC World Final 2008題解


只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


<2009年4月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

導(dǎo)航

統(tǒng)計(jì)

常用鏈接

留言簿(10)

隨筆分類

隨筆檔案

友情鏈接

搜索

最新評(píng)論

閱讀排行榜

評(píng)論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲在线观看免费| 国产香蕉久久精品综合网| 午夜亚洲福利在线老司机| 欧美二区在线| 欧美.www| 国产一级精品aaaaa看| 一区二区日本视频| 一区二区欧美激情| 欧美激情国产日韩| 欧美成人午夜激情在线| 伊人男人综合视频网| 性欧美暴力猛交另类hd| 香蕉久久夜色精品| 国产精品theporn88| 日韩视频免费| 亚洲一区二区三区成人在线视频精品| 麻豆精品视频在线| 欧美顶级大胆免费视频| 亚洲国产电影| 免费欧美高清视频| 亚洲电影激情视频网站| 影音先锋日韩精品| 老色批av在线精品| 亚洲高清三级视频| 正在播放欧美视频| 国产精品九九| 亚洲欧美网站| 久久综合久久综合久久综合| 激情欧美一区二区| 久久精品91久久久久久再现| 久久嫩草精品久久久精品一 | 久久精品在线播放| 久久嫩草精品久久久精品| 狠狠色狠狠色综合| 久久色在线观看| 亚洲国产精品成人一区二区| 夜夜嗨av一区二区三区网站四季av | 欧美专区福利在线| 国产在线视频不卡二| 久久中文字幕一区二区三区| 欧美激情va永久在线播放| 99视频精品在线| 国产精品久久久久免费a∨| 午夜在线电影亚洲一区| 老司机凹凸av亚洲导航| 亚洲精品自在在线观看| 国产精品xxxxx| 久久国产毛片| 亚洲美女av黄| 久久精品国产免费看久久精品| 伊人精品在线| 欧美视频一区二区三区在线观看 | 久久精品天堂| 亚洲日本成人网| 国产精品劲爆视频| 另类成人小视频在线| 一区二区欧美在线观看| 老司机午夜精品视频在线观看| 日韩一级大片| 黄色成人免费网站| 欧美日韩国产专区| 久久激情婷婷| 在线视频欧美一区| 欧美韩国日本一区| 久久国内精品自在自线400部| 91久久极品少妇xxxxⅹ软件| 国产精品自拍在线| 欧美精品色综合| 欧美专区第一页| 日韩视频免费观看高清完整版| 久久久久国产成人精品亚洲午夜| 日韩视频免费在线观看| 国模私拍视频一区| 国产精品jvid在线观看蜜臀| 可以看av的网站久久看| 午夜精品999| 日韩视频中午一区| 亚洲国产高清一区二区三区| 久久av资源网| 亚洲欧美日韩在线观看a三区| 亚洲欧洲精品一区二区三区波多野1战4 | 亚洲国产精品悠悠久久琪琪| 久久久91精品| 午夜欧美精品久久久久久久| 一本久道综合久久精品| 亚洲福利国产| 好吊一区二区三区| 国产午夜精品理论片a级大结局| 欧美日韩国产页| 欧美~级网站不卡| 久久亚裔精品欧美| 久久精品1区| 欧美专区在线播放| 欧美一级片久久久久久久| 亚洲视频免费| 亚洲视频在线免费观看| 亚洲精选大片| 99re在线精品| 99在线热播精品免费| 亚洲人成艺术| 亚洲伦伦在线| 亚洲精品偷拍| 亚洲毛片av在线| 99爱精品视频| 亚洲五月六月| 午夜精品在线看| 欧美一二区视频| 久久久999| 美脚丝袜一区二区三区在线观看 | 国产精品免费视频观看| 国产精品久久久久毛片大屁完整版 | 最新国产の精品合集bt伙计| 亚洲国产婷婷综合在线精品| 亚洲激情电影在线| 亚洲精品欧美精品| 一个色综合导航| 亚洲在线视频观看| 欧美一区二区三区成人| 久久久精品网| 欧美高清视频一区二区| 欧美日韩网址| 国产精品综合久久久| 国产自产高清不卡| 亚洲国内高清视频| 亚洲调教视频在线观看| 亚洲欧美中文日韩在线| 久久亚洲欧美| 亚洲人成在线观看| 亚洲欧美在线播放| 免费不卡中文字幕视频| 欧美日韩在线观看一区二区三区| 国产精品天天看| 伊人婷婷欧美激情| 中日韩视频在线观看| 欧美中文字幕在线观看| 欧美成人中文| 亚洲天堂成人在线观看| 久久久噜噜噜久久中文字幕色伊伊| 欧美成人精品| 国产欧美精品| 亚洲美女诱惑| 久久疯狂做爰流白浆xx| 亚洲国产精品电影在线观看| 亚洲在线一区二区三区| 六月丁香综合| 国产乱理伦片在线观看夜一区| 亚洲电影网站| 欧美与欧洲交xxxx免费观看 | 牛牛影视久久网| 国产精品美腿一区在线看| 在线观看视频一区二区| 亚洲欧美激情视频| 亚洲第一天堂av| 欧美在线视频免费播放| 欧美视频一区二区| 亚洲人成亚洲人成在线观看| 欧美一区二区三区免费看| 亚洲国产精品成人综合色在线婷婷 | 国产在线精品二区| 亚洲无限乱码一二三四麻| 欧美成人一区二区在线| 午夜视频在线观看一区二区三区 | 国内精品久久久久影院色 | 欧美专区在线观看一区| 亚洲精品裸体| 久久综合中文| 尤物网精品视频| 久久久精品国产一区二区三区| 夜夜狂射影院欧美极品| 欧美电影在线免费观看网站| 激情综合久久| 久久久久一区二区三区| 亚洲永久在线| 国产精品久久久久一区| 在线视频一区二区| 亚洲日本成人网| 欧美高清视频一二三区| 亚洲经典一区| 亚洲高清123| 欧美69wwwcom| 最新国产乱人伦偷精品免费网站 | 亚洲视频导航| 欧美肉体xxxx裸体137大胆| 一本久久综合亚洲鲁鲁五月天| 亚洲第一精品电影| 欧美高清不卡| 99国产精品私拍| 99成人精品| 国产精品久久久久久影院8一贰佰 国产精品久久久久久影视 | 欧美日韩亚洲国产精品| 99成人在线| 99精品热视频只有精品10| 欧美日韩福利在线观看| 一区二区欧美日韩视频| 一本久道久久综合狠狠爱| 欧美日韩中文精品| 亚洲欧美综合另类中字| 午夜精品一区二区三区在线| 国产亚洲精品美女| 免费在线看成人av|