# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
537208 | Gurban | Jakarta Skyscrapers (APIO15_skyscraper) | C++17 | 384 ms | 262144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
const int maxn=3e4+5;
const int B = 180;
int n,m;
int b[maxn],p[maxn];
int ver[maxn][B];
int dis[maxn * B];
bool vis[maxn * B];
vector<pair<int,int>>E[maxn * B];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m;
int sq = sqrt(n) + 2;
int sz = n - 1;
for(int i = 0;i < n;i++) for(int j = 1;j <= sq;j++) ver[i][j] = ++sz;
for(int i = 0;i < n;i++){
for(int j = 1;j <= sq;j++){
E[ver[i][j]].push_back({i,0});
// E[i].push_back({ver[i][j],0});
if(i - j >= 0) E[ver[i][j]].push_back({ver[i-j][j],1});
if(i + j < n) E[ver[i][j]].push_back({ver[i+j][j],1});
}
}
# | 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... |