| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1362389 | biserailieva | Dark Ride (EGOI25_darkride) | C++20 | 0 ms | 528 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin>>n;
string s="1";
for(int i=1;i<n;i++)
{
s+="0";
}
cout<<"? "<<s<<endl;
int x;
cin>>x;
int l=1, r=n-1;
if(x==1)
{
while(l<r)
{
int mid=(l+r)/2;
s=string(n, '0');
s[0]='1';
for(int i=l;i<=mid;i++)
{
s[i]='1';
}
cout<<"? "<<s<<endl;
cin>>x;
if(x%2==0)
{
r=mid;
}
else
{
l=mid+1;
}
}
cout<<"! "<<0<<" "<<l<<endl;
}
else
{
l=0;
r=n/2-1;
while(l<r)
{
int mid=(l+r)/2;
s=string(n, '0');
for(int i=l;i<=mid;i++)
{
s[i]='1';
}
cout<<"? "<<s<<endl;
cin>>x;
if(x%2==1)
{
r=mid;
}
else
{
l=mid+1;
}
}
int A=l;
l=n/2;
r=n-1;
while(l<r)
{
int mid=(l+r)/2;
s=string(n, '0');
for(int i=l;i<=mid;i++)
{
s[i]='1';
}
cout<<"? "<<s<<endl;
cin>>x;
if(x%2==1)
{
r=mid;
}
else
{
l=mid+1;
}
}
int B=l;
cout<<"! "<<A<<" "<<B<<endl;
}
return 0;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
