Cod sursa(job #1955781)

Utilizator Andrei2000Andrei Mihailescu Andrei2000 Data 6 aprilie 2017 11:03:08
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.61 kb
#include <bits/stdc++.h>
#define Nmax 100
using namespace std;
ifstream fin ("loto.in");
ofstream fout ("loto.out");
int n,S,v[Nmax];
struct tri{
    int x,y,z;
    bool q;
}trio;
unordered_map <int, tri> hash1;

int main()
{
    fin>>n>>S;
    for(int i=1;i<=n;++i)
        fin>>v[i];
    for(int i=1;i<=n;++i)
        for(int j=1;j<=n;++j)
            for(int k=1;k<=n;++k){
                int w=v[i]+v[j]+v[k];
                hash1[w].x=v[i];
                hash1[w].y=v[j];
                hash1[w].z=v[k];
                hash1[w].q=1;
            }


    fout<<-1<<endl;
    return 0;
}