60分非特殊性质错
查看原帖
60分非特殊性质错
751837
siyuan_zhou楼主2024/11/30 11:24
#include<bits/stdc++.h>
#define int long long
#define f(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
signed main() {
	int n;
	cin>>n;
	f(i,1,n) {
		int t;
		cin>>t;
		if(t==1) cout<<-1<<endl;
		if(t==3) cout<<7<<endl;
		if(t==4) cout<<4<<endl;
		if(t%7==0) {
			f(i,1,t/7) cout<<8;
			cout<<endl;
		}
		if(t%7==1 && t!=1) {
			cout<<10;
			f(i,1,t/7-1) cout<<8;
			cout<<endl;
		}
		if(t%7==2) {
			cout<<1;
			f(i,1,t/7) cout<<8;
			cout<<endl;
		}
		if(t%7==3 && t!=3) {
			if(t==10) {
			    cout<<22<<endl;
			    continue;
			}
			cout<<200;
			f(i,1,t/7-1) cout<<8;
			cout<<endl;
		}
		if(t%7==4 && t!=4) {
			cout<<20;
			f(i,1,t/7-1) cout<<8;
			cout<<endl;
		}
		if(t%7==5) {
			cout<<2;
			f(i,1,t/7) cout<<8;
			cout<<endl;
		}
		if(t%7==6) {
			cout<<6;
			f(i,1,t/7) cout<<8;
			cout<<endl;
		}
	}
	return 0;
}
2024/11/30 11:24
加载中...