zoukankan      html  css  js  c++  java
  • Codeforces Round #633 (Div. 2) A. Filling Diamonds

    You have integer nn. Calculate how many ways are there to fully cover belt-like area of 4n24n−2 triangles with diamond shapes.

    Diamond shape consists of two triangles. You can move, rotate or flip the shape, but you cannot scale it.

    22 coverings are different if some 22 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 n=1,2,3,4n=1,2,3,4.

    You have to answer tt independent test cases.

    Input

    The first line contains a single integer tt (1t1041≤t≤104) — the number of test cases.

    Each of the next tt lines contains a single integer nn (1n1091≤n≤109).

    Output

    For each test case, print the number of ways to fully cover belt-like area of 4n24n−2 triangles using diamond shape. It can be shown that under given constraints this number of ways doesn't exceed 10181018.

    Example
    Input
    Copy
    2
    2
    1
    
    Output
    Copy
    2
    1
    #include <bits/stdc++.h>
    using namespace std;
    int n;
    int main()
    {
        int t;
        cin>>t;
        while(t--)
        {
            scanf("%d",&n);
            cout<<n<<endl;
        }
        return 0;
    }
  • 相关阅读:
    设定cookie 获取cookie数据的转换
    cookie cookie的获取
    常见的请求方式 json字符串
    请求报文和响应报文
    http协议
    php分页查询 子查询
    MAC 地址为什么不需要全球唯一
    ceph分布式存储简介
    一文看懂为什么边缘计算是大势所趋
    真香!Windows 可直接运行 Linux 了
  • 原文地址:https://www.cnblogs.com/lipoicyclic/p/12689851.html
Copyright © 2011-2022 走看看