For problem statement at 0-999/600-699/630-639/639/problemA.txt this is a correct solution, but verifier at 0-999/600-699/630-639/639/verifierA.go ends with can you fix the verifier? ```go
package main
import (
"bufio"
"os"
"sort"
"strconv"
)
type friend struct {
id int
score int
}
type bit struct {
tree []int
size int
}
func newBit(size int) *bit {
return &bit{
tree: make([]int, size+1),
size: size,
}
}
func (b *bit) update(idx, val int) {
for idx <= b.size {
b.tree[idx] += val
idx += idx & -idx
}
}
func (b *bit) query(idx int) int {
sum := 0
for idx > 0 {
sum += b.tree[idx]
idx -= idx & -idx
}
return sum
}
func main() {
scanner := bufio.NewScanner(os.Stdin)
scanner.Split(bufio.ScanWords)
writer := bufio.NewWriter(os.Stdout)
defer writer.Flush()
readInt := func() int {
scanner.Scan()
val, _ := strconv.Atoi(scanner.Text())
return val
}
n := readInt()
k := readInt()
q := readInt()
friends := make([]friend, n)
for i := 0; i < n; i++ {
friends[i] = friend{id: i + 1, score: readInt()}
}
// Create a copy to sort and determine ranks based on score
sorted := make([]friend, n)
copy(sorted, friends)
// Sort descending by score
sort.Slice(sorted, func(i, j int) bool {
return sorted[i].score > sorted[j].score
})
// Map friend ID to rank (1-based, 1 is best score)
rank := make([]int, n+1)
for i, f := range sorted {
rank[f.id] = i + 1
}
tree := newBit(n)
online := make([]bool, n+1)
for i := 0; i < q; i++ {
kind := readInt()
id := readInt()
if kind == 1 {
// Friend becomes online
// Problem guarantees friend wasn't online before
online[id] = true
tree.update(rank[id], 1)
} else {
// Check if displayed
if !online[id] {
writer.WriteString("NO\n")
} else {
// Calculate number of online friends with better or equal score
// This corresponds to finding the sum in BIT up to the friend's rank
currentRank := tree.query(rank[id])
if currentRank <= k {
writer.WriteString("YES\n")
} else {
writer.WriteString("NO\n")
}
}
}
}
}
```