12657专题

UVA-12657 Boxes in a Line(数据结构)

You have n boxes in a line on the table numbered 1…n from left to right. Your task is to simulate 4 kinds of commands: • 1 X Y : move box X to the left to Y (ignore this if X is already the left of

12657 - Boxes in a Line (UVA)

题目链接如下: Online Judge 代码如下: #include <cstdio>#include <utility>// #define debugconst int maxx = 100010;int n, m, kase, op, a, b;int prev[maxx], next[maxx];int main(){#ifdef debugfreopen("0.txt",