我的草稿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;
 } 
#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;
string a;
int flag=0;
map<string,string>m;
void cal(string a){
	int lena=a.length();
	if(flag==1){
		cout << " ";
	}
	if(lena==1){
		cout << a << a ;
	}
	else if(lena==2){
		cout << a ;
	} 
	else{
		if(m.find(a)!=m.end()){//能够整个找到 ang 
			cout << a[0] << m[a] ;
		}
		else{
			if(a[0]=='z' || a[0]=='c' || a[0]=='s'){
				if(a[1]=='h'){
					string b="";
					b=b+a[0]+a[1];
					string c=a.substr(2,lena-2);
					cout << m[b] << m[c];
				}
				else{
					string b=a.substr(1,lena-1);
					string d="";
					d=d+a[0];
					cout << m[d] << m[b] ;
				}
			}
			else{
//				cout << "a==" << a << endl; 
				string b=a.substr(1,lena-1);
//				cout << "b==" << b <<endl; 
				string d="";
				d=d+a[0];
//				cout << "d==" << d << endl; 
				cout << m[d] << m[b] ;
			}
		}
	}
}
void init(){
	m["q"]="q";
	m["iu"]="q";
	m["w"]="w";
	m["ei"]="w";
	m["e"]="e";
	m["r"]="r";
	m["uan"]="r";
	m["t"]="t";
	m["ue"]="t";
	m["y"]="y";
	m["un"]="y";
	m["u"]="u";
	m["sh"]="u";
	m["i"]="i";
	m["ch"]="i";
	m["o"]="o";
	m["uo"]="o";
	m["p"]="p";
	m["ie"]="p";
	m["a"]="a";
	m["s"]="s";
	m["ong"]="s";
	m["iong"]="s";
	m["d"]="d";
	m["ai"]="d";
	m["f"] = "f";
	m["en"] = "f";
	m["g"] = "g";
	m["eng"] = "g";
	m["h"] = "h";
	m["ang"] = "h";
	m["j"] = "j";
	m["an"] = "j";
	m["k"] = "k";
	m["uai"] = "k";
	m["ing"] = "k";
	m["l"] = "l";
	m["uang"] = "l";
	m["iang"] = "l";
	m["z"] = "z";
	m["ou"] = "z";
	m["x"] = "x";
	m["ia"] = "x";
	m["ua"] = "x";
	m["c"] = "c";
	m["ao"] = "c";
	m["v"] = "v";
	m["zh"] = "v";
	m["ui"] = "v";
	m["b"] = "b";
	m["in"] = "b";
	m["n"] = "n";
	m["iao"] = "n";
	m["m"] = "m";
	m["ian"] = "m";
}
signed main()
{
	init();
	string s;
	while(getline(cin,s)){
		flag=0;
		int len=s.length();
		for(int i=0;i<len;i++){
			if(s[i]==' ' || i == len-1){
				if(i==len-1){
					a=a+s[i];
				}
//				cout << i << "*" << endl;
				cal(a);
				flag=1;
				a="";
			}
			else{
				a=a+s[i];
			}
		}
		cout << endl;
	}
	return 0;
 } 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值