# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
776834 | aZvezda | Team Contest (JOI22_team) | C++14 | 50 ms | 2508 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll MAX_N = 1e5 + 10;
ll n;
pair<ll, pair<int, int> > p[MAX_N];
deque<ll> down, up;
void put_down(ll ind) {
down.push_back(ind);
}
void put_up(ll ind) {
up.push_back(ind);
}
signed main() {
cin >> n;
for(ll i = 0; i < n; i ++) {
cin >> p[i].first >> p[i].second.first >> p[i].second.second;
}
sort(p, p + n);
ll ptr = 0;
ll ans = -1;
for(ll i = 0; i < n; i ++) {
while(ptr < i && p[ptr].first != p[i].first) {
put_down(ptr);
put_up(ptr);
ptr ++;
}
for(ll j = 0; j < down.size(); j ++) {
for(ll k = 0; k < up.size(); k ++) {
int indj = down[j];
int indk = down[k];
if(p[indj].second.first > p[indk].second.first && p[indj].second.second < p[indk].second.second) {
ans = max(ans, p[down[j]].second.first + p[up[k]].second.second + p[i].first);
}
}
}
}
cout << ans << endl;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |