#include <stdio.h>
void recur(int flag[], int n, int idx) {
if (idx == n) {
for (int i = 0; i < n; i++) {
if (flag[i]) {
}
}
return;
}
recur(flag, n, idx + 1);
int temp = flag[idx];
flag[idx] = 1;
recur(flag, n, idx + 1);
flag[idx] = temp;
}
int main() {
int flag[] = {0, 0, 0};
recur(flag, 1, 0);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHJlY3VyKGludCBmbGFnW10sIGludCBuLCBpbnQgaWR4KSB7CiAgaWYgKGlkeCA9PSBuKSB7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICBpZiAoZmxhZ1tpXSkgewogICAgICAgIHByaW50ZigiJWQgICIsIGkpOwogICAgICB9CiAgICB9CiAgICBwcmludGYoIlxuIik7CiAgICByZXR1cm47CiAgfQoKICByZWN1cihmbGFnLCBuLCBpZHggKyAxKTsKICBpbnQgdGVtcCA9IGZsYWdbaWR4XTsKICBmbGFnW2lkeF0gPSAxOwogIHJlY3VyKGZsYWcsIG4sIGlkeCArIDEpOwogIGZsYWdbaWR4XSA9IHRlbXA7Cn0KCmludCBtYWluKCkgewogIGludCBmbGFnW10gPSB7MCwgMCwgMH07CiAgcmVjdXIoZmxhZywgMSwgMCk7CiAgcmV0dXJuIDA7Cn0=