WA0分,求助
查看原帖
WA0分,求助
1246690
Pharaoh__楼主2025/1/17 16:53
#include<bits/stdc++.h>
using namespace std;

long long t,n,cnt;
string s;

void speed() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

int main() {
	speed();
	cin>>t;
	while(t--) {
		cin>>n;
		if(n<7) {
			if(n==1)printf("%d\n",-1);
			else if(n==2)printf("%d\n",1);
			else if(n==3)printf("%d\n",7);
			else if(n==4)printf("%d\n",4);
			else if(n==5)printf("%d\n",2);
			else if(n==6)printf("%d\n",6);
			continue;
		}
		cnt=n%7;
		int k=n/7;
		if(cnt==1) {
			k--;
			printf("%d",10);
		} else if(cnt==2) {
			printf("%d",1);
		} else if(cnt==3) {
			if(n==10) {
				k=0;
				printf("%d",22);
			} else {
				k-=2;
				printf("%d",200);
			}
		} else if(cnt==4) {
			k--;
			printf("%d",20);
		} else if(cnt==5) {
			printf("%d",2);
		} else if(cnt==6) {
			printf("%d",6);
		}
		while(k--) {
			printf("%d",8);
		}
		cout<<endl;
	}
	return 0;
}
2025/1/17 16:53
加载中...