This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Implements (loosely) the QM method for boolean logic simplification. | |
-- | |
-- Encode minterms as integers. | |
-- | |
-- Implicants are sets of integers (think SOP form) | |
-- | |
-- Combining two terms means that their bits differ by 1 and their don't | |
-- care conditions are in the same place, which translates in our model | |
-- to "when matched in order, every pair of elements from both sets have | |
-- the same XOR difference and the XOR difference is a power of two" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Part A – AMT Student Code of Conduct | |
The Australian Maths Trust (AMT) undertakes a range of varied mathematical and informatics activities for students in primary and secondary school including: competitions, enrichment activities, student and teacher workshops, training schools, and various government STEM enrichment initiatives (digIT and Curious Minds). | |
The physical, mental and emotional safety and wellbeing of students, staff and volunteers engaged with all AMT activities is of paramount importance to the AMT. All students are entitled to participate in AMT activities in a safe environment and expected to behave in such a manner that creates a safe, productive and friendly environment. | |
Students engaged in any AMT activity will: | |
1. remember they are representing themselves, their school and family communities and, if selected to an Olympiad team, Australia | |
2. behave appropriately, including showing respect to others, acting with integrity and honesty and conducting themselves in a manner that does not |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstdlib> | |
#include <cassert> | |
#include <algorithm> | |
#include <vector> | |
#include <utility> | |
#include <set> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import * | |
import music | |
import radio | |
MEGALOVANIA2 = "D3:2 D3:2 D4:4 A3:5 0:1 G#3:4 G3:4 F3:4 D3:2 F3:2 G3:2 C3:2 C3:2 D4:4 A3:5 0:1 G#3:4 G3:4 F3:4 D3:2 F3:2 G3:2 B2:2 B2:2 D4:4 A3:5 0:1 G#3:4 G3:4 F3:4 D3:2 F3:2 G3:2 A#2:2 A#2:2 D4:4 A3:5 0:1 G#3:4 G3:4 F3:4 D3:2 F3:2 G3:2 D4:2 D4:2 D5:4 A4:5 0:1 G#4:4 G4:4 F4:4 D4:2 F4:2 G4:2 C4:2 C4:2 D5:4 A4:5 0:1 G#4:4 G4:4 F4:4 D4:2 F4:2 G4:2 B3:2 B3:2 D5:4 A4:5 0:1 G#4:4 G4:4 F4:4 D4:2 F4:2 G4:2 A#3:2 A#3:2 D5:4 A4:5 0:1 G#4:4 G4:4 F4:4 D4:2 F4:2 G4:2 F4:4 F4:2 F4:4 F4:4 F4:4 D4:4 D4:8 D4:2 F4:4 F4:2 F4:4 G4:4 G#4:4 G4:2 F4:2 D4:2 F4:2 G4:2 0:4 F4:4 F4:2 F4:4 G4:4 G#4:4 A4:4 C5:4 A4:6 D5:4 D5:4 D5:2 A4:2 D5:2 C5:16 A4:4 A4:2 A4:4 A4:4 A4:4 G4:4 G4:8 G4:2 A4:4 A4:2 A4:4 A4:4 G4:4 A4:4 C5:4 A4:2 G4:4 D5:2 D4:2 A4:2 D4:2 G4:2 D4:2 F4:2 D4:2 C5:2 C4:2 G4:2 C4:2 F4:2 B3:2 E4:2 B3:2 A#3:6 C4:2 D4:2 F4:4 C5:16 0:16 F4:2 D4:2 F4:2 G4:2 G#4:2 G4:2 F4:2 D4:2 G#4:2 G4:2 F4:2 D4:2 F4:4 G4:16 G#4:4 A4:2 C5:4 A4:2 G#4:2 G4:2 F4:2 D4:2 E4:2 F4:4 G4:4 A4:4 C5:4 C#5:4 G#4:4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alphabet = "abcdefghijklmnopqrstuvwxyz" | |
syllables = "ing er a ly ed i es re tion in e con y ter ex al de com o di en an ty ry u ti ri be per to pro ac ad ar ers ment or tions ble der ma na si un at dis ca cal man ap po sion vi el est la lar pa ture for is mer pe ra so ta as col fi ful get low ni par son tle day ny pen pre tive car ci mo an aus pi se ten tor ver ber can dy et it mu no ple cu fac fer gen ic land light ob of pos tain den ings mag ments set some sub sur ters tu af au cy fa im li lo men min mon op out rec ro sen side tal tic ties ward age ba but cit cle co cov daq dif ence ern eve ies ket lec main mar mis my nal ness ning n't nu oc pres sup te ted tem tim tri tro up" | |
def caesar_decipher(text): | |
text = text.lower() | |
results = [] # Item 0 is score, item 1 is text | |
for i in range(26): # Decode ciphertext, then record number of commonly used syllables present, favouring longer syllables | |
decoded = "".join([(alphabet[i:] + alphabet[:i])[alphabet.index(c)] if c in alphabet else c for c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstdlib> | |
#include <algorithm> | |
using namespace std; | |
int root, al = 1; | |
struct tree { int val, data, l, r, cnt, rmq; } tr[1000005]; | |
void upd(int n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <algorithm> | |
using namespace std; | |
int T, N, M, sieve[1000005]; | |
int q[6] = { 17, 9, 7, 11, 13, 16 }; | |
int res[6]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstdlib> | |
#include <cassert> | |
#include <cstring> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
int T, a[1024], tc[4][1024], tb[1024]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import * | |
# State: 0 if on standby (waiting for button), 1 if active (waiting for shake) | |
state = 0 | |
# The time button A was pressed, in milliseconds | |
last_press = 0 | |
# Target image on display means it's in standby state, stick figure image on display means it's in active state | |
display.show(Image.TARGET) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# "Justifies" your C++ code | |
# Warning: It might split some strings in half :P | |
import sys | |
inp = sys.stdin | |
out = sys.stdout |
NewerOlder