Cod sursa(job #2451099)

Utilizator gabriel_212MitracheG gabriel_212 Data 25 august 2019 18:36:21
Problema Cutii Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.73 kb
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;

int main()
{
    vector<int> x;
    vector<int> y;
    vector<int> z;

ifstream f("cutii.in");

ofstream g("cutii.out");

int n,t,k=1,d;

f>>n>>t;

for(int i=1;i<=n*t;i++){

    f>>d;
x.push_back(d);
    f>>d;
y.push_back(d);
    f>>d;
    z.push_back(d);
}
for(int l=1;l<=t;l++){
k=1;
for(int i=n*(l-1)+1;i<=n*l;i++){

    for(int j=n*(l-1)+1;j<=n*l;j++){
if(x[i]!=0&&x[j]!=0){
        if((x[i]>x[j]&&y[i]>y[j]&&z[i]>z[j])||(x[i]<x[j]&&y[i]<y[j]&&z[i]<z[j])){


            k++;

          x[j]=0;

            j=n*l+1;
            }
        }
    }
}

g<<k<<endl;

}

f.close();

g.close();

    return 0;
}