<commit_before><commit_msg>add ALDS1_4_B by Go<commit_after>package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func search(n int, as []int, q int, bs []int) {
	count := 0
	for _, b := range bs {
		l := 0
		r := n
		flag := true
		for l < r && flag {
			m := (r + l) / 2
			v := as[m]
			if v == b {
				count++
				flag = false
			} else if v > b {
				r = m
			} else {
				l = m + 1
			}
		}
	}
	fmt.Println(count)
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	n, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return n
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	n := nextInt(sc)
	var as []int
	for i := 0; i < n; i++ {
		as = append(as, nextInt(sc))
	}
	q := nextInt(sc)
	var bs []int
	for i := 0; i < q; i++ {
		bs = append(bs, nextInt(sc))
	}
	search(n, as, q, bs)
}
{'fraction_non_alphanumeric': 0.1880952380952381, 'fraction_numerical': 0.009523809523809525, 'mean_word_length': 2.364, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '834506', 'n_tokens_mistral': 436, 'n_tokens_neox': 392, 'n_words': 109}