# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
92151 | Kastanda | Kocka (COCI18_kocka) | C++11 | 62 ms | 5916 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, L[N], R[N], U[N], D[N];
int l[N], r[N], u[N], d[N];
inline void Upd(int x, int y)
{
if (y >= 1) L[x] = min(L[x], y);
if (y <= n) R[x] = max(R[x], y);
if (x >= 1) U[y] = min(U[y], x);
if (x <= n) D[y] = max(D[y], x);
}
int main()
{
scanf("%d", &n);
memset(L, 63, sizeof(L));
memset(R, -1, sizeof(R));
memset(U, 63, sizeof(U));
memset(D, -1, sizeof(D));
for (int i = 1; i <= n; i++)
{
scanf("%d", &l[i]);
if (l[i] != -1) l[i] ++;
else l[i] = n + 1;
Upd(i, l[i]);
}
for (int i = 1; i <= n; i++)
{
scanf("%d", &r[i]);
if (r[i] != -1) r[i] = n - r[i];
컴파일 시 표준 에러 (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... |