2019牛客多校9A
nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial
###namethe power of Fibonacci
###descriptionAmy asks Mr. B problem A. Please help Mr. B to solve the following problem.Let Fi be fibonacci number.$F_0 = 0, F_1 = 1, F_i =...
more...
中国剩余定理
nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial
1234567891011121314#define I __int128void exgcd(I a,I&x,I b,I&y,I c){ // assert(__gcd(a,b)==c) if(b==0) x=c/a,y=0; else exgcd(b,y,a%b,x,c),y-=a/b*x;}inline bool merge(I...
more...
虚树
nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial
虚树就是把树上一些节点拿下来重新建树,插入一些lca之类的点,deltree会删除一颗树,但不会删掉他的边,所以要注意边的情况
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556// tree 节点0不准使用const int...
more...
2019牛客多校8E
nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial
###nameexplorer
###descriptionGromah and LZR have entered the fifth level. Unlike the first four levels, they should do some moves in this level.
There are nvertices and m bidirectional roads in this...
more...