algorithm_competition

package
v0.0.0-...-4869a34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActCfg

type ActCfg struct {
	ActId      int
	PriceLimit int
	Discount   int
	Number     int
	UserLimit  int
	UserCost   map[int]int
}

type DiscountSystem

type DiscountSystem struct {
	Config []ActCfg
}

func Constructor

func Constructor() DiscountSystem

func (*DiscountSystem) AddActivity

func (this *DiscountSystem) AddActivity(actId int, priceLimit int, discount int, number int, userLimit int)

func (*DiscountSystem) Consume

func (this *DiscountSystem) Consume(userId int, cost int) int

func (*DiscountSystem) RemoveActivity

func (this *DiscountSystem) RemoveActivity(actId int)

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

type NumHeap

type NumHeap []float64

func (NumHeap) Len

func (h NumHeap) Len() int

func (NumHeap) Less

func (h NumHeap) Less(i, j int) bool

func (*NumHeap) Pop

func (h *NumHeap) Pop() interface{}

func (*NumHeap) Push

func (h *NumHeap) Push(x interface{})

func (NumHeap) Swap

func (h NumHeap) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL