全WA,样例能过,请大家帮忙看看,过了互关
查看原帖
全WA,样例能过,请大家帮忙看看,过了互关
1473392
fly_high_sky楼主2025/8/29 16:15
#include<bits/stdc++.h>
using namespace std;
int n,m;
string s[19]={"","-1","1","7","4","2","6","8","10","18","22","20","20","28","68","88","108","188","200"};
int main(){
	cin>>m;
	while(m--){
		cin>>n;
		if(n<18){
			cout<<s[n]<<endl;
		}else{
			string cnt="";
			while(n>=18){
				cnt+="8";
				n-=7;
			}
			cnt=s[n]+cnt;
			cout<<cnt<<endl;
		}
	}
	return 0;
}

2025/8/29 16:15
加载中...