# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
558060 | groshi | 동굴 (IOI13_cave) | C++17 | 939 ms | 660 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<vector>
#include "cave.h"
using namespace std;
bool nwm[5010];
int s1[5010],d1[5010];///s to w ktora strone dobry pstryczek, d1 to ktore drzwi otwiera
/*int tryCombination(vector<int> Q)
{
for(int i=0;i<Q.size();i++)
cout<<Q[i]<<" ";
int x;
cin>>x;
return x;
}*/
void exploreCave(int n)
{
for(int i=0;i<n;i++)
{
int chce[n+3];
for(int j=0;j<n;j++)
{
if(nwm[j]==0)
chce[j]=0;
else chce[j]=s1[j];
}
//cout<<"wstepnie ";
int k=tryCombination(chce);
int on;
if(k!=i)///to znaczy ze s1[i]=0;
on=0;
else on=1;
//cout<<"drzwi "<<i<<" maja "<<on<<"\n";
int pocz=0,kon=n,sre,ostd;
while(pocz<kon)
{
//cout<<"sprawdzam przedzial "<<pocz<<" "<<kon<<"\n";
sre=(pocz+kon)/2;
for(int j=0;j<n;j++)
{
if(nwm[j]==1)
chce[j]=s1[j];
else{
if(j<pocz || j>sre)
chce[j]=on;
else chce[j]=!on;
}
}
int k=tryCombination(chce);
if(k==i)
{
//cout<<"w przedziale\n";
kon=sre;
ostd=sre;
}
else {
//cout<<"poza przedzialem\n";
pocz=sre+1;
}
}
s1[ostd]=on;
d1[ostd]=i;
nwm[ostd]=1;
}
answer(s1,d1);
/*for(int i=0;i<n;i++)
cout<<s1[i]<<" ";
cout<<"\n";
for(int i=0;i<n;i++)
cout<<d1[i]<<" ";*/
}
컴파일 시 표준 에러 (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... |