This documentation is automatically generated by online-judge-tools/verification-helper
//go:build ignore
// verification-helper: PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/lesson/1/ALDS1/3/ALDS1_3_B
package main
import (
"bufio"
"fmt"
"math"
"os"
"strconv"
"github.com/today2098/algorithm-go/algorithm"
)
var sc = bufio.NewScanner(os.Stdin)
var wr = bufio.NewWriter(os.Stdout)
func getInt() int {
sc.Scan()
elem, err := strconv.Atoi(sc.Text())
if err != nil {
panic(err)
}
return elem
}
func getString() string {
sc.Scan()
return sc.Text()
}
func out(x ...any) {
fmt.Fprintln(wr, x...)
}
func main() {
sc.Split(bufio.ScanWords)
sc.Buffer([]byte{}, math.MaxInt32)
defer wr.Flush()
n, q := getInt(), getInt()
type task struct {
name string
time int
}
que := algorithm.NewQueue[*task]()
for i := 0; i < n; i++ {
t := &task{}
t.name, t.time = getString(), getInt()
que.Push(t)
}
now := 0
for !que.Empty() {
t := que.Pop()
if t.time <= q {
now += t.time
out(t.name, now)
} else {
now += q
t.time -= q
que.Push(t)
}
}
}
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.10/site-packages/onlinejudge_verify/documentation/build.py", line 71, in _render_source_code_stat
bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
File "/home/runner/.local/lib/python3.10/site-packages/onlinejudge_verify/languages/user_defined.py", line 68, in bundle
raise RuntimeError('bundler is not specified: {}'.format(str(path)))
RuntimeError: bundler is not specified: verify/aoj-ALDS1_3_B-queue.test.go