好恶心的题
#include#include #include #include #include using namespace std;typedef __int64 ll;struct point{ ll word,priori;}P[50005];char T[8][100]={ { "Add"},{ "Close"},{ "Chat"},{ "Rotate"},{ "Prior"},{ "Choose"},{ "Top"},{ "Untop"}};int sz,op,always=-1;void per(int x){ point ttt = P[x]; for(int i=x; i>0; --i) P[i]=P[i-1]; P[0]=ttt;}void last(int x){ point ttt= P[x]; for(int i=x; i = sz){ printf("Operation #%d: out of range.\n",op++); }else{ point ttt=P[id]; for(int i=id; i>0; --i) P[i]=P[i-1]; P[0]=ttt; printf("Operation #%d: success.\n",op++); }}void solve4(){ if(sz==0){ printf("Operation #%d: empty.\n",op++); }else{ int loc=0; ll hi=-1; for(int i=0; i hi) hi=P[i].priori,loc=i; point ttt=P[loc]; for(int i=loc; i>0; --i) P[i]=P[i-1]; P[0]=ttt; printf("Operation #%d: success.\n",op++); }}void solve5(){ ll id; scanf("%I64d",&id); int loc=-1; for(int i=0; i 0; --i) P[i]=P[i-1]; P[0]=ttt; printf("Operation #%d: success.\n",op++);}void solve6(){ ll id; scanf("%I64d",&id); int loc=-1; for(int i=0; i