railway专题

The Trip On Abandoned Railway(线段树+树状数组)

链接:https://ac.nowcoder.com/acm/problem/13891 来源:牛客网 题目描述 There are many ghosts at the abandoned station on unknown railway. We mark the abandoned stations as 1,2…n according to the order. There are

Students in Railway Carriage CodeForces - 962B

Students in Railway Carriage 题目链接:CodeForces - 962B题意:一排座位,'.'表示空位, '*'表示座位有人, 一共n个座位, 现在有a个A, b个B, 要求A不能和A靠着,B不能和B靠着, 问做多能安排下多少个人;当连续座位数是奇数时按ABABA样式做(A是数量大的那一类, 这样就能多坐下一个人), 偶数就无所谓了(两类人坐下的数量相同);其