码迷,mamicode.com
首页 > 其他好文 > 详细

Codeforces 610C - Harmony Analysis

时间:2017-08-21 10:53:54      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:ace   img   mon   ++   nal   class   分享   while   end   

610C - Harmony Analysis

思路:

技术分享

代码:

#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define pb push_back
#define mp make_pair
#define pi acos(-1.0) 
#define pii pair<int,int>
#define pil pair<int,ll>
#define mem(a,b) memset(a,b,sizeof(a))

const int INF=0x3f3f3f3f;
const int MOD=1e9+7;
const int N=1e5+5;
//head

int dp[550][550];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    dp[0][0]=1;
    int t=9;
    int c=1;
    while(t--)
    {
        for(int i=0;i<c;i++)
        {
            for(int j=0;j<c;j++)
            {
                dp[i][j+c]=dp[i][j];
                dp[i+c][j]=dp[i][j];
                dp[i+c][j+c]=-dp[i][j];
            }
        }
        c<<=1;
    } 
    
    int k;
    cin>>k;
    int n=pow(2,k);
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(dp[i][j]==1)cout<<+;
            else cout<<*;
        }
        cout<<endl;
    }
    return 0;
} 

 

Codeforces 610C - Harmony Analysis

标签:ace   img   mon   ++   nal   class   分享   while   end   

原文地址:http://www.cnblogs.com/widsom/p/7403066.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!