Cod sursa(job #886859)
Utilizator | Data | 23 februarie 2013 12:53:10 | |
---|---|---|---|
Problema | Inundatii | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <fstream>
using namespace std;
ifstream f("inundatii.in");
ofstream g("inundatii.out");
long long a,b,c,x,y,z,n,i,s;
int main()
{
f>>n;
f>>a>>b>>c;
for(i=1;i<=n-1;i++){
f>>x>>y>>z;
if(a>x && b>y && c>z)
s+=a-x+b-y+c-z+3;
x=a;y=b;z=c;}
g<<s;
}