Instantly share code, notes, and snippets.

# Brian Chenbetaveros

• Sort options
Created Jul 30, 2020
crude generic puzzlehunt models
View models.py
 from django.db import models from django.contrib.auth.models import AbstractUser from django.db.models import OuterRef, Exists, Sum, Q from django.core.validators import MinValueValidator import django.urls as urls
Created Jul 15, 2020
UVA 1374: Power Calculus
View 1374-ac.cpp
 #include #include #include #include using namespace std; #define fori(i,s,e) for(int i = s; i < ((int)e); i++) #define allof(s) (s).begin(), (s).end() const int MAX = 3000;
Created Jul 8, 2020
UVA 1374: Power Calculus (TLE version. how to improve?)
View 1374.cpp
 #include #include #include #include #include using namespace std; #define fori(i,s,e) for(int i = s; i < ((int)e); i++) #define allof(s) (s).begin(), (s).end()
Created Jul 8, 2020
UVA 12558: Egyptian Fractions
View 12558.cpp
 #include #include #include using namespace std; #define fori(i,s,e) for(int i = s; i < ((int)e); i++) long long gcd(long long x, long long y) { return y == 0 ? x : gcd(y, x % y); }
Created Feb 10, 2020
C chords. thanks, music21
View gist:9663e49011a722e82e835b8d86234ee4
 In [73]: for i in range(70): ...: print('C{} ='.format(i), end=" ") ...: try: ...: print(' '.join(pitch.nameWithOctave for pitch in ChordSymbol('C{}'.format(i)).pitches)) ...: except Exception as e: ...: print(e) ...: C0 = C3 C1 = C3 C3 C2 = C3 D3
Created Feb 10, 2020
more chords http://marg.snu.ac.kr/chord_generation/
View gist:48ed6e60c2a1562249dfbf29bfd85e19
 major 40173 dominant 19633 minor 11501 minor-seventh 7156 major-seventh 2828 maj 1516 major-sixth 1442 dominant-ninth 1210 [] 1180 minor-sixth 692
Created Jan 6, 2020
 I 4281 IV 3311 V 2250 i 1289 bVII 1207 vi 944 bVI 587 ii 521 bIII 343 iv 211
Created Dec 4, 2019
Advent of Code 2019 Day 4, DP solution