标签:span space har printf alt == ... ret def
有点类似CF某场div2T1...
前面接上1234567890000000,后面加上x+(1234567890000000%x)就可以保证是x的倍数了
#include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<algorithm> #define ll long long using namespace std; const int maxn=500010,inf=1e9; int T,x; void read(int &k) { int f=1;k=0;char c=getchar(); while(c<‘0‘||c>‘9‘)c==‘-‘&&(f=-1),c=getchar(); while(c<=‘9‘&&c>=‘0‘)k=k*10+c-‘0‘,c=getchar(); k*=f; } int main() { read(T); while(T--) { read(x); if(x)printf("1234567890%06lld\n",1ll*x-(1234567890000000ll%x)); else printf("-1\n"); } return 0; }
bzoj2296: 【POJ Challenge】随机种子(思维题/水题)
标签:span space har printf alt == ... ret def
原文地址:http://www.cnblogs.com/Sakits/p/7628967.html