# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
915738 | IBory | Super Dango Maker (JOI22_dango3) | C++17 | 640 ms | 856 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dango3.h"
#include <bits/stdc++.h>
#include <random>
using namespace std;
const int MAX = 10004;
int V[MAX];
void Solve(int N, int M) {
random_device rd;
vector<int> P;
for (int i = 1; i <= N * M; ++i) P.push_back(i);
for (int t = 1; t <= M; ++t) {
vector<int> G, T;
shuffle(P.begin(), P.end(), rd);
for (int i = 0; i < N * M; ++i) {
if (V[P[i]]) continue;
G.push_back(P[i]);
}
if (G.size() == N) {
Answer(G);
return;
}
T.push_back(G.back()); G.pop_back();
int idx = 0;
while (T.size() < N) {
swap(G[idx], G[G.size() - 1]);
int n = G.back(); G.pop_back();
if (Query(G) == M - t) T.push_back(n);
else {
G.push_back(n);
swap(G[idx], G[G.size() - 1]);
idx++;
}
}
Answer(T);
for (int n : T) V[n] = 1;
}
}
컴파일 시 표준 에러 (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... |