All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > General
Distinct Values Derivation (Posted on 2015-02-15) Difficulty: 3 of 5
Express a given date in 2015 in the MM/DD/YY format.

Determine the total number of distinct values of MM*DD in the year 2015.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution re: computer solution -- what was I thinking? | Comment 2 of 3 |
(In reply to computer solution by Charlie)

Some numbers were counted that shouldn't have been counted, like 2*31 = 62 or 11*30 = 330.


The answer is actually 178.

Private Sub Form_Load()
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 Form1.Visible = True
  
  For m = 1 To 12
    Select Case m
      Case 1, 3, 5, 7, 8, 10, 12
       fin = 31
      Case 2
       fin = 28
      Case Else
       fin = 30
    End Select
  For d = 1 To fin
   If prod(m * d) = 0 Then ct = ct + 1
   prod(m * d) = 1
  Next
  Next
  Text1.Text = Text1.Text & ct & crlf
 
End Sub


  Posted by Charlie on 2015-02-18 19:43:50
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information