Advertisement
ambition-xx

meituan3

Mar 26th, 2022
852
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.49 KB | None | 0 0
  1. //#include<bits/stdc++.h>
  2. //using namespace std;
  3. //typedef long long ll;
  4. //
  5. //int main()
  6. //{
  7. //  //freopen("C:\\Users\\Ambition\\Desktop\\in.txt","r",stdin);
  8. //  int n, num;
  9. //  cin >> n;
  10. //  map<int, priority_queue<int> > mpq;
  11. //  for(int i = 0; i < n; i++){
  12. //      cin >> num;
  13. //      mpq[num % 7].push(num);
  14. //  }
  15. //  ll ans = 0;
  16. //  while(!mpq[0].empty()){
  17. //      int t = mpq[0].top();
  18. //      mpq[0].pop();
  19. //      if(t > 0) ans += t;
  20. //  }
  21. //  while(!mpq[1].empty() && !mpq[6].empty()){
  22. //      int t = mpq[1].top() + mpq[6].top();
  23. //      mpq[1].pop();
  24. //      mpq[6].pop();
  25. //      if(t > 0) ans += t;
  26. //  }
  27. //  while(!mpq[2].empty() && !mpq[5].empty()){
  28. //      int t = mpq[2].top() + mpq[5].top();
  29. //      mpq[2].pop();
  30. //      mpq[5].pop();
  31. //      if(t > 0) ans += t;
  32. //  }
  33. //  while(!mpq[3].empty() && !mpq[4].empty()){
  34. //      int t = mpq[3].top() + mpq[4].top();
  35. //      mpq[3].pop();
  36. //      mpq[4].pop();
  37. //      if(t > 0) ans += t;
  38. //  }
  39. //  cout << ans << endl;
  40. //  return 0;
  41. //}
  42. ////第一行是一个正整数n,表示桌上有n张写有数字的卡片。
  43. ////第二行有n个空格隔开的整数a1,a2,…,an,其中ai表示桌上第i张卡片上所写的数字。
  44. ////1<=n<=50000, |ai|<=3000
  45. ////小美喜欢7的倍数。桌面上有一些卡片,每张卡片上都印有一个数字,小美想从中挑选一些卡片,
  46. ////使得卡片上的数字之和最大,由于小美很喜欢7的倍数,她同时还希望挑选出的卡片的数字之和是7的倍数,
  47. ////请问她能挑选出的最大数字之和是多少?(注意,小美也可以一张卡片都不挑选)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement