多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > 互聯網 > hdu 5047 Sawtooth--2014acm上海賽區邀請賽(附java模板)

hdu 5047 Sawtooth--2014acm上海賽區邀請賽(附java模板)

來源:程序員人生   發布時間:2014-10-21 08:00:00 閱讀次數:3342次

題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=5047

Sawtooth

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 377    Accepted Submission(s): 116


Problem Description
Think about a plane:

● One straight line can divide a plane into two regions.
● Two lines can divide a plane into at most four regions.
● Three lines can divide a plane into at most seven regions.
● And so on...

Now we have some figure constructed with two parallel rays in the same direction, joined by two straight segments. It looks like a character “M”. You are given N such “M”s. What is the maximum number of regions that these “M”s can divide a plane ?

 

Input
The first line of the input is T (1 ≤ T ≤ 100000), which stands for the number of test cases you need to solve.

Each case contains one single non-negative integer, indicating number of “M”s. (0 ≤ N ≤ 1012)
 

Output
For each test case, print a line “Case #t: ”(without quotes, t means the index of the test case) at the beginning. Then an integer that is the maximum number of regions N the “M” figures can divide.
 

Sample Input
2 1 2
 

Sample Output
Case #1: 2 Case #2: 19
 

Source
2014 ACM/ICPC Asia Regional Shanghai Online
 

Recommend
hujie   |   We have carefully selected several similar problems for you:  5052 5051 5049 5048 5046 
 

Statistic | Submit | Discuss | Note


一道規律題吧。

公式是這樣的     8*n^2 - 7*n + 1

不過出題人似乎故意卡java來增加題目的難度。。。

作為一個ACM弱渣。。。本

生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 一本久草 | 久久精品影院一区二区三区 | 在线观看 a国v | 正在播放国产露脸做91 | 欧美一级全黄 | 亚洲成a人片在线观看精品 亚洲成a人片在线观看尤物 | 色老头成人免费视频天天综合 | 免费理论片在线观看 | 亚洲福利视频一区 | 亚洲视频精品在线观看 | 国产一区二区三区在线看 | 国产成人影院一区二区 | 国产成人精品男人免费 | 亚洲不卡视频 | 免费在线观看成年人视频 | 亚洲韩国日本一级二级r级 亚洲韩精品欧美一区二区三区 | 日韩 欧美 亚洲国产 | 99久久精品免费看国产漫画 | 日本专区 | 99久久精品国产麻豆 | 欧美最猛性xxxx免费 | 日本午夜视频在线观看 | 中文字幕第一页国产 | 中文字幕在线亚洲 | 免费精品久久 | 欧美激情福利视频在线观看免费 | 天天鲁一鲁 | 午夜在线视频观看版 | 在线成h人视频网站免费观看 | 欧美极品xxxxⅹ另类 | 欧美18videosex性欧美69 | 日韩视频在线一区 | 男女晚上日日麻批视频不挡 | 亚州国产视频 | 波多野结衣在线观看网址 | 伊人久久综合网站 | 亚洲国产情侣偷自在线二页 | 性香港xxxxx免费视频播放 | 最近免费中文字幕高清大全 | 日本一区二区视频免费播放 | 伊人久久婷婷 |