Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

Help in IPCTRAIN

$
0
0

i am unable to understand author's solution

link to the problem:-https://www.codechef.com/problems/IPCTRAIN

here is the author's solution:-https://s3.amazonaws.com/codechef_shared/download/Solutions/JULY17/Setter/IPCTRAIN.cpp

the part i am unable to undrstand is

   for (auto it: persons)
 {
 int lec = lectures[it.second];

        for (int i = 0; i < lec; i++) {
            auto iter = daySet.lower_bound(startDay[it.second]);
            if (iter == daySet.end()) {
                break;
            } else {
                lecturesTaken[it.second]++;
              daySet.erase(iter);
            }
        }
    }

what is this part doing


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>