双向循环链表! #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <vector> #include <unordered_map> using namespace std; typedef long long LL; struct Node{ int w; int nx; int pre; }nodes[55]; int main() { cin.tie(0); ...