shunfurh 于 2017.09.10 18:47 提问

Count the Regions

What's the maximum number of regions definable by N zig-zag lines, each of which consists of two parallel infinite half-lines joined by a straight line segment?

Here is an example of 2 zig-zag lines yield 12 regions at the most.

Input

The input consists of a sequence of N (<= 10000), which is the number of the zig-zag lines, one per line.

Output

For each N, you should output the number of the maximum regions.

Sample Input

1
2

Sample Output

2
12

1个回答

devmiao      2017.09.27 21:52

UVALive6663 Count the Regions

ZOJ 1652 Count the Regions
<br />这个题目是<<具体数学>>第一章的一个课后习题,当时我是独立做出来的,今天偶然发现了,就把他AC掉了,因为太简单,就用了最近看的C++.嘿嘿.<br /> <br />#include<iostream> using namespace std; int main() { int n; while(cin>>n) { cout<< (9*n*n-7*n+2)/2 <<endl; } return 0; }
130 Surrounded Regions

no space in execution regions with .any selector matching

HBase-Regions in Transition 问题
1. 问题描述 发现hbase集群中有一个表的regionzai
Keil 链接错误 Error: L6406E: No space in execution regions with .ANY selector matching
Keil 链接错误 Error: L6406E: No space in execution regions with .ANY selector matching
(LeetCode 130)Surrounded Regions(并查集)
Q: Given a 2D board containing ‘X’ and ‘O’, capture all regions surrounded by ‘X’.A region is captured by flipping all ‘O’s into ‘X’s in that surrounded region.For example, X X X X X O O X X X O X
RCNN(Regions with Convolutional Neural Network Feature)

Maximally Stable Extremal Regions (MSER)特征
Maximally Stable Extremal Regions (MSER) is a feature detector; Like the SIFT detector, the MSER algorithm extracts from an image I a number of co-variant regions, called MSERs. An MSER is a stablec
LeetCode 130 Surrounded Regions（并查集）
Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. For example, X X