-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path053.lol
38 lines (34 loc) · 1.27 KB
/
053.lol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
HAI 1.2
OBTW
C(K, N) = C(N-K, N)
C(0, N) = C(N, N) = 1
C(K, N) = C(K, N-1) + C(K-1, N-1)
TO AVOID INTEGER OVERFLOW, WE STORE ONLY VALUES OF THE TRIANGLE <= 1KK,
AND STORE 1KK+1 IF > 1KK. THAT'S ENOUGH INFORMATION AS WE ONLY CARE
ABOUT HOW MANY ARE > 1KK
TLDR
I HAS A INCOME
I HAS A MILLIONAIRES ITZ 0 BTW PPL WHO HAZ 1 MILLN R NOT REAL MILLIONAIRES
I HAS A PASCALTRIANGLE ITZ A BUKKIT
IM IN YR LOOP UPPIN YR N WILE DIFFRINT N 101
PASCALTRIANGLE HAS A SRS N ITZ A BUKKIT
IM IN YR LOOOP UPPIN YR K WILE DIFFRINT K SUM OF N 1
EITHER OF...
BOTH SAEM BIGGR OF N 1 1...
EITHER OF BOTH SAEM K 0 BOTH SAEM K N
O RLY?
YA RLY
INCOME R 1
NO WAI
INCOME R SUM OF...
PASCALTRIANGLE'Z SRS DIFF OF N 1'Z SRS DIFF OF K 1...
PASCALTRIANGLE'Z SRS DIFF OF N 1'Z SRS K
OIC
PASCALTRIANGLE'Z SRS N HAS A SRS K ITZ SMALLR OF INCOME 1000001
DIFFRINT BIGGR OF INCOME 1000000 1000000, O RLY?
YA RLY, MILLIONAIRES R SUM OF MILLIONAIRES 1
OIC
IM OUTTA YR LOOOP
IM OUTTA YR LOOP
VISIBLE MILLIONAIRES
KTHXBYE