1 solutions
-
0
/* * __----~~~~~~~~~~~------___ * . . ~~//====...... __--~ ~~ * -. \_|// |||\\ ~~~~~~::::... /~ * ___-==_ _-~o~ \/ ||| \\ _/~~- * __---~~~.==~||\=_ -_--~/_-~|- |\\ \\ _/~ * _-~~ .=~ | \\-_ '-~7 /- / || \ / * .~ .~ | \\ -_ / /- / || \ / * / ____ / | \\ ~-_/ /|- _/ .|| \ / * |~~ ~~|--~~~~--_ \ ~==-/ | \~--===~~ .\ * ' ~-| /| |-~\~~ __--~~ * |-~~-_/ | | ~\_ _-~ /\ * / \ \__ \/~ \__ * _--~ _/ | .-~~____--~-/ ~~==. * ((->/~ '.|||' -_| ~~-/ , . _|| * -_ ~\ ~~---l__i__i__i--~~_/ * _-~-__ ~) \--______________--~~ * //.-~~~-~_--~- |-------~~~~~~~~ * //.-~~~--\ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * 神兽保佑 永无BUG */ /* * @Description: I want to be the weakest vegetable in the world! * @Author: I.Z. */ #include<bits/stdc++.h> using namespace std; #define MOD 998244353 #define speMOD 2933256077ll #define int long long #define pii pair<int,int> #define all(v) v.begin(),v.end() #define pb push_back #define REP(i,b,e) for(int i=(b);i<(int)(e);++i) #define over(x) {cout<<(x)<<endl;return;} #define lowbit(x) ((x)&(-(x))) #define cntbit(x) __builtin_popcount(x) #define rf(v) shuffle(all(v),sd); #define deal(v) sort(all(v));v.erase(unique(v.begin(),v.end()),v.end()) #define lbound(v,x) lower_bound(all(v),x)-v.begin() mt19937 sd(random_device{}()); int qpow(int a,int b,int m=MOD,int res=1){ a%=m; while(b>0)res=(b&1)?(res*a%m):(res),a=a*a%m,b>>=1; return res; } string YN(bool x,string Y="Yes",string N="No") { if(x){ return Y; } else { return N; } } int exgcd(int x,int y,int &a,int &b){ if(y==0){ a=1;b=0; return x; } int d=exgcd(y,x%y,a,b); int z=b; b=a-b*(x/y); a=z; return d; } int _x_,_y_; inline int inverse(int x,int y=MOD){ exgcd(x,y,_x_,_y_); return (_x_+y)%y; } int fac[2000005],inv[2000005]; void init(int n){ fac[0]=inv[0]=1; REP(i,1,n+1)fac[i]=fac[i-1]*i%MOD; inv[n]=qpow(fac[n],MOD-2); for(int i=n-1;i>=1;--i)inv[i]=inv[i+1]*(i+1)%MOD; } int binom(int x,int y){ return x<y||y<0? 0:fac[x]*inv[y]%MOD*inv[x-y]%MOD; } string b[10][16]={ {"9","100559404365","1005594043670359641775","10055940436703596417765282536169","100559404367035964177652825361730559404364","1005594043670359641776528253617305594043670359641773","10055940436703596417765282536173055940436703596417765282536167","100559404367035964177652825361730559404367035964177652825361730559404362","1005594043670359641776528253617305594043670359641776528253617305594043670359641772","10055940436703596417765282536173055940436703596417765282536173055940436703596417765282536164","100559404367035964177652825361730559404367035964177652825361730559404367035964177652825361730559404361","1005594043670359641776528253617305594043670359641776528253617305594043670359641776528253617305594043670359641770","10055940436703596417765282536173055940436703596417765282536173055940436703596417765282536173055940436703596417765282536161","100559404367035964177652825361730559404367035964177652825361730559404367035964177652825361730559404367035964177652825361730559404359","1005594043670359641776528253617305594043670359641776528253617305594043670359641776528253617305594043670359641776528253617305594043670359641769","10055940436703596417765282536173055940436703596417765282536173055940436703596417765282536173055940436703596417765282536173055940436703596417765282536160"}, {"0","199990","1999919999999980","19999199999999919999999970","199991999999999199999999919999999960","1999919999999991999999999199999999919999999950","19999199999999919999999991999999999199999999919999999940","199991999999999199999999919999999991999999999199999999919999999930","1999919999999991999999999199999999919999999991999999999199999999919999999920","19999199999999919999999991999999999199999999919999999991999999999199999999919999999918","199991999999999199999999919999999991999999999199999999919999999991999999999199999999919999999917","1999919999999991999999999199999999919999999991999999999199999999919999999991999999999199999999919999999916","19999199999999919999999991999999999199999999919999999991999999999199999999919999999991999999999199999999919999999915","199991999999999199999999919999999991999999999199999999919999999991999999999199999999919999999991999999999199999999919999999914","1999919999999991999999999199999999919999999991999999999199999999919999999991999999999199999999919999999991999999999199999999919999999913","19999199999999919999999991999999999199999999919999999991999999999199999999919999999991999999999199999999919999999991999999999199999999919999999912"}, {"1","28263827","282638284722222221","2826382847222222222222222221","28263828472222222222222222222222222221","282638284722222222222222222222222222222222222221","2826382847222222222222222222222222222222222222222222222221","28263828472222222222222222222222222222222222222222222222222222222221","282638284722222222222222222222222222222222222222222222222222222222222222222221","2826382847222222222222222222222222222222222222222222222222222222222222222222222222222221","28263828472222222222222222222222222222222222222222222222222222222222222222222222222222222222222221","282638284722222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221","2826382847222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221","28263828472222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221","282638284722222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221","2826382847222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221"}, {"2","371599992","3715999939999999982","37159999399999999939999999972","371599993999999999399999999939999999962","3715999939999999993999999999399999999939999999952","37159999399999999939999999993999999999399999999939999999942","371599993999999999399999999939999999993999999999399999999939999999938","3715999939999999993999999999399999999939999999993999999999399999999939999999937","37159999399999999939999999993999999999399999999939999999993999999999399999999939999999936","371599993999999999399999999939999999993999999999399999999939999999993999999999399999999939999999935","3715999939999999993999999999399999999939999999993999999999399999999939999999993999999999399999999939999999934","37159999399999999939999999993999999999399999999939999999993999999999399999999939999999993999999999399999999939999999933","371599993999999999399999999939999999993999999999399999999939999999993999999999399999999939999999993999999999399999999939999999932","3715999939999999993999999999399999999939999999993999999999399999999939999999993999999999399999999939999999993999999999399999999939999999932","37159999399999999939999999993999999999399999999939999999993999999999399999999939999999993999999999399999999939999999993999999999399999999939999999931"}, {"3","499999993","4999999949999999983","49999999499999999949999999973","499999994999999999499999999949999999963","4999999949999999994999999999499999999949999999953","49999999499999999949999999994999999999499999999949999999948","499999994999999999499999999949999999994999999999499999999949999999947","4999999949999999994999999999499999999949999999994999999999499999999949999999946","49999999499999999949999999994999999999499999999949999999994999999999499999999949999999945","499999994999999999499999999949999999994999999999499999999949999999994999999999499999999949999999944","4999999949999999994999999999499999999949999999994999999999499999999949999999994999999999499999999949999999943","49999999499999999949999999994999999999499999999949999999994999999999499999999949999999994999999999499999999949999999943","499999994999999999499999999949999999994999999999499999999949999999994999999999499999999949999999994999999999499999999949999999942","4999999949999999994999999999499999999949999999994999999999499999999949999999994999999999499999999949999999994999999999499999999949999999941","49999999499999999949999999994999999999499999999949999999994999999999499999999949999999994999999999499999999949999999994999999999499999999949999999940"}, {"4","5555555554","55555555555555555554","555555555555555555555555555554","5555555555555555555555555555555555555554","55555555555555555555555555555555555555555555555554","555555555555555555555555555555555555555555555555555555555554","5555555555555555555555555555555555555555555555555555555555555555555554","55555555555555555555555555555555555555555555555555555555555555555555555555555554","555555555555555555555555555555555555555555555555555555555555555555555555555555555555555554","5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555554","55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555554","555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555554","5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555554","55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555554","555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555554"}, {"5","6666666665","66666666666666666665","666666666666666666666666666665","6666666666666666666666666666666666666665","66666666666666666666666666666666666666666666666665","666666666666666666666666666666666666666666666666666666666665","6666666666666666666666666666666666666666666666666666666666666666666665","66666666666666666666666666666666666666666666666666666666666666666666666666666665","666666666666666666666666666666666666666666666666666666666666666666666666666666666666666665","6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666665","66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666665","666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666665","6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666665","66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666665","666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666665"}, {"6","7777777776","77777777777777777776","777777777777777777777777777776","7777777777777777777777777777777777777776","77777777777777777777777777777777777777777777777776","777777777777777777777777777777777777777777777777777777777776","7777777777777777777777777777777777777777777777777777777777777777777776","77777777777777777777777777777777777777777777777777777777777777777777777777777776","777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776","7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776","77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776","777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776","7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776","77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776","777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776"}, {"7","8888888887","88888888888888888887","888888888888888888888888888887","8888888888888888888888888888888888888887","88888888888888888888888888888888888888888888888887","888888888888888888888888888888888888888888888888888888888887","8888888888888888888888888888888888888888888888888888888888888888888887","88888888888888888888888888888888888888888888888888888888888888888888888888888887","888888888888888888888888888888888888888888888888888888888888888888888888888888888888888887","8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888887","88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888887","888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888887","8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888887","88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888887","888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888887"}, {"8","9999999998","99999999999999999998","999999999999999999999999999998","9999999999999999999999999999999999999998","99999999999999999999999999999999999999999999999998","999999999999999999999999999999999999999999999999999999999998","9999999999999999999999999999999999999999999999999999999999999999999998","99999999999999999999999999999999999999999999999999999999999999999999999999999998","999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998","9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998","99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998","999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998","9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998","99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998","999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998"}}; int n=10; int a[10]; string res; bool cmp(string s,string t){ if(s.size()>t.size())return 1; if(s.size()<t.size())return 0; REP(i,0,s.size()){ if(s[i]>t[i])return 1; if(s[i]<t[i])return 0; } return 0; } void Main() { REP(i,0,n)cin>>a[i]; res=b[0][a[0]]; REP(i,1,n)if(cmp(res,b[i][a[i]]))res=b[i][a[i]]; cout<<res<<endl; } void TC() { int tc=1; while(tc--){ Main(); cout.flush(); } } signed main() { freopen("number.in","r",stdin); freopen("number.out","w",stdout); return cin.tie(0),cout.tie(0),ios::sync_with_stdio(0),TC(),0; } /* 1. CLEAR the arrays (ESPECIALLY multitests) 2. DELETE useless output */
- 1
Information
- ID
- 2933
- Time
- 4000ms
- Memory
- 512MiB
- Difficulty
- 10
- Tags
- (None)
- # Submissions
- 2
- Accepted
- 2
- Uploaded By