Skip to content

Instantly share code, notes, and snippets.

const programs = [
[
"20",
"CLEAR 21",
"OR 10 11",
"CLEAR 27",
"CLEAR 24",
"AND 21 25",
"OR 8 4",
"SET 11",
let lineNumber = +readline()
let input = [];
while (lineNumber--) {
input.push(readline())
}
writeline(UltraCISC(input))
function UltraCISC(commands) {
let result = new Array(32).fill("?");
for(c=Array(32).fill(2);l=readline();c[e]={S:3,A:c[e]&c[g],O:c[e]|c[g]}[d]|0)[[d],e,g]=l.split` `
writeline(c.reduce((p,f)=>'0.?1'[f]+p,''))