제출 #341395

#제출 시각아이디문제언어결과실행 시간메모리
341395A_DZapina (COCI20_zapina)C++14
22 / 110
1096 ms364 KiB
/* ID: antwand1 TASK: pprime LANG: C++ */ #include <bits/stdc++.h> #define ll long long #define int long long #define du long double #define F first #define S second #define FOR(a,b) for(int a=1;a<=b;a++) #define FORl(a,b) for(a=1;a<=b;a++) #define FOR0(a,b) for(int a=1;a<b;a++) #define FORl0(a,b) for(a=0;a<b;a++) #define ii pair<int,int> using namespace std; const int MOD=1e9+7; const int N=500; int fact[N]; int a[N]; int n; ll po(ll x,ll os) { if( os == 0 ) return 1; ll z = po(x,os/2); if( os&1 ) return z*z%MOD*x%MOD; return z*z%MOD; } ll modInv(ll x) { return po(x,MOD-2); } ll c(ll n,ll r) { return fact[n]*modInv(fact[r]*fact[n-r]%MOD)%MOD; } ll g(ll n,ll r) { return fact[n]*modInv(fact[n-r]%MOD)%MOD; } int bc(int j) { if(j==n){ //cout<<a[0]; for(int i=0;i<n;i++)if(a[i]==i+1)return 1; return 0; } int ret=0; for(int i=0;i<n;i++){ a[i]++; ret+=bc(j+1)%MOD; a[i]--; } return ret; } main() { cin>>n; for(int i=0;i<n;i++)a[i]=0; cout<<bc(0); }

컴파일 시 표준 에러 (stderr) 메시지

zapina.cpp:53:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   53 | main()
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...