codeforces 1339A. Filling Diamonds
题目如下
A. Filling Diamonds
time limit per test1 second
memory limit per test256 megabytes
You have integer 𝑛. Calculate how many ways are there to fully cover belt-like area of 4𝑛−2 triangles with diamond shapes.
Diamond shape consists of two triangles. You can move, rotate or flip the shape, but you cannot scale it.
2 coverings are different if some 2 triangles are covered by the same diamond shape in one of them and by different diamond shapes in the other one.
Please look at pictures below for better understanding.
On the left you can see the diamond shape you will use, and on the right you can see the area you want to fill.
These are the figures of the area you want to fill for 𝑛=1,2,3,4.
You have to answer 𝑡 independent test cases.
Input
The first line contains a single integer 𝑡 (1≤𝑡≤104) — the number of test cases.
Each of the next 𝑡 lines contains a single integer 𝑛 (1≤𝑛≤109).
Output
For each test case, print the number of ways to fully cover belt-like area of 4𝑛−2 triangles using diamond shape. It can be shown that under given constraints this number of ways doesn't exceed 1018.
看起来涉及图形,但是既然是a应该难度不会太高,所以就发现这是一个找规律的题目不妨自己画一下,发现n的值总与构建方法数相同
好了这题结束了,
我不吃油条了oToTo

浙公网安备 33010602011771号