diff --git a/QUSTOJ/1844_x7536110.cpp b/QUSTOJ/1844_x7536110.cpp new file mode 100644 index 0000000..0806757 --- /dev/null +++ b/QUSTOJ/1844_x7536110.cpp @@ -0,0 +1,156 @@ +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +typedef long long LL; +LL dpyes[25][15],dpno[25][15],ttime[25],num[25],top=0; +int judge(LL l,LL r) +{ + for (int i=r; i>=l; i--) + { + if (num[i]&1)//odd + { + LL tt=1; + while (i-1>=l&&(num[i-1]&1))i--,tt++; + if (i!=l&&tt%2==1) return false; + } + else + { + LL tt=1; + while (i-1>=l&&!(num[i-1]&1))i--,tt++; + if (i!=l&&tt%2==0) return false; + } + } + return true; +} +LL cal(LL x) +{ + LL res=0; + top=0; + while (x) + { + num[++top]=x%10; + x/=10; + } + for (int i=1; i0; i--) + { + if (!judge(i+1,top)) break; + int hh=1,ti=i+1; + while (ti+1<=top&&(num[ti+1]%2==num[ti]%2))ti++,hh++; + if (num[i+1]&1)//odd + { + if (hh&1)//odd + { + for (int j=1; j