#define ll long long// Yup it doesn't with LRU but OPT page replacement policy works.void solve(){// A map to store all the occurences where a customer will arrive in near future.vector < set <ll> > v(405);cin >> n >> m;ll a[m];for(ll i=0;i<m;i++){cin >> a[i];v[a[i]].insert(i);}ll ans=0;set <ll> table;ll i=0;// First fill all the empty tables.while(table.size()<n and i<m){table.insert(a[i]);v[a[i]].erase(i);
Read more…