[HDU] [2050] Polyline Dividing Plane

Problem Description

Loading...

Problem Analysis

A recurrence problem
This kind of pattern-finding problem sometimes also requires some inspiration
Don’t be impatient

cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#include<stdio.h>
int main() {
	int T;
	scanf("%d",&T);
	while(T--) {
		int n;
		scanf("%d",&n);
		printf("%d\n",2*n*n-n+1);
	}
	return 0;
}

Problem link: HDU 2050 Polyline Splitting Plane

Loading...