60 wrong answer 求救
查看原帖
60 wrong answer 求救
1050581
chen__pengyu楼主2024/11/4 22:06
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a[]={-1,1,7,4,2,6,8,10,18,23,20,28,68,88,108,188,200,208,288,688,888,1088,1888,2288,2088,2888,6888,8888,10888,18888,22888,20888,28888,68888,88888,108888,188888,228888,208888,288888,688888,888888,1088888,1888888,2288888,2088888,2888888,6888888,8888888,10888888};
	int b[]={1088,1888,2288,2088,2888,6888,8888};
	int n,t;
	cin>>t;
	for(int i=1;i<=t;i++){
		cin>>n;
		if(n<=21){
			cout<<a[n-1]<<endl;
		}else{
			cout<<b[((n-22)%7)];
				for(int j=1;j<=(n-22)/7;j++){
					cout<<8;
				}
				cout<<endl;
		}
	} 
	return 0;
}
2024/11/4 22:06
加载中...