Cod sursa(job #637806)
| Utilizator | Data | 20 noiembrie 2011 16:49:03 | |
|---|---|---|---|
| Problema | Zombie | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | .com 2011 | Marime | 0.39 kb |
#include<fstream>
using namespace std;
ofstream fout("zombie.out");
long long int d,n,k,v[1000100];
void citire();
void rez();
void afis();
int main()
{
citire();
rez();
return 0;
}
void citire()
{
ifstream fin("zombie.in");
fin>>d>>n>>k;
for(int i=1;i<=n;i++)
fin>>v[i];
}
void rez()
{int c=0;
int i;
for(i=1;i<n;i++)
if((v[i]-v[n]+v[i])<=1)
c++;
fout<<c+k;
}