题意:给定一个图像,字典序输出里面对应的象形文字。
分析:把由十六进制构成的图转换成二进制的图,就能很容易理解题意。
1、在最外圈加一圈0,便于使所有象形文字外的0都是连通的
2、将所有连通的0和1都标号(dfs)
3、再查象形文字里的洞的个数,把所有1附近的不是外圈的0都set一下就好了。
#pragma comment(linker, "/STACK:102400000, 102400000")#include#include #include #include #include #include #include #include #include #include #include #include #include
一组完整的测试样例:
100 2500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f800000000000000000000001fe00000000000000000000007ff00000000000000000000007ff8000000000000000000000f8f8000000000000000000001f07c000000000000000000001e03c000000000018000000001e01c00000000003c000000001c01c00000000007c000000003c01e0000000000f8000000003c01e0000000001f0000000001c01c0000000003f0000000001c01c0000000007e0000000001e01c000000000fc0000000001e03c000000001fc0000000000e03c000000001fc0000000000f038000000003ff0000000000f078000000003ff80000000007870000000007ff800000000038f0000000007cfc0000000003ce0000000007c7c0000000781fc0f0000000f87c00000007ffffff0000000f07c00000007ffffff0000000f07c00000007ffffff0000001f07c00000007ffffff0000000e03e00000007fcf81f0000000603e0000000000f8000000000003e0000000000f8000000000003e0000000000f8000000000003e0000000000f8000000000001e0000000000f8000000000001f0000000000fc000000000001f0000000000fc000000000001f0000000000fc000000000001f0000000000fc000000000000f0000000001fc000000000000f8000000001fc000000000000f8000000001fc000000000000f8000000001fc000000000000f8000000001fe000000000000f8000000001fe00000000000078000000001fe0000000000007c000000001fe0000000000007c000000003fe0000000000007c000000003fe0000000000007c000000003fe0000000000007c000000003fe0000c00000003c000000000000003ff0000003c000000000000007ff8000003e00000000000001fffc000003e00000000000003e03f000003e00000000000007c00f000003e0000000000000f0003800003f0000000000000e0001c00003fc000000000001c0001e00007fe000000000003c0000e0000fff000000000073c000070000fdf0000000001ff8000070001f0f8000000001ff8000070001e078000000003cf0000078001e038000000003870000033001e03800000000307800003fc01e03800000000703800007fe00e03800000000703800007ce00e03800000000703c000078700703800000000701e0000f0700701000000000701e0000e0700300000000000700f0001c07000000000000006007800380600000000000000e003e00700600000000000000e001fe7e00600000000000000e000fffc00e00000000000000e0000ff000e00000000000000f800038000e00000000000000fff0000000e00000000000000fffff00000e0000000000000003ffffe000c000000000000000007ffffc0c00000000000000000007ffffc000000000000000000000fffc00000000000000000000001fc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
输出:AKW