JZOJ5891. 【NOIP2018模擬10.4】巡邏

題解 每次貪心,將最小的放在最前面, 將那些沒有條件限制的所有數,一定是從小到大來。 於是每次就要麼從有限制的那些數裏面去一個, 或者從沒有限制的數裏面去最小的。 code #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #define N 100003 #define P putchar
相關文章
相關標籤/搜索