diff --git a/SDUTOJ/3563_huayunhualuo.cpp b/SDUTOJ/3563_huayunhualuo.cpp new file mode 100644 index 0000000..3a3e3c2 --- /dev/null +++ b/SDUTOJ/3563_huayunhualuo.cpp @@ -0,0 +1,98 @@ +#include + +using namespace std; + +const int Max = 100100; + +struct node +{ + int sore; + + int ali; + + int Id; + + bool operator < (const node &a)const + { + return sore == a.sore ? Id a.sore; + } + +}a[Max*2],b[Max],c[Max]; + + +void Solve(int n) +{ + int num1 = 0,num2 = 0; + + for(int i = 0;i a[i+1].ali) + { + b[num1]= a[i]; + + b[num1].sore++; num1++; + + c[num2++] = a[i+1]; + } + else + { + + b[num1]= a[i+1]; + + b[num1].sore++; num1++; + + c[num2++] = a[i]; + } + } + + int num = 0; + + int i = 0 ,j = 0; + + while(ic[j].sore || (b[i].sore == c[j].sore && b[i].Id