# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
229335 | osaaateiasavtnl | 곤돌라 (IOI14_gondola) | C++14 | 44 ms | 4732 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
#include "gondola.h"
signed valid(signed n, signed a[])
{
set <int> ms;
for (int i = 0; i < n; ++i)
ms.insert(a[i]);
if (ms.size() < n)
return 0;
int pos = -1;
for (int i = 0; i < n; ++i) {
if (a[i] <= n) {
pos = i;
break;
}
}
if (pos == -1)
return 1;
else {
for (int sh = 0; sh < n; ++sh) {
int i = (pos + sh) % n;
int val = a[pos] + sh;
if (val > n)
val -= n;
if (a[i] <= n && a[i] != val)
return 0;
}
return 1;
}
}
//----------------------
signed replacement(signed n, signed a[], signed ans[])
{
int pos = -1, S;
for (int i = 0; i < n; ++i) {
if (a[i] <= n) {
pos = i;
pos = a[i];
break;
}
}
if (pos == -1) {
pos = 0;
S = 1;
}
vector <ii> ar;
for (int sh = 0; sh < n; ++sh) {
int i = (pos + sh) % n;
int val = S + sh;
if (val > n)
val -= n;
if (a[i] > n) {
ar.app(mp(a[i], val));
}
}
sort(all(ar));
int ptr = 0;
int xp = n + 1;
for (auto e : ar) {
int cur = e.s;
while (xp <= e.f) {
//cout << cur << "->" << xp << endl;
ans[ptr++] = cur;
cur = xp++;
}
}
return ptr;
}
//----------------------
signed countReplacement(signed n, signed inputSeq[])
{
return -3;
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |