| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 260798 | arnold518 | Library (JOI18_library) | C++14 | 3027 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "library.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 1000;
int N;
vector<int> todo, T, ans;
void Solve(int _N)
{
N=_N;
for(int i=1; i<=N; i++) todo.push_back(i);
ans=vector<int>(N);
T=vector<int>(N, 1);
int now=0;
for(int j=0; j+1<todo.size(); j++)
{
int p=todo[j];
T[p-1]=0;
int q=Query(T);
if(q==1) now=p;
T[p-1]=1;
}
if(now==0) now=todo.back();
for(int j=0; j<todo.size(); j++) if(todo[j]==now)
{
todo.erase(todo.begin()+j);
break;
}
ans[0]=now;
for(int i=2; i<=N; i++)
{
T=vector<int>(N, 1);
for(auto it : todo) T[it-1]=0;
int now=0;
for(int j=0; j+1<todo.size(); j++)
{
int p=todo[j];
T[p-1]=1;
int q=Query(T);
if(q==1) now=p;
T[p-1]=0;
}
if(now==0) now=todo.back();
for(int j=0; j<todo.size(); j++) if(todo[j]==now)
{
todo.erase(todo.begin()+j);
break;
}
ans[i-1]=now;
}
Answer(ans);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
