Cod sursa(job #1708912)

Utilizator TeamFIIGUAIC Parjoala TeamFIIG Data 28 mai 2016 10:13:04
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.57 kb
#include<iostream>
#include<vector>
#include<fstream>
#include<algorithm>

using namespace std;

int main()
{
	ifstream f("carte2.in");
	ofstream g("carte2.out");
	int a, b, c, d, e;
	int t;
	vector<int> v,v2;
	f >> t;
	while (t > 0)
	{
		t--;
		v.clear();
		v2.clear();
		f >> a >> b;
		v2.push_back(a); v2.push_back(b);
		sort(v2.begin(), v2.end());
		f >> c >> d >> e;
		v.push_back(c); v.push_back(d); v.push_back(e);
		sort(v.begin(), v.end());
		if (v2[0] < v[1] && v2[1] < v[2]){
			g << "posibil\n";
		}
		else {
			g << "imposibil\n";
		}
	}
}