| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1364548 | biserailieva | Light Bulbs (EGOI24_lightbulbs) | C++20 | 0 ms | 420 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
string komb[3]={"100", "010", "001"};
cout<<"?"<<endl;
cout<<"111"<<endl;
cout<<"000"<<endl;
cout<<"000"<<endl;
int x;
cin>>x;
if(x==n*n)
{
cout<<"!"<<endl;
cout<<"111"<<endl;
cout<<"000"<<endl;
cout<<"000"<<endl;
return 0;
}
cout<<"?"<<endl;
cout<<"000"<<endl;
cout<<"111"<<endl;
cout<<"000"<<endl;
cin>>x;
if(x==n*n)
{
cout<<"!"<<endl;
cout<<"000"<<endl;
cout<<"111"<<endl;
cout<<"000"<<endl;
return 0;
}
cout<<"?"<<endl;
cout<<"000"<<endl;
cout<<"000"<<endl;
cout<<"111"<<endl;
cin>>x;
if(x==n*n)
{
cout<<"!"<<endl;
cout<<"000"<<endl;
cout<<"000"<<endl;
cout<<"111"<<endl;
return 0;
}
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
for(int k=0;k<3;k++)
{
cout<<"?"<<endl;
cout<<komb[i]<<endl;
cout<<komb[j]<<endl;
cout<<komb[k]<<endl;
cin>>x;
if(x==n*n)
{
cout<<"!"<<endl;
cout<<komb[i]<<endl;
cout<<komb[j]<<endl;
cout<<komb[k]<<endl;
return 0;
}
}
}
}
return 0;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
