Cod sursa(job #2000767)

Utilizator refugiatBoni Daniel Stefan refugiat Data 14 iulie 2017 17:51:25
Problema Amlei Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.89 kb
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
ifstream si("amlei.in");
ofstream so("amlei.out");
struct secv
{
    set<vector<int> >s;
    void cit(int n,int x)
    {
        s.clear();
        vector<int> v;
        for(int i=1;i<=x;i++)
        {
            v.clear();
            for(int j=1;j<=n;j++)
            {
                int x;
                si>>x;
                if(x>0)
                    v.push_back(x);
            }
            sort(v.begin(),v.end());
            s.insert(v);
        }
    }
};
int main()
{
    int n,k,p;
    while(1)
    {
        si>>n>>k>>p;
        if(si.eof())
            break;
        secv x,y;
        x.cit(n,k);
        y.cit(n,p);
        if(x.s==y.s)
            so<<"DA\n";
        else
            so<<"NU\n";
    }
    return 0;
}