Cod sursa(job #1708893)

Utilizator UBB_Craciun_Griza_PuscasUBB ATeamHasNoName UBB_Craciun_Griza_Puscas Data 28 mai 2016 10:08:52
Problema Carte2 Scor 0
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.53 kb
#include <bits/stdc++.h>
using namespace std;

vector <int> v;

int a, b, c, d, e, t;

int main() {
    ifstream f("carte2.in");
    ofstream g("carte2.out");

    f>>t;
    while(t--) {
        f>>a>>b>>c>>d>>e;

        v.clear();
        v.push_back(a);
        v.push_back(b);
        v.push_back(0);

        bool ok = false;

        do {
            if(v[0] < c && v[1] < d && v[2] < e)
                ok = true;
        } while(next_permutation(v.begin(), v.end()));

        g<<(ok? "posibil\n":"imposibil\n");
    }

    return 0;
}