一串首尾相连的珠子(m个),有N种颜色(N<=10),设计一个算法,取出其中一段,要求包含所有N中颜色,并使长度最短
#include using namespace std;#define N 3bool GetMinlen(int *a,int m,int &shortHead,int & shortlen){ int start=0,end = 0; int countColor = 0; int *colorArray = new int[N]; shortlen = m; sho
复制链接