Pagini recente » Cod sursa (job #128354) | Cod sursa (job #2736335) | Cod sursa (job #1501143) | Cod sursa (job #2511633) | Cod sursa (job #197628)
Cod sursa(job #197628)
#include <fstream>
using namespace std;
int a,b,ok;
ofstream fout ("grigo.out");
void citire()
{
ifstream fin ("grigo.in");
fin>>a>>b;
int x;
for (int i=0;i<b;i++)
{
fin>>x;
if (x==1)
ok=1;
}
}
void afisare()
{
if (ok==0)
fout<<0;
else
{
if (b==1)
fout<<1;
else
{
long long x=1;
for (int y=1;y<=a-b+1;y++)
{
x*=y;
x=x%1000003;
}
fout<<x;
}
}
}
int main ()
{
citire();
afisare();
}