# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
46826 | MatheusLealV | 도서관 (JOI18_library) | C++17 | 2096 ms | 676 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define Nmax 1005
#include "library.h"
using namespace std;
#define f first
#define s second
typedef pair<int, int> pii;
int n, used[Nmax], conta = 0;
void Solve(int N_)
{
n = N_;
if(n == 1)
{
vector<int> aux(1);
aux[0] = 1;
return Answer(aux);
}
vector<int> ans;
for(int i = 1; i <= n; i++)
{
vector<int> v(n);
for(int j = 0; j < n; j++) v[j] = 1;
v[i - 1] = 0;
if(Query(v) == 1)
{
used[i] = 1;
ans.push_back(i);
break;
}
}
for(int i = 1; i < n; i++)
{
for(int j = 1; j <= n; j++)
{
if(used[j]) continue;
vector<int> atual(n);
for(int z = 0; z < ans.size(); z++)
{
atual[ ans[z] - 1] = 1;
}
atual[j - 1] = 1;
if(Query(atual) == 1)
{
used[j] = 1;
ans.push_back(j);
break;
}
}
}
Answer(ans);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |