| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 798491 | Ronin13 | Building Skyscrapers (CEOI19_skyscrapers) | C++17 | 269 ms | 42440 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <set>
#include <queue>
#include <map>
#include <bitset>
#define ll long long
#define ull unsigned ll
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define epb emplace_back
#define mp make_pair
using namespace std;
const ll mod = 998244353;
vector <int> d;
int main(){
ios_base::sync_with_stdio(false); cin.tie(0);
int n; cin >> n;
int type; cin >> type;
set <pair<pii, int> > st;
vector <int> ans;
pii mn = mp(1e9 + 1, 1e9 + 1);
int mni;
map <pii, int> m;
int x[n + 1], y[n + 1];
for(int i = 1; i <= n; i++){
cin >> x[i] >> y[i];
m[mp(x[i], y[i])] = i;
if(mn > mp(x[i], y[i]))
mn = mp(x[i], y[i]), mni = i;
}
st.insert(mp(mn, mni));
m[mn] = 0;
d.pb(-1); d.pb(0); d.pb(1);
while(!st.empty()){
int x = st.begin()->s;
pii o = st.begin()->f;
st.erase(st.begin());
ans.pb(x);
for(int i = 0; i < 3; i++){
int curx = o.f, cury = o.s;
for(int j = 0; j < 3; j++){
int nx = curx + d[i];
int ny = cury + d[j];
if(m[mp(nx, ny)]){
st.insert(mp(mp(nx, ny), m[mp(nx, ny)])), m[mp(nx, ny)] = 0;
}
}
}
}
if(ans.size() == n){
cout << "YES\n";
for(int i = 0; i < ans.size(); ++i){
cout << ans[i] << ' ';
}
}
else cout << "NO\n";
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... | ||||
