Codeforces Global Round 7 A. Bad Ugly Numbers(数学)

题意:

给你一个 n,输出一个 n 位不含 0 且不被任一位整除的正数。

思路:

构造 233 或 899。

#include <bits/stdc++.h>
using namespace std;
void solve(){
    int n;cin>>n;
    if(n==1)
        cout<<"-1\n";
    else
        cout<<"2"<<string(n-1,'3')<<"\n";
}
int main()
{
    int t;cin>>t;
    while(t--)
        solve();
    return 0;
}

 

posted @ 2020-03-20 01:11  Kanoon  阅读(253)  评论(0编辑  收藏  举报