結果

問題 No.3797 Express Elevators and Emergency Stairs
コンテスト
ユーザー forest3
提出日時 2026-11-19 13:29:24
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 431 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,129 ms
コンパイル使用メモリ 196,440 KB
実行使用メモリ 9,848 KB
最終ジャッジ日時 2026-11-19 13:29:29
合計ジャッジ時間 4,646 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for (int i = a; i < b; i++)
using ll = long long;

int main(){
	int n;
	cin >> n;
	using P = pair<int, int>;
	vector<P> p;
	rep(i, 0, n) {
		int a, b;
		cin >> a >> b;
		p.emplace_back(a, b);
	}
	sort(p.begin(), p.end());
	int now = 1, ans = 1;
	rep(i, 0, n) {
		if(p[i].first <= now) {
			now = p[i].second;
			ans = max(ans, now);
		}
	}
	cout << ans << endl;
}
0