結果
| 問題 | 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) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 431 bytes |
| 記録 | |
| コンパイル時間 | 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 |
ソースコード
#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;
}
forest3