Borderou de evaluare (job #2514227)
Utilizator | Data | 24 decembrie 2019 21:01:06 | |
---|---|---|---|
Problema | Permutari2 | Status | done |
Runda | Arhiva de probleme | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:3:120: error: redefinition of 'int k'
using namespace std;ifstream fin("permutari2.in");ofstream fout("permutari2.out");int dp[305][305],fact[305],n,k,i=1,j,k;int main(){fin>>n>>k;fact[0]=1;for (;i<=n;++i)fact[i]=fact[i-1]*i%10007;for(int i=1;i<=n;++i){dp[1][i]=fact[i];for(j=1;j<i;++j)dp[1][i]=(dp[1][i]-dp[1][j]*fact[i-j]+10007*10007)%10007;}dp[1][1]=1;for(i=1;i<=n;++i)for(j=2;j<= k&&j<=i;++j)for(int k=1;k<=i-j+1;++k)dp[j][i]=(dp[j][i]+dp[1][k]*dp[j-1][i-k])%10007;fout<<dp[k][n];}
^
main.cpp:3:112: note: 'int k' previously declared here
using namespace std;ifstream fin("permutari2.in");ofstream fout("permutari2.out");int dp[305][305],fact[305],n,k,i=1,j,k;int main(){fin>>n>>k;fact[0]=1;for (;i<=n;++i)fact[i]=fact[i-1]*i%10007;for(int i=1;i<=n;++i){dp[1][i]=fact[i];for(j=1;j<i;++j)dp[1][i]=(dp[1][i]-dp[1][j]*fact[i-j]+10007*10007)%10007;}dp[1][1]=1;for(i=1;i<=n;++i)for(j=2;j<= k&&j<=i;++j)for(int k=1;k<=i-j+1;++k)dp[j][i]=(dp[j][i]+dp[1][k]*dp[j-1][i-k])%10007;fout<<dp[k][n];}
^
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !