⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 saratov249.cpp

📁 My solutions to Saratov Online Judge Problems(SGU), not all, but many of them...
💻 CPP
字号:
/*
Alfonso2 Peterssen
16 - 5 - 2008
Saratov #249 "Matrix"
*/
#include <cstdio>

const int MAXC = 20;

#define REP( i, n ) \
    for ( int i = 0; i < (n); i++ )

int F, C, sz;
int seq[1 << MAXC];

int main() {

    scanf( "%d %d", &F, &C );

    seq[sz++] = 0;    
    REP( i, F >? C ) {
        REP( j, sz )
            seq[sz + j] = ( 1 << i ) + seq[sz - j - 1];
        sz *= 2;
    }

    REP( i, 1 << F )
    REP( j, 1 << C )
        printf( j < ( 1 << C ) - 1 ? "%d " : "%d\n",
                ( seq[i] << C ) + seq[j] );

    return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -