# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
951819 | EJIC_B_KEDAX | Super Dango Maker (JOI22_dango3) | C++17 | 133 ms | 652 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "dango3.h"
using ll = long long;
using namespace std;
mt19937_64 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
void Solve(int n, int m) {
vector<int> have(n * m);
for (int i = 0; i < n * m; i++) {
have[i] = i + 1;
}
for (int _ = 0; _ < m; _++) {
shuffle(have.begin(), have.end(), mt);
vector<int> nw;
for (int i = 0; i < n; i++) {
nw.push_back(have[i]);
}
int ind = n;
while (Query(nw) < 1) {
nw.push_back(have[ind++]);
}
for (int i = 0; i < nw.size() && nw.size() > n; i++) {
int tmp = nw[i];
swap(nw[i], nw.back());
nw.pop_back();
if (!Query(nw)) {
nw.push_back(tmp);
swap(nw[i], nw.back());
} else {
i--;
}
}
Answer(nw);
unordered_set<int> st;
vector<int> have2;
for (int i : nw) {
st.insert(i);
}
for (int i : have) {
if (st.find(i) == st.end()) {
have2.push_back(i);
}
}
swap(have, have2);
}
}
컴파일 시 표준 에러 (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... |