| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 586942 | 8e7 | Super Dango Maker (JOI22_dango3) | C++17 | 430 ms | 552 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Challenge: Accepted
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef zisk
void debug(){cout << endl;}
template<class T, class ... U> void debug(T a, U ... b){cout << a << " ", debug(b...);}
template<class T> void pary(T l, T r) {
while (l != r) cout << *l << " ", l++;
cout << endl;
}
#else
#define debug(...) 0
#define pary(...) 0
#endif
#define ll long long
#define maxn 100005
#define pii pair<int, int>
#define ff first
#define ss second
#define io ios_base::sync_with_stdio(0);cin.tie(0);
namespace {
int query(vector<int> &x) {
pary(x.begin(), x.end());
return Query(x);
}
} // namespace
void Solve(int N, int M) {
srand(time(NULL));
vector<bool> vis(N*M, 0);
for (int i = 0; i < M; i++) {
vector<int> v;
for (int j = 0;j < N*M;j++) {
if (!vis[j]) {
v.push_back(j+1);
}
}
random_shuffle(v.begin(), v.end());
//debug("poss");
//pary(v.begin(), v.end());
vector<int> a;
if (i == M - 1) {
a = v;
} else {
int low = 0, up = v.size();
while (low < up - 1) {
int mid = (low + up) / 2;
vector<int> q(v.begin(), v.begin() + mid);
if (query(q) >= 1) {
up = mid;
} else {
low = mid;
}
}
a.push_back(v[low]);
for (int j = low-1;j >= 0;j--) {
vector<int> q(v.begin(), v.begin() + j);
q.insert(q.end(), a.begin(), a.end());
if (query(q) == 0) {
a.push_back(v[j]);
}
}
}
debug("Answer");
pary(a.begin(), a.end());
Answer(a);
for (int j:a) vis[j-1] = 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... | ||||
