题意:输入一个n(2<=n<=1000,n是偶数)个字符串的集合D,找一个长度最短的字符串S(不一定在D中出现),使得D中恰好一半串小于等于S,另一半串大于S。如果有多解,输出字典序最小的解。
分析:找到最中间的两个串,直接按位构造。
#pragma comment(linker, "/STACK:102400000, 102400000")#include #include #include #include #include #include #include #include #include #include #include #include #include