| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 289948 | mhy908 | Hamburg Steak (JOI20_hamburg) | C++14 | 3086 ms | 6292 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int inf=1e9;
int n, k;
pair<pii, pii> rct[200010], ans[5];
vector<int> vc;
int main(){
srand(time(NULL));
scanf("%d %d", &n, &k);
for(int i=1; i<=n; i++)scanf("%d %d %d %d", &rct[i].F.F, &rct[i].F.S, &rct[i].S.F, &rct[i].S.S);
for(int i=1; i<=n; i++)vc.eb(i);
while(1){
vector<int> n, y;
for(int i=1; i<=k; i++)ans[i]=mp(mp(1, 1), mp(inf, inf));
for(auto i:vc){
bool flg2=false;
for(int j=1; j<=k; j++){
int sx=max(rct[i].F.F, ans[j].F.F);
int sy=max(rct[i].F.S, ans[j].F.S);
int ex=min(rct[i].S.F, ans[j].S.F);
int ey=min(rct[i].S.S, ans[j].S.S);
if(sx<=ex&&sy<=ey){
ans[j]=mp(mp(sx, sy), mp(ex, ey));
flg2=true;
break;
}
}
if(!flg2)n.eb(i);
else y.eb(i);
}
if(!n.size())break;
vc.clear();
for(auto i:n)vc.eb(i);
for(auto i:y)vc.eb(i);
}
for(int i=1; i<=k; i++)printf("%d %d\n", ans[i].F.F, ans[i].F.S);
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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
