2017 ACM-ICPC 亚洲区(西安赛区)网络赛 C.Sum

来源:互联网 发布:mac后台程序关不上 编辑:程序博客网 时间:2024/06/06 00:57
传送门:点击打开链接

Define the function S(x)S(x) for xx is a positive integer. S(x)S(x) equals to the sum of all digit of the decimal expression of xx. Please find a positive integer kk that S(k*x)\%233=0S(kx)%233=0.

Input Format

First line an integer TT, indicates the number of test cases (T \le 100T100). Then Each line has a single integer x(1 \le x \le 1000000)x(1x1000000) indicates i-th test case.

Output Format

For each test case, print an integer in a single line indicates the answer. The length of the answer should not exceed 20002000. If there are more than one answer, output anyone is ok.

样例输入

11

样例输出

89999999999999999999999999

题目来源

2017 ACM-ICPC 亚洲区(西安赛区)网络赛

搞笑,五个小时做不出来的题,听说每次都输出的是0就过了,0是正整数吗?搞笑,赛后提交全输出0就不对。。。。。仔细想想输出233个9就行,这样的数乘任何数的和都是233的倍数,别问我是怎么知道的,我不知道,这个题我没看过,这个题什么意思?西安网络赛是什么鬼?为什么入坑ACM?洗洗睡吧,明天还有青岛站。

代码实现:

#include<iostream>#include<algorithm>#include<cstring>#include<cmath>#include<queue>#include<cstdio>#define ll long long#define mset(a,x) memset(a,x,sizeof(a))using namespace std;const double PI=acos(-1);const int inf=0x3f3f3f3f;const double esp=1e-6;const int maxn=100005;const int mod=1e9+7;int dir[4][2]={0,1,1,0,0,-1,-1,0};ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}ll lcm(ll a,ll b){return a/gcd(a,b)*b;}ll inv(ll b){if(b==1)return 1; return (mod-mod/b)*inv(mod%b)%mod;}ll fpow(ll n,ll k){ll r=1;for(;k;k>>=1){if(k&1)r=r*n%mod;n=n*n%mod;}return r;}int main(){int t,n,i,j;cin>>t;while(t--){cin>>n;for(i=0;i<233;i++)cout<<"9";cout<<endl;}return 0;}


阅读全文
0 0
原创粉丝点击