[cf621E]Wet Shark and Blocks】的更多相关文章

Description 给定$n$个数和$b$个盒子,放一些数到盒子中,使得盒子不为空.每个盒子中的数是一样的,一个数可以被放到多个盒子中. 从每个盒子中取一个数,组成一个$b$位数,如果这个数$mod\;k=x$,则这是一种合法的方案.求方案数$mod\;10^9+7$. Input 第一行为$4$个数$n,b,x,k$. Output 一行,表示方案数$mod 10^9+7$. Sample Input 3 2 1 23 1 2 Sample Output 6 HINT $2\;\leq\;…
题目链接: http://codeforces.com/problemset/problem/621/E E. Wet Shark and Blocks time limit per test2 secondsmemory limit per test256 megabytes 问题描述 There are b blocks of digits. Each one consisting of the same n digits, which are given to you in the inp…
http://codeforces.com/problemset/problem/621/E E. Wet Shark and Blocks time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are b blocks of digits. Each one consisting of the same n digit…
E. Wet Shark and Blocks time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Sha…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output There are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Shark must choose exactly one d…
题目大意:有m (m<=1e9) 个相同的块,每个块里边有n个数,每个数的范围是1-9,从每个块里边取出来一个数组成一个数,让你求组成的方案中 被x取模后,值为k的方案数.(1<=k<x<=100) 思路:刚开始把m看成了1e5,写了一发数位dp,果断RE,然后我在考虑从当块前状态转移到下一个块状态模数的改变都用的是一套规则,因为 每个块里面的数字都是一样的,那么我们就可以很开心地构造出一个x*x的矩阵进行快速幂啦. #include<bits/stdc++.h> #d…
神奇,矩阵乘法23333333333333333 递推式是很简单的(连我这种不会DP的人都写出来了.) 需要求出的是转移矩阵(还是叫系数矩阵的),也是最这个东西用快速幂. 这个东西的i,j大概就表示从i到j的方案数,那么原始的状态肯定是f[0]=1;对应的矩阵也就是[1,0,0,0,0,0,0,,,,,,] 貌似为了方便??!!这个矩阵貌似可以转化成f[i][i]=1的矩阵...所以..(太BT了,,,还是我太垃圾) 还有最后的答案输出,想了想data[?][kk],?是什么也不好,一开始是0位…
题 Today, Wet Shark is given n integers. Using any of these integers no more than once, Wet Shark wants to get maximum possible even (divisible by 2) sum. Please, calculate this value for Wet Shark. Note, that if Wet Shark uses no integers from the n …
题 There are n sharks who grow flowers for Wet Shark. They are all sitting around the table, such that sharks i andi + 1 are neighbours for all i from 1 to n - 1. Sharks n and 1 are neighbours too. Each shark will grow some number of flowers si. For i…
C. Wet Shark and Flowers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n sharks who grow flowers for Wet Shark. They are all sitting around the table, such that sharks i and i …