Cod sursa(job #1708961)

Utilizator DEFINEtelyEngineersUPB Pirtoaca Vasilescu Zamfiratos DEFINEtelyEngineers Data 28 mai 2016 10:23:15
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.68 kb
#include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>

std::ifstream in("carte2.in");
std::ofstream out("carte2.out");

std::vector<int> V1, V2;

int main() {
    int t;
    in >> t;
    while (t--) {
        int x, y, a, b, c;
        in >> x >> y >> a >> b >> c;
        V1.push_back(x);
        V1.push_back(y);

        V2.push_back(a);
        V2.push_back(b);
        V2.push_back(c);

        std::sort(V1.begin(), V1.end());
        std::sort(V2.begin(), V2.end());

        if (V1[0] < V2[1] && V1[1] < V2[2]) out << "posibil\n";
        else out << "imposibil\n";

        V1.clear();
        V2.clear();
    }
    return 0;
}