А
Size: a a a
А
CM
Э
DE
А
L
L
function binarySimulation(s, q){
const result = []
for (let i = 0; i < q.length; i += 1) {
if (q[i][0] === 'I') {
const start = q[i][1] - 1
const length = q[i][2] - start
const arr = new Array(10).fill(0)
arr.splice(start, length, ...'1'.repeat(length))
s = (Number(`0b${s}`) ^ Number(`0b${arr.join('')}`)).toString(2).padStart(10, 0)
console.log(s)
}
if (q[i][0] === 'Q') {
result.push(s[q[i][1] - 1])
}
}
return result
}
Number(`0b${s}
)`L
L
L
L
L
L
L