Codeforces 610C - Harmony Analysis

Posted Wisdom+.+

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Codeforces 610C - Harmony Analysis相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章