Guest User

GCJ p2 WA

a guest
May 18th, 2019
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6. int TC; cin>>TC;
  7. for(int tc = 1; tc <= TC; tc++){
  8. //first 80 days put in from 1 to 16
  9. //then inspect the 4 from 17 to 20. find the min
  10. //put in all the others for the rest of the day
  11. int pntr = 0;
  12. for(int d = 1; d <= 80; d++){
  13. int dayno; cin>>dayno;
  14. // /assert(d == dayno);
  15. cout<<(pntr+1)<<" "<<1<<endl;
  16. pntr = (pntr + 1)%15;
  17. }
  18. int best = 1000, indx = -1;
  19. for(int j = 16; j <= 20; j++){
  20. int dayno; cin>>dayno;
  21. cout<<j<<" "<<0<<endl;
  22. int sz; cin>>sz;
  23. for(int k = 0; k < sz; k++){
  24. int temp; cin>>temp;
  25. }
  26.  
  27. if(best >= sz){
  28. best = sz; indx = j;
  29. }
  30. }
  31. pntr = 0;
  32. vector<int> order = {16, 17, 18, 19, 20};
  33. order.erase(indx-16+order.begin());
  34. for(int d = 86; d <= 99; d++){
  35. int dayno; cin>>dayno;
  36. assert(dayno == d);
  37. cout<<(order[pntr])<<" "<<1<<endl;
  38. pntr = (pntr + 1)%order.size();
  39. }
  40. int temp2; cin>>temp2;
  41. cout<<indx<<" "<<100<<endl;
  42. }
  43. }
Add Comment
Please, Sign In to add comment