제출 #1229156

#제출 시각아이디문제언어결과실행 시간메모리
1229156gry3125Light Bulbs (EGOI24_lightbulbs)C++20
0 / 100
0 ms416 KiB
#include <bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define ll long long int
using namespace std;

int main() {
    int n; cin >> n; int a[9], mn = 10, m[9];
    for (int i = 0LL; i < (1LL << 9); i++) {
        for (int j = 0; j < 9; j++) {
            if ((i & (1 << j)) > 0) a[j] = 1;
            else a[j] = 0;
        }
        ll sum = 0; 
        for (int i = 0; i < 9; i++) sum += a[i];
        if (sum >= mn) continue;
        cout << "?";
        for (int i = 0; i < 9; i++) {
            if (i % 3 == 0) cout << "\n";
            cout << a[i] << " ";
        }
        cout << "\n";
        ll L; cin >> L;
        if (L == 9) {
            mn = sum;
            for (int i = 0; i < 9; i++) m[i] = a[i];
        }
    }
    cout << "!";
    for (int i = 0; i < 9; i++) {
        if (i % 3 == 0) cout << "\n";
        cout << m[i] << " ";
    }
    cout << "\n";

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...