Основное
 
 
Отправитель Задача Язык Вердикт Время Память Отослано Протест.  
89098170 Дорешивание:
Unic_0rn
479C - 43 C++14 (GCC 6-32) Ошибка исполнения на тесте 26 218 мс 3940 КБ 2020-08-06 10:43:23 2020-08-06 10:43:23
→ Исходный код
/*
	code_template
	author: @unic0rn
*/

#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>

#define IL(a, b, c) for (a = b; a < c; a++)
#define DL(a, b, c) for (a = b; a >= c; a--)
#define ll long long
#define ld double
#define N 1000000007
#define MAX 10001

using namespace std;

bool compare(pair<ll, ll> a, pair<ll, ll> b) {
	if (a.first > b.first) {
		return false;
	}
	if (a.first==b.first) {
		if (a.second > b.second) {
			return false;
		}
	}
	return true;
}

int main()
{

	int testCases=1, i, j, n;
	ll a, b;
	bool flag = false;

	vector<pair<ll, ll>> dates;

	while (testCases--)
	{
		cin >> n;
		IL(i, 0, n) {
			cin >> a >> b;
			dates.push_back({ a, b });
		}
		sort(dates.begin(), dates.end(), compare);

		// IL(i, 0, n) {
		// 	cout << dates[i].first << ' ' << dates[i].second << endl;
		// }
		ll curr = -1;

		IL(i, 0, n) {
			if (dates[i].second>=curr) {
				curr = dates[i].second;
			}
			else {
				curr = dates[i].first;
			}
		}


		cout << curr << endl;
	}


	return 0;
}
?
Время: ? ms, память: ? КБ
Вердикт: ?
Ввод
?
Вывод участника
?
Ответ жюри
?
Комментарий чекера
?
Диагностика
?
Показать детали тестирования