답안 #1058627

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1058627 2024-08-14T11:36:44 Z SzymonKrzywda Light Bulbs (EGOI24_lightbulbs) C++17
11 / 100
4000 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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 0 ms 344 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 0 ms 344 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Execution timed out 4094 ms 344 KB Time limit exceeded
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Partially correct 1 ms 344 KB Partially correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Partially correct 1 ms 344 KB Partially correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 0 ms 344 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Execution timed out 4094 ms 344 KB Time limit exceeded
19 Halted 0 ms 0 KB -