Submission #1058616

#TimeUsernameProblemLanguageResultExecution timeMemory
1058616SzymonKrzywdaLight Bulbs (EGOI24_lightbulbs)C++17
11 / 100
1 ms344 KiB
#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 (liczba==n){ 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){cout << "!\n"; for (int y=0; y<n; y++){ for (int x=0; x<n; x++){ cout << rand()%2 << ""; } cout << endl; }} return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...