#include <iostream> #include <set> using namespace std; int main() { int n, t; cin >> n; // 使用 set 自动维护所有队列的队尾(从小到大排序) // 初始化 set,放入 0 作为哨兵(保证 set 非空,且所有车号都 > 0) set<int> s; s.insert(0); for (int i = 0; i < n; i++) { cin >> t; // 分析:当前车号 t 需要插入队列 // 条件:如果 t < 当...