其他分享
首页 > 其他分享> > 我的草稿hhh

我的草稿hhh

作者:互联网

#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cmath>
#define int long long
typedef long long ll; 
using namespace std;
typedef pair<int,int> PII;
const int N=1e6+5;
int a[N];
int cnt[10]={0,7,27,41,49,63,78,108};
signed main()
{
	int t;
	cin >> t;
	while(t--){
		int n;
		cin >> n;
		int sum=0;
		for(int i=1;i<=n;i++){
			cin >> a[i];
			sum=sum+cnt[a[i]];
		}
		int ans=sum;
		if(sum>=120){
			ans=min(ans,sum-50);
			ans=min(ans,sum-30);
			ans=min(ans,sum-15);
			cout << ans << endl;
		}
		else if(sum>=89){
			ans=min(ans,sum-30);
			ans=min(ans,sum-15);
			cout << ans << endl;
		}
		else if(sum>=69){
			ans=min(ans,sum-15);
			cout << ans << endl;
		}
		else{
			cout << ans << endl;
		}
	} 
	return 0;
 } 
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cmath>
#define int long long
typedef long long ll; 
using namespace std;
typedef pair<int,int> PII;
signed main()
{
	int t;
	cin >> t;
	while(t--){
		int n;
		cin >> n;
		cout << 6*n << " " << 3 << endl;
		for(int i=1;i<=3;i++){
			if(i!=1){
				cout << " " ;
			}
			cout << i*n ;
		}
		cout << endl;
	}
	return 0;
 } 

标签:hhh,cout,草稿,int,sum,long,ans,include
来源: https://blog.csdn.net/m0_50918411/article/details/118488419