# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
781097 | aZvezda | Super Dango Maker (JOI22_dango3) | C++17 | 152 ms | 528 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 1;
} // namespace
void Solve(int n, int m) {
vector<int> lft = {};
for(int i = 1; i <= n * m; i ++) { lft.push_back(i); }
random_shuffle(lft.begin(), lft.end());
cerr << "Starting ";
for(int i = 0; i < n * m; i ++) { cerr << lft[i] << " "; } cerr << endl;
for(int i = 0; i < m; i ++) {
int l = i * n, r = lft.size();
while(l < r - 1) {
int m = (l + r) / 2ll;
vector<int> now = {};
for(int j = i * n; j < m; j ++)
now.push_back(lft[j]);
if(Query(now) != 0)
r = m;
else
l = m;
}
cerr << "Found out " << r << endl;
vector<int> now = {};
for(int j = i * n; j < r; j ++)
now.push_back(lft[j]);
const auto rem = [&](const auto x) {
for(int i = 0; i < now.size(); i ++) {
if(now[i] == x) {
swap(now[i], now[now.size() - 1]);
now.pop_back();
return;
}
}
};
int ptrbad = i * n;
for(int j = i * n; j < r; j ++) {
int old = lft[j];
rem(old);
int ans = Query(now);
if(ans == 0) {
swap(lft[j], lft[ptrbad]);
ptrbad ++;
now.push_back(old);
}
}
vector<int> group = {};
for(int j = 0; j < n; j ++) {
group.push_back(lft[i * n + j]);
}
Answer(group);
}
}
컴파일 시 표준 에러 (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... |