Submission #1058638

# Submission time Handle Problem Language Result Execution time Memory
1058638 2024-08-14T11:41:49 Z SzymonKrzywda Light Bulbs (EGOI24_lightbulbs) C++17
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>

using namespace std;
bool odp_=false;

int main()
{
    int n;
    cin >> n;
    
    for (int i=0; i<(1<<(n*n)); i++){
        cout << i << endl;
        int l=0;
        int liczba=0;
        vector<vector<int>> grid(n,vector<int>(n));
        for (int y=0; y<n; y++){
            for (int x=0; x<n; x++){
                //cout << i << " " << (1<<l) << " " << (i & (1<<l)) << endl;
                if (i & (1<<l)){
                    grid[y][x] = 1;
                    liczba++;
                }
                l++;
            }
        }
        if (true){
            cout << "?"<<endl;
            for (int y=0; y<n; y++){
                for (int x=0; x<n; x++){
                    cout << grid[y][x] << "";
                }
                cout << endl;
            }
            int odp;
            cin >> odp;
            if (odp==(n*n)){
                cout << "!"<<endl;
                for (int y=0; y<n; y++){
                    for (int x=0; x<n; x++){
                        cout << grid[y][x] << "";
                    }
                    cout << endl;
                }
                odp_=true;
                break;
            }
        }
        
        
        
    }
    //if (!odp_){
     //   while (true){}
    //}

    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -