Created
September 13, 2012 06:17
-
-
Save nomeaning777/3712287 to your computer and use it in GitHub Desktop.
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
Module MainModule | |
Sub Main() | |
Dim comb(101, 101) As Integer, ans As Integer = 0 | |
comb(0, 0) = 1 | |
For i = 0 To 100 | |
For j = 0 To i | |
comb(i + 1, j) += comb(i, j) | |
If comb(i + 1, j) > 1000000 Then | |
comb(i + 1, j) = 1000000 | |
End If | |
comb(i + 1, j + 1) += comb(i, j) | |
If comb(i + 1, j + 1) > 1000000 Then | |
comb(i + 1, j + 1) = 1000000 | |
End If | |
If comb(i, j) >= 1000000 Then | |
ans += 1 | |
End If | |
Next | |
Next | |
Console.WriteLine(ans) ' 4075 | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment