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…
24 [程序 24 根据输入求输出] 题目:给一个不多于 5 位的正整数,要求:一.求它是几位数,二.逆序打印出各位数字. package cskaoyan; public class cskaoyan24 { private int number; @org.junit.Test public void positiveInteger() { java.util.Scanner in = new java.util.Scanner(System.in); number = in.nextInt…
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…
题目链接: 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…
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…
Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 25902 Accepted: 9905 Description You are given n closed, integer intervals [ai, bi] and n integers c1, -, cn. Write a program that: reads the number of intervals, their end points and integer…
题目链接 可以发现 十进制4 对应 二进制100 十进制16 对应 二进制10000 十进制64 对应 二进制1000000 可以发现每多两个零,4的次幂就增加1. 用string读入题目给定的二进制数字,求出其长len,当len为奇数时,第一位为1,后面的位数如果都为0,则输出len,如果有一个不为0,则输出len+1: 当len为偶数时,则输出len.(之所以这样输出是因为题目给定4的次幂是从0开始的) #include<iostream> #include<string> #…
题目大意:有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位…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Recently Maxim has found an array of n integers, needed by no one. He immediately come up with idea of changing it: he invented positive integer…