Cod sursa(job #2655117)
Utilizator | Data | 3 octombrie 2020 11:57:10 | |
---|---|---|---|
Problema | Sandokan | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream si("sandokan.in");
ofstream so("sandokan.out");
int x[5005];
int main() {
int n, k;
si>>n>>k;
n--;
k--;
k=n%k;
x[0]=1;
for(int i=1; i<=n; ++i)
for(int j=k; j; --j)
x[j]=(x[j]+x[j-1])%2000003;
so<<x[k]<<'\n';
return 0;
}