l[j].counter=0;Р }Р printf("NUR:%6.4f",1-(float)diseffect/320);Р }Р void OPT (total_pf) /*OPT*/Р int total_pf;Р {int i,j,max,maxpage,d,dist[total_vp];Р pfc_type *t;Р initialize(total_pf);Р for(i=0;i<total_instruction;i++)Р {Р if(pl[page[i]].pfn==INVALID)Р {diseffect++;Р if(freepf_head==null)Р { for(j=0;j<total_vp;j++)Р if(pl[page[j]].pfn!=INVALID)Р dist[j]=32767;Р else dist[j]=0;Р d=1;Р for(j=i+1;j<total_instruction;j++)Р {if(pl[page[j]].pfn!=INVALID)Р dist[page[j]]=d;Р d++;Р }Р max=-1;Р for(j=0;j<total_vp;j++)Р if(max<dist[j])Р { max=dist[j];Р maxpage=j;}Р freepf_head=&pfc[pl[maxpage].pfn];Р freepf_head->next=null;Р pl[maxpage].pfn=INVALID;Р }Р pl[page[i]].pfn=freepf_head->pfn;Р freepf_head=freepf_head->next;Р }Р }Р printf("OPT:%6.4f",1-(float)diseffect/320);Р }Рvoid LFU(total_pf) /*LFU*/