1003- simulation game

A

Nothing to say, \ (F [I] = F [I -. 1] + F [I - 2] - F [I -. 11] \) did not launch, but did not occur with the use of matrix multiplication to seek + KSM ( similar to the whole matrix multiplication Fibonacci), mixed analog violent \ (60 \)

B

Daily dementia

Seriously considered space complexity, \ (10005 \ 10005 Times \) and then erase \ (6 \) a \ (0 \) , calculated \ (100 \) a little more

but,

int value to be multiplied by 4-ah! ! ! !

\ (100 \) becomes \ (400 \) , \ (128M \) space limit my people instantly gone from the WA60 to WA0, very happy

If only I miscalculated space (in particular, do not take int \ (4 \) , LL do not take \ (8 \) , I Women inverted shampoo)

Think of Fenwick tree Dui reverse seeking, seeking how different intervals, like a long range of numbers is \ (1 ~ n \) What does it mean, in fact, can be used to carry out his Fenwick tree (not discrete) means qwq, instead, the important condition: \ (Σ|l [I] - L [I -. 1] | + Σ|r [I] - R & lt [I -. 1] | ≤. 7. 6 × 10 ^ \) to provoke ignored qwq

** so blind to think of the chaos offline, to sort the problem out again,In fact, it will do so TFirst sort is necessary to use \ (NlogN \) time, and can not guarantee that even left right \ (≤ 7 × 10 ^ 6 \)

Positive solutions directly online, every time it wants to shift the interval

Remember what shift method ( \ ([L, R & lt] \) is already considered a good section)

scanf("%d%d",&l,&r);        
while(L < l){
    ans -= getsum(a[L] - 1);//[L,R]中比a[L]小的数
    modify(a[L], -1);//将这个数从区间中去掉
    L ++;
} 
while(L > l){
    ans += getsum(a[L - 1] - 1);//[L,R]中比a[L-1]小的数
    modify(a[L - 1], 1);
    L --;
}
while(R < r){
    ans += getsum(n) - getsum(a[R + 1]);//[L,R]中比a[R+1]大的数
    modify(a[R + 1], 1);
    R ++;
} 
while(R > r){
    ans -= getsum(n) - getsum(a[R]);//[L,R]中比a[R]大的数
    modify(a[R], -1);
    R --;
} 
printf("%d\n",ans);

C

Ah, Yes, this is like a pressure

What? ? Then I would not be the whole ah (established state with marked path difference galaxy)

Then established the state does not know how to push the next stepI feel it my state of compression is really too weak QwQ

Should do something like pressure and special exercises with recursion, maybe I are not going to write

And I did not expect to be put down people's backs, others go back

wtcl

Incidentally %%% put into practice 3 decimal binary standard process step on seniors explosion

Summary of a wave

Expected Score: \ (= 60 + 60 + 120 0 \)

Actual Score: \ (60 + 0 + 0 = 0 \)

AWSL

And not be called a score QwQ clear conscience, A + title push out the matrix multiplication equation does not recognize me, but B title Actually, I think I should do it Orz Orz Orz, C Correction title also changed very self closed, I think I really too weak a force code

Guess you like

Origin www.cnblogs.com/qwqq/p/11621094.html