Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include<bits/stdc++.h>
- //using namespace std;
- //typedef long long ll;
- //
- //int main()
- //{
- // //freopen("C:\\Users\\Ambition\\Desktop\\in.txt","r",stdin);
- // int n, num;
- // cin >> n;
- // map<int, priority_queue<int> > mpq;
- // for(int i = 0; i < n; i++){
- // cin >> num;
- // mpq[num % 7].push(num);
- // }
- // ll ans = 0;
- // while(!mpq[0].empty()){
- // int t = mpq[0].top();
- // mpq[0].pop();
- // if(t > 0) ans += t;
- // }
- // while(!mpq[1].empty() && !mpq[6].empty()){
- // int t = mpq[1].top() + mpq[6].top();
- // mpq[1].pop();
- // mpq[6].pop();
- // if(t > 0) ans += t;
- // }
- // while(!mpq[2].empty() && !mpq[5].empty()){
- // int t = mpq[2].top() + mpq[5].top();
- // mpq[2].pop();
- // mpq[5].pop();
- // if(t > 0) ans += t;
- // }
- // while(!mpq[3].empty() && !mpq[4].empty()){
- // int t = mpq[3].top() + mpq[4].top();
- // mpq[3].pop();
- // mpq[4].pop();
- // if(t > 0) ans += t;
- // }
- // cout << ans << endl;
- // return 0;
- //}
- ////第一行是一个正整数n,表示桌上有n张写有数字的卡片。
- ////第二行有n个空格隔开的整数a1,a2,…,an,其中ai表示桌上第i张卡片上所写的数字。
- ////1<=n<=50000, |ai|<=3000
- ////小美喜欢7的倍数。桌面上有一些卡片,每张卡片上都印有一个数字,小美想从中挑选一些卡片,
- ////使得卡片上的数字之和最大,由于小美很喜欢7的倍数,她同时还希望挑选出的卡片的数字之和是7的倍数,
- ////请问她能挑选出的最大数字之和是多少?(注意,小美也可以一张卡片都不挑选)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement