cf 454A Little Pony and Crystal Mine

原创 2015年07月08日 17:26:18

题目链接:Codeforces 454A Little Pony and Crystal Mine

水题,直接找规律。。

/*----------------15 ms-----------------------*/
#include<iostream>
#include<vector> 
using namespace std;
vector<char> u(105,'D');
vector<char> v(105,'*');
int main()
{
    int n ,i ,j;
    while(cin >> n)
    {

        for(i =1;i <=n/2+1;i++)
        {
            for(j =(n +1)/2 -i;j >0;j--)
             cout<<v[j];

            for(j=1;j <= 2*i-1;j++)
             cout<<u[j];

                for(j =(n +1)/2 -i;j >0;j--)
             cout<<v[j];

             cout<<endl;
        }
        for(i =n/2;i >0;i--)
        {
            for(j =(n +1)/2 -i;j >0;j--)
             cout<<v[j];

            for(j=1;j <= 2*i-1;j++)
             cout<<u[j];

            for(j =(n +1)/2 -i;j >0;j--)
             cout<<v[j];

             cout<<endl;
        }


    }
    return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

【cf453B】Little Pony and Harmony Chest

D. Little Pony and Harmony Chest time limit per test 4 seconds memory limit per test 256...

codeforces454CLittle Pony and Expected Maximum+数学期望

DescriptionTwilight Sparkle was playing Ludo with her friends Rainbow Dash, Apple Jack and Flutter S...

HDU 4985 Little Pony and Permutation(简单模拟)

Little Pony and Permutation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (J...

[BestCoder Round #7] hdu 4985 Little Pony and Permutation (找循环节)

Little Pony and Permutation Problem Description As a unicorn, the ability of using m...

codeforces 453 B Little Pony and Harmony Chest (状压dp)

题意:求一个b数组,b数组中的所有数互质,和a数组对应下标的数的差的绝对值最小。 考虑a数组中的所有数范围为[1,30]则,b数组取值只有可能为[1,59),因为如果取到59及其以后,肯定可以取1,...

codeforces 453B B. Little Pony and Harmony Chest(dp+数论)

题目链接:codeforces 453B题目大意:给出一个序列a,求取一个序列b,b序列的数两两互质,问能够导致∑|ai−bi|\sum | a_i - b_i|最小的方案题目分析: 定义状态dp[i...

Codeforces 453 B Little Pony and Harmony Chest(Round 259 div.1 B/div.2 D)

题目链接:http://codeforces.com/contest/454/problem/D 题目大意:给出一个数组a,要求另一个数组b,满足数组b中的所有元素互质,且∑|ai-bi|(i:...

codeforces 453B Little Pony and Harmony Chest

B. Little Pony and Harmony Chest time limit per test 4 seconds memory limit per test 256...

Codeforces Round #259 (Div. 2) C. Little Pony and Expected Maximum

C. Little Pony and Expected Maximum time limit per test 1 second memory limit per test 2...

Codeforces Round #259 (Div. 2) B. Little Pony and Sort by Shif

B. Little Pony and Sort by Shift time limit per test 1 second memory limit per test 256 ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:cf 454A Little Pony and Crystal Mine
举报原因:
原因补充:

(最多只允许输入30个字)