SRM498

TopCoder占い!
If A>=B And A>=C Then
と書くべきところを
If A>B And A>C Then
と書いていて、それに気づかずに時間をかけてしまう。


得点:227.62/250
アンラッキーデーだ
実装(VB.NET)


Imports Microsoft.VisualBasic
Imports System
Imports System.Collections
Imports System.Text
Imports System.Math
Imports Weight=System.Int32

Public Class AdditionGame
Public Function getMaximumPoints(ByVal A As Integer, ByVal B As Integer, ByVal C As Integer, ByVal N As Integer) As Integer
Dim i As Integer,j As Integer=0
For i=1 To N
If Math.Max(a,Math.Max(b,c))=a Then
j+=A:A-=1:If a<0 Then A=0
Console.WriteLine(a)
Else If Math.max(a,Math.max(b,c))=b then
j+=b:b-=1:If b<0 Then b=0
Console.WriteLine(b)
Else
j+=c:c-=1:If c<0 Then C=0
Console.WriteLine(c)
End If
Next i
Return j
End Function

End Class