Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main(){
- int TC; cin>>TC;
- for(int tc = 1; tc <= TC; tc++){
- //first 80 days put in from 1 to 16
- //then inspect the 4 from 17 to 20. find the min
- //put in all the others for the rest of the day
- vector<int> perm(20);
- for(int i = 0; i < 20; i++) perm[i] = i+1;
- random_shuffle(perm.begin(), perm.end());
- int pntr = 0;
- for(int d = 1; d <= 80; d++){
- int dayno; cin>>dayno;
- assert(d == dayno);
- cout<<(perm[pntr])<<" "<<1<<endl;
- pntr = (pntr + 1)%15;
- }
- int best = 1000, indx = -1;
- for(int j = 16; j <= 20; j++){
- int dayno; cin>>dayno;
- cout<<perm[j-1]<<" "<<0<<endl;
- int sz; cin>>sz;
- for(int k = 0; k < sz; k++){
- int temp; cin>>temp;
- }
- if(best >= sz){
- best = sz; indx = j;
- }
- }
- pntr = 0;
- vector<int> order = {16, 17, 18, 19, 20};
- order.erase(indx-16+order.begin());
- for(int d = 86; d <= 99; d++){
- int dayno; cin>>dayno;
- assert(dayno == d);
- cout<<(perm[order[pntr]-1])<<" "<<1<<endl;
- pntr = (pntr + 1)%order.size();
- }
- int temp2; cin>>temp2;
- cout<<perm[indx-1]<<" "<<100<<endl;
- }
- }
Add Comment
Please, Sign In to add comment