chenweizhen 的题解:CF248B题解
评测记录
代码如下:
#include <iostream>
#include <cmath>
using namespace std;
int n;
int main(){
cin>>n;
long long x;
int x1=n;
while(x1>0){
x1--;
x*=10,x+=9;
}
for(int i=pow(10,n-1);i<=x;i++){
if(i%210==0){
cout<<i<<endl;
return 0;
}
}
cout<<-1<<endl;
return 0;
}
看过题的都知道 long long 存不下,还说:
我看楼下的大佬用的都是找规律的方法,那本蒟蒻就在这里提出一种新颖的解法。QAQ