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()) mt19937 sd(std::random_device{}()); string YN(bool x,string Y="Yes",string N="No") { if(x){ return Y; } else { return N; } } unsigned int qpow(unsigned int a,int b){ unsigned int res=1; while(b){ if(b&1)res*=a; b>>=1;a*=a; } return res; } unsigned int m,n; unsigned int a[105]; unsigned int f[105]; unsigned int binom(int x,int y){ if(x<y)return 0; vector<int>v1,v2; REP(i,0,y)v1.pb(x-i),v2.pb(i+1); REP(i,0,y){ REP(j,0,y){ REP(k,0,y){ if(__gcd(v1[j],v2[k])!=1){ int x=__gcd(v1[j],v2[k]); v1[j]/=x;v2[k]/=x; } } } } unsigned int res=1; for(auto i:v1)res=1ull*res*i; return res; } void Main() { cin>>m>>n; REP(i,0,100){ REP(j,0,i)a[i]+=qpow(j,m); } f[0]=a[0]; REP(j,0,70){ for(int i=70;i>=1;--i)a[i]-=a[i-1]; f[j+1]=a[j+1]; } unsigned int ans=0; REP(i,0,70)ans+=binom(n,i)*f[i]; cout<<ans<<endl; } void TC() { int tc=1; while(tc--){ Main(); cout.flush(); } } signed main() { freopen("cumin.in","r",stdin);freopen("cumin.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
- 2920
- Time
- 500ms
- Memory
- 256MiB
- Difficulty
- 10
- Tags
- (None)
- # Submissions
- 1
- Accepted
- 1
- Uploaded By