#P2328. [SCOI2005] 超级格雷码

    ID: 1305 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>2005四川各省省选Special Judge枚举,暴力进制

[SCOI2005] 超级格雷码

Description

Input Format

Only one line, containing two integers nn and BB.

Output Format

A total of BnB^n lines, each line is a base-BB number, representing the ordering that meets the required conditions.

2  2
00
01
11
10

Hint

Thanks to @Night_Aurora for the SPJ.

Translated by ChatGPT 5