| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 838511 | skittles1412 | Art Collections (BOI22_art) | C++17 | 1410 ms | 588 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/extc++.h"
using namespace std;
template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
cerr << t;
((cerr << " | " << u), ...);
cerr << endl;
}
#ifdef DEBUG
#define dbg(...) \
cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]: "; \
dbgh(__VA_ARGS__)
#else
#define dbg(...)
#define cerr \
if (false) \
cerr
#endif
#define endl "\n"
#define long int64_t
#define sz(x) int(std::size(x))
/**
* returns how many complaints you will receive for this ordering of the art collections
*/
int publish(vector<int>);
/**
* use this function when you have found the correct order of the art collections
* You must call answer exactly once; your program will be automatically
* terminated afterwards.
*/
void answer(vector<int>);
/**
* implement this function
*/
void solve(int n) {
int arr[n];
vector<int> perm(n);
for (int i = 0; i < n; i++) {
perm[i] = n - i;
}
for (int i = 0; i < n; i++) {
arr[i] = publish(perm);
rotate(perm.begin(), perm.end() - 1, perm.end());
}
int q_arr[n];
for (int i = 0; i < n; i++) {
int me = arr[i], nxt = arr[(i + 1) % n];
dbg(me, nxt);
q_arr[i] = (me - nxt + (n - 1)) / 2;
}
vector<int> ans(n);
for (int i = 0; i < n; i++) {
ans[q_arr[i]] = i + 1;
}
reverse(begin(ans), end(ans));
answer(ans);
}
컴파일 시 표준 에러 (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... | ||||
