| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 633452 | Astrayt | Team Contest (JOI22_team) | C++17 | 2082 ms | 14492 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//君の手を握ってしまったら
//孤独を知らないこの街には
//もう二度と帰ってくることはできないのでしょう
//君が手を差し伸べた 光で影が生まれる
//歌って聞かせて この話の続き
//連れて行って見たことない星まで
//さユリ - 花の塔
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define starburst ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pii pair<int,int>
#define pb push_back
#define ff first
#define ss second
#define N 100005
struct bev{
int t, x, y, z;
};
void solve(){
int n; cin >> n;
vector<bev> v(n), buk[3];
for(int i = 0; i < n; ++i){
cin >> v[i].x >> v[i].y >> v[i].z; v[i].t = i;
int k = max({v[i].x, v[i].y, v[i].z});
if(k == v[i].x) buk[0].pb(v[i]);
if(k == v[i].y) buk[1].pb(v[i]);
if(k == v[i].z) buk[2].pb(v[i]);
}
sort(buk[0].begin(), buk[0].end(), [](bev a, bev b){return a.x > b.x;});
sort(buk[1].begin(), buk[1].end(), [](bev a, bev b){return a.y > b.y;});
sort(buk[2].begin(), buk[2].end(), [](bev a, bev b){return a.z > b.z;});
int ans = -1;
for(int i = 0; i < buk[0].size(); ++i){
for(int j = 0; j < buk[1].size(); ++j){
if(buk[0][i].t == buk[1][j].t) continue;
bev b1 = buk[0][i], b2 = buk[1][j];
if(b1.x <= b2.x || b2.y <= b1.y) continue;
for(int k = 0; k < buk[2].size(); ++k){
bev b3 = buk[2][k];
if(b1.t == b3.t || b2.t == b3.t) continue;
if(b1.x <= b3.x || b2.y <= b3.y) continue;
if(b3.z <= max(b2.z, b1.z)) continue;
ans = max(ans, b1.x + b2.y + b3.z);
}
}
}
cout << ans << '\n';
}
signed main(){
starburst
int t = 1; //cin >> t;
while(t--) solve();
}
컴파일 시 표준 에러 (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... | ||||
