Comment detail

ICPC2007アジア地区予選A (Nested Flatten)
n = 100000
m = 100000
k = 100000
66029
4.921875秒
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
    Private Function mamakodate(ByVal n As Integer, ByVal k As Integer, ByVal m As Integer) As Integer
        'カードを並べる
        Dim List As New List(Of Integer)
        For i As Integer = 0 To n - 1
            List.Add(i + 1)
        Next

        Dim index As Integer = m - 1
        While List.Count <> 1
            List.RemoveAt(index)

            index += k - 1
            While index > List.Count - 1
                index -= List.Count
            End While
        End While
        Return List(0)
    End Function

Index

Feed

Other

Link

Pathtraq

loading...