JZOJ5891. 【NOIP2018模拟10.4】巡逻

题解 每次贪心,将最小的放在最前面, 将那些没有条件限制的所有数,一定是从小到大来。 于是每次就要么从有限制的那些数里面去一个, 或者从没有限制的数里面去最小的。 code #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #define N 100003 #define P putchar
相关文章
相关标签/搜索