1124 Raffle for Weibo Followers(20 分)

还有两个数据点没有通过

#include
#include
#include
#include
#include
#include 
using namespace std;

int main()
{
    int M, N, L;
    string str;
    cin >> M >> N >> L;

    if (Mv(M);
    vectorvl;
    for (int i = 0; i < M; i++)
    {
        cin >> v[i];
    }
    vl.push_back(v[L - 1]);
    for(int i=1;(L - 1 + N * i)<9;i++)
    {
        bool flag = true;
        while (flag == true&& (L - 1 + N * i)<9)
        {
            flag = false;
            for (auto c : vl)
            {
                if (v[L - 1 + N * i] == c)
                {
                    flag = true;//找到了相同的值继续下一个
                    L++;
                    break;
                }
            }

            if (flag == false)//没有找到直接输出并退出
            {
                vl.push_back(v[L - 1 + N * i]);
                break;
            }
        }
    }

        for (auto d : vl)
            cout << d << endl;
    system("pause");
    return 0;
}

你可能感兴趣的:(1124 Raffle for Weibo Followers(20 分))