Submission #73251

#TimeUsernameProblemLanguageResultExecution timeMemory
73251maus1208Asceticism (JOI18_asceticism)C++14
0 / 100
3 ms348 KiB
#import<bits/stdc++.h> using namespace std; #define sysp system("pause") #define mod 1000000007 #define rmod 1000000005 typedef long long ll; ll n,k,ans; vector<ll> f,rf; ll mypow(ll x,ll n){ ll ret=1; while(n>0){ if((n&1)==1){ ret*=x%mod; } x*=x%mod; n>>=1; } return ret%mod; } void init(){ f[0]=1; rf[0]=1; for(ll i=1;i<=100010;i++){ f[i]*=i*f[i-1]%mod; rf[i]=mypow(f[i],rmod); } } int main(){ cin>>n>>k; ll tmp=-1; init(); for(ll i=0;i<=k;i++){ tmp*=-1; ans+=f[n+1]*rf[i]*rf[n+1-i]*tmp*mypow((k-i+1),n)%mod; } cout<<ans<<endl; sysp; }

Compilation message (stderr)

asceticism.cpp:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import<bits/stdc++.h>
  ^~~~~~
asceticism.cpp: In function 'int main()':
asceticism.cpp:4:20: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
 #define sysp system("pause")
              ~~~~~~^~~~~~~~~
asceticism.cpp:43:2: note: in expansion of macro 'sysp'
  sysp;
  ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...