# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
339539 | ogibogi2004 | 동굴 (IOI13_cave) | C++14 | 222 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include<bits/stdc++.h>
using namespace std;
void exploreCave(int N) {
int b[N];
bool locked[N];
int s[N],d[N];
vector<int>unlocked;
for(int i=0;i<N;i++)
{
unlocked.clear();
for(int j=0;j<N;j++)
{
if(!locked[j])
{
b[j]=0;
unlocked.push_back(j);
}
}
int xd=tryCombination(b);
if(xd==i)
{
int low=0,high=unlocked.size()-1,mid,ans;
while(low<=high)
{
mid=(low+high)/2;
for(int j=0;j<unlocked.size();j++)
{
if(j<=mid)b[j]=0;
else b[j]=1;
}
int r=tryCombination(b);
if(r==i)
{
ans=mid;
high=mid-1;
}
else low=mid+1;
}
b[unlocked[ans]]=1;
locked[unlocked[ans]]=1;
s[unlocked[ans]]=1;
d[unlocked[ans]]=i;
}
else
{
int low=0,high=unlocked.size()-1,mid,ans;
while(low<=high)
{
mid=(low+high)/2;
for(int j=0;j<unlocked.size();j++)
{
if(j<=mid)b[j]=1;
else b[j]=0;
}
int r=tryCombination(b);
if(r==i)
{
ans=mid;
high=mid-1;
}
else low=mid+1;
}
b[unlocked[ans]]=0;
locked[unlocked[ans]]=1;
s[unlocked[ans]]=0;
d[unlocked[ans]]=i;
}
}
answer(s,d);
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |