我不忍心再次提起GRE,痛!


如果不知道“杨鹏17天搞定GRE单词”的话自行搜索去吧

这程序还是存在bug的…比如说红宝书是52个list的时候,不管那么多了,我要开始背单词了!

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
  
//红宝书一共有51个list
const int LIST_AMOUNT = 51;

//速度按每天3个新list来计算,快慢可以调整
const int LISTS_PER_DAY = 3;

//学一轮要几天
const int DAYS_PER_PASS = LIST_AMOUNT / LISTS_PER_DAY;

int main()
{
    //预计将花在这几轮单词上的总天数
    int total_days = DAYS_PER_PASS + 31;

    //学习新lists,每天得学第几个片段
    vector<int> new_list_indices(DAYS_PER_PASS);
    for (int i=0;i<DAYS_PER_PASS;i++)
    {
        new_list_indices[i] = i;
    }

    //复习lists,每天要复习哪几个片段
    vector<vector<int>> todos(total_days);
  
    for (int i=0;i<DAYS_PER_PASS;i++)
    {
        int index = new_list_indices[i];

        //当天复习
        todos[i].push_back(index);

        //1天后
        todos[i+1].push_back(index);

        //2天后
        todos[i+2].push_back(index);

        //4天后
        todos[i+4].push_back(index);

        //7天后
        todos[i+7].push_back(index);

        //15天后
        todos[i+15].push_back(index);

        //30天后
        todos[i+30].push_back(index);
    }

    for (int i=0;i<total_days;i++)
    {
        //先排下序,从小到大
        sort(todos[i].begin(), todos[i].end());

        cout << "D" << i+1 << ": " << endl;
        if (i < DAYS_PER_PASS)
        {
            cout << "    NEW    : " << new_list_indices[i] * LISTS_PER_DAY + 1 << "-" << (new_list_indices[i]+1) * LISTS_PER_DAY << endl;
        }

        if (!todos[i].empty())
        {
            cout << "    REVIEW : ";
            for (vector<int>::iterator it=todos[i].begin();it!=todos[i].end();it++)
            {
                cout << *it * LISTS_PER_DAY + 1 << "-" << (*it+1) * LISTS_PER_DAY << "  ";
            }
            cout << endl;
        }

        cout << endl;
    }

    return 0;
}

后记

现在让我写应该会用Python去写吧… (2013/07/16)