09 2022 档案
摘要:两个协程交替打印 两个channel 思路: 使用两个通道,一个协程从自己的通道中取出数,然后向对方的通道中放一个数 代码: // 两个协程 func printA(c1, c2 chan int, wg *sync.WaitGroup) { defer wg.Done() for i := 0;
阅读全文
摘要:用set代替模拟双端带顺序的队列 今天做了一道题,做了好久,因为我太菜了。 题目: A - Max Mod Min Problem Statement You are given a sequence of NN positive integers: A=(A_1,A_2,\dots,A_N)A=(
阅读全文