結果
| 問題 | No.3797 Express Elevators and Emergency Stairs |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2026-11-17 10:35:34 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 40 ms / 2,000 ms |
| + 370µs | |
| コード長 | 706 bytes |
| 記録 | |
| コンパイル時間 | 297 ms |
| コンパイル使用メモリ | 64,256 KB |
| 実行使用メモリ | 9,860 KB |
| 最終ジャッジ日時 | 2026-11-17 10:35:38 |
| 合計ジャッジ時間 | 3,219 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3797.cc: No.3797 Express Elevators and Emergency Stairs - yukicoder
*/
#include<cstdio>
#include<algorithm>
#include<utility>
using namespace std;
/* constant */
const int MAX_N = 200000;
/* typedef */
using pii = pair<int,int>;
/* global variables */
int as[MAX_N], bs[MAX_N];
pii ps[MAX_N];
/* subroutines */
/* main */
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%d%d", as + i, bs + i);
for (int i = 0; i < n; i++) ps[i] = {as[i] ,bs[i]};
sort(ps, ps + n);
int x = 1;
for (int i = 0; i < n; i++) {
auto [ai, bi] = ps[i];
if (ai <= x) x = max(x, bi);
else break;
}
printf("%d\n", x);
return 0;
}
tnakao0123