Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long long get_score(vector<cache> &sol){
- int i; request req; long long res=0;
- map<int,bool> mp[1010];
- for (i=0; i<C; i++){
- mp[i].clear();
- for (int vid:sol[i].videos) mp[i][vid]=1;
- }
- for (i=0; i<R; i++){
- bool found=0;
- req=requests[i];
- for (connection cnct:epoints[req.e_point].cnct){
- if (mp[cnct.dest].count(req.video)){
- res+=1LL*req.nr*cnct.lat;
- found=1;
- break;
- }
- }
- if (!found) res+=1LL*epoints[req.e_point].data_serv_lat*req.nr;
- }
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement