# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1015023 | hmm789 | Mouse (info1cup19_mouse) | C++14 | 1 ms | 344 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
void solve(int n) {
vector<int> v, ans;
for(int i = 0; i < n; i++) {
v.push_back(2);
ans.push_back(-1);
}
for(int i = 0; i < n; i++) {
v[i] = 1;
if(query(v) == 2) ans[i] = 1;
v[i] = 2;
}
for(int i = 2; i < n; i++) {
vector<int> pos;
for(int j = 0; j < n; j++) {
if(ans[j] == -1) pos.push_back(j);
v[j] = ans[j];
}
int l = 0, r = pos.size()-1, m;
while(l < r) {
m = (l+r)/2;
for(int j = 0; j <= m; j++) v[pos[j]] = i;
for(int j = m+1; j < pos.size(); j++) v[pos[j]] = 1;
if(query(v) == i) r = m;
else l = m+1;
}
ans[pos[l]] = i;
}
for(int i = 0; i < n; i++) if(ans[i] == -1) ans[i] = n;
query(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... |