# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1151820 | Muhammad_Aneeq | Light Bulbs (EGOI24_lightbulbs) | C++20 | 2 ms | 408 KiB |
/*
بسم الله الرحمن الرحيم
Author:
(:Muhammad Aneeq:)
*/
#include <iostream>
#warning check the output
using namespace std;
inline void solve()
{
int n;
cin>>n;
int f=n*n;
int an=n*n,val=(1<<f);
for (int i=1;i<(1<<f);i++)
{
cout<<"?\n";
int cnt=0;
for (int j=0;j<n;j++)
{
for (int k=0;k<n;k++)
{
int z=j*n+k;
if ((1<<z)&i)
{
cnt++;
cout<<1;
}
else
cout<<0;
}
cout<<'\n';
}
int z;
cin>>z;
if (z==f)
{
if (an>cnt)
{
an=cnt;
val=i;
}
}
}
cout<<"!\n";
for (int j=0;j<n;j++)
{
for (int k=0;k<n;k++)
{
int z=j*n+k;
if ((1<<z)&val)
cout<<1;
else
cout<<0;
}
cout<<'\n';
}
if (an!=n)
{
exit(-1);
}
}
int main()
{
int t=1;
for (int i=1;i<=t;i++)
{
solve();
}
}
컴파일 시 표준 에러 (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... |