feat(q-solved): add first q-solved writeup

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
juju committed 2022-03-25 22:45:24 +01:00
1 parent 8cbb1a0b89
commit 6f5bbb7ceb
12 files changed
+17645 -6

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env python3
import json
with open('circuit.json', 'r') as f:
j = json.load(f)
nq = j['memory']
system = ['0'] * nq
for cs in j['circuit']:
if len(cs) == 1:
system[cs[0][1]] = '1' if cs[0][0] else '0'
system.reverse()
result = "".join(system)
print(int.to_bytes(int(result, 2), nq//8, 'little'))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.